Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed a bug where normal p value argument in FilterMutectCalls was static #5982

Merged
merged 1 commit into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public double getLogIndelPrior() {
public double initialLogPriorOfVariantVersusArtifact = DEFAULT_INITIAL_LOG_PRIOR_OF_VARIANT_VERSUS_ARTIFACT;

@Argument(fullName = NORMAL_P_VALUE_THRESHOLD_LONG_NAME, optional = true, doc = "P value threshold for normal artifact filter")
public static final double normalPileupPValueThreshold = DEFAULT_NORMAL_P_VALUE_THRESHOLD;
public double normalPileupPValueThreshold = DEFAULT_NORMAL_P_VALUE_THRESHOLD;

@Argument(fullName = MIN_POLYMERASE_SLIPPAGE_LENGTH, optional = true, doc = "Minimum number of reference bases in an STR to suspect polymerase slippage")
public int minSlippageLength = DEFAULT_MIN_SLIPPAGE_LENGTH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private void buildFiltersList(final M2FiltersArgumentCollection MTFAC) {
filters.add(new StrandArtifactFilter());
filters.add(new ContaminationFilter(MTFAC.contaminationTables, MTFAC.contaminationEstimate));
filters.add(new PanelOfNormalsFilter());
filters.add(new NormalArtifactFilter());
filters.add(new NormalArtifactFilter(MTFAC.normalPileupPValueThreshold));
filters.add(new NRatioFilter(MTFAC.nRatio));
filters.add(new StrictStrandBiasFilter(MTFAC.minReadsOnEachStrand));
filters.add(new ReadPositionFilter(MTFAC.minMedianReadPosition));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ public class NormalArtifactFilter extends Mutect2VariantFilter {
private static final double MIN_NORMAL_ARTIFACT_RATIO = 0.1; // don't call normal artifact if allele fraction in normal is much smaller than allele fraction in tumor
private static final int IMPUTED_NORMAL_BASE_QUALITY = 30; // only used if normal base quality annotation fails somehow

private final double normalPileupPValueThreshold;
public NormalArtifactFilter(final double normalPileupPValueThreshold) {
this.normalPileupPValueThreshold = normalPileupPValueThreshold;
}

@Override
public ErrorType errorType() { return ErrorType.ARTIFACT; }

Expand Down Expand Up @@ -50,7 +55,7 @@ public double calculateErrorProbability(final VariantContext vc, final Mutect2Fi
final double normalPValue = 1 - new BinomialDistribution(null, normalDepth, QualityUtils.qualToErrorProb(medianRefBaseQuality))
.cumulativeProbability(normalAltDepth - 1);

return normalPValue < M2FiltersArgumentCollection.normalPileupPValueThreshold ? 1.0 : normalArtifactProbability;
return normalPValue < normalPileupPValueThreshold ? 1.0 : normalArtifactProbability;
}

@Override
Expand Down