Skip to content

Commit

Permalink
fixing a logic error for an underutilized codepath for event filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesemery committed Jan 30, 2023
1 parent 52b3037 commit 0ae8da5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public final class PileupDetectionArgumentCollection {
*/
@Advanced
@Hidden
@Argument(fullName= PILEUP_DETECTION_FILTER_ASSEMBLY_HAPS_THRESHOLD, doc = "If enabled (set to non-zero), will apply the \"badness\" filter to compatable assembled haplotypes.", optional = true)
@Argument(fullName= PILEUP_DETECTION_FILTER_ASSEMBLY_HAPS_THRESHOLD, doc = "If enabled (set to non-zero), will apply the \"badness\" filter to compatible assembled haplotypes.", optional = true)
public double assemblyBadReadThreshold = 0.4;
@Hidden
@Argument(fullName= PILEUP_DETECTION_EDIT_DISTANCE_BADNESS_FOR_ASSEMBLY_LONG_NAME, doc = "Pileup Detection: Reject alt reads with greater than this fraction of mismatching bases from the reference (proxied using the NM tag). (Requires '--"+PILEUP_DETECTION_LONG_NAME+"' argument)", optional = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public static boolean shouldFilterAssemblyVariant(final PileupDetectionArgumentC
validatePileupVariant(pileupVariant);
final int pileupSupport = pileupVariant.getAttributeAsInt(PILEUP_ALLELE_SUPPORTING_READS, 0);
final int assemblyBadReads = pileupVariant.getAttributeAsInt(PILEUP_ALLELE_ASSEMBLY_BAD_READS_TAG, 0);
return ((args.assemblyBadReadThreshold <= 0.0) && (double) assemblyBadReads / (double) pileupSupport >= args.assemblyBadReadThreshold);
return ((args.assemblyBadReadThreshold > 0.0) && (double) assemblyBadReads / (double) pileupSupport >= args.assemblyBadReadThreshold);
}

private static void validatePileupVariant(final VariantContext pileupVariant) {
Expand Down

0 comments on commit 0ae8da5

Please sign in to comment.