diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/CreateSomaticPanelOfNormals.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/CreateSomaticPanelOfNormals.java index 624cd261cb7..a596e033355 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/CreateSomaticPanelOfNormals.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/mutect/CreateSomaticPanelOfNormals.java @@ -99,6 +99,10 @@ public class CreateSomaticPanelOfNormals extends CommandLineProgram { public static final String INPUT_VCFS_LIST_LONG_NAME = "vcfs"; public static final String INPUT_VCFS_LIST_SHORT_NAME = "vcfs"; + public static final String MIN_SAMPLE_COUNT_LONG_NAME = "min-sample-count"; + + public static final int DEFAULT_MIN_SAMPLE_COUNT = 2; + public static final String DUPLICATE_SAMPLE_STRATEGY_LONG_NAME = "duplicate-sample-strategy"; public enum DuplicateSampleStrategy { @@ -114,6 +118,13 @@ public enum DuplicateSampleStrategy { doc="VCFs for samples to include. May be specified either one at a time, or as one or more .args file containing multiple VCFs, one per line.", optional = false) private Set vcfs = new LinkedHashSet<>(0); + /** + * Number of samples containing a variant site required to include it in the panel of normals. + */ + @Argument(fullName = MIN_SAMPLE_COUNT_LONG_NAME, + doc="Number of samples containing a variant site required to include it in the panel of normals.", optional = true) + private int minSampleCount = DEFAULT_MIN_SAMPLE_COUNT; + /** * How to handle duplicate samples: THROW_ERROR to fail, CHOOSE_FIRST to use the first vcf with each sample name, ALLOW_ALL to use all samples regardless of duplicate sample names." */ @@ -178,10 +189,8 @@ public Object doWork() { return "SUCCESS"; } - //TODO: this is the old Mutect behavior that just looks for multiple hits - //TODO: we should refine this - private static void processVariantsAtSamePosition(final List variants, final VariantContextWriter writer) { - if (variants.size() > 1){ + private void processVariantsAtSamePosition(final List variants, final VariantContextWriter writer) { + if (variants.size() >= minSampleCount){ final VariantContext mergedVc = AssemblyBasedCallerUtils.makeMergedVariantContext(variants); final VariantContext outputVc = new VariantContextBuilder() .source(mergedVc.getSource())