Skip to content

Commit

Permalink
more printIf
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbenjamin committed Jun 15, 2023
1 parent 889c488 commit 6ae6abf
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,14 @@ public static AssemblyResultSet generatePDHaplotypes(final AssemblyResultSet sou
* NOTE: we skip the reference allele in the event that we are making determined haplotypes instead of undetermined haplotypes
*/
for (int determinedAlleleIndex = (pileupArgs.determinePDHaps?0:-1); determinedAlleleIndex < allEventsHere.size(); determinedAlleleIndex++) { //note -1 for I here corresponds to the reference allele at this site
if (debug) System.out.println("Working with allele at site: "+(determinedAlleleIndex ==-1? "[ref:"+(start-referenceHaplotype.getStart())+"]" : PartiallyDeterminedHaplotype.getDRAGENDebugEventString(referenceHaplotype.getStart()).apply(allEventsHere.get(determinedAlleleIndex))));
final boolean isRef = determinedAlleleIndex == -1;
final Event determinedEventToTest = allEventsHere.get(isRef ? 0 : determinedAlleleIndex);
Utils.printIf(debug, () -> "Working with allele at site: "+(isRef? "[ref:"+(start-referenceHaplotype.getStart())+"]" : PartiallyDeterminedHaplotype.getDRAGENDebugEventString(referenceHaplotype.getStart()).apply(determinedEventToTest)));
// This corresponds to the DRAGEN code for
// 0 0
// 0 1
// 1 0
final boolean isRef = determinedAlleleIndex == -1;
final Event determinedEventToTest = allEventsHere.get(isRef ? 0 : determinedAlleleIndex);


/*
* Here we handle any of the necessary work to deal with the event groups and maybe forming compound branches out of the groups
Expand Down Expand Up @@ -212,7 +213,7 @@ public static AssemblyResultSet generatePDHaplotypes(final AssemblyResultSet sou
branchExcludeAlleles.addAll(newBranchesToAdd);

if (branchExcludeAlleles.size() > MAX_BRANCH_PD_HAPS) {
if (debug ) System.out.println("Found too many branches for variants at: "+determinedEventToTest.getStart()+" aborting and falling back to Assembly Variants!");
Utils.printIf(debug, () -> "Found too many branches for variants at: "+determinedEventToTest.getStart()+" aborting and falling back to Assembly Variants!");
return sourceSet;
}
}
Expand Down

0 comments on commit 6ae6abf

Please sign in to comment.