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

Made number of samples to put variant site in M2 pon adjustable #4566

Merged
merged 2 commits into from
Mar 23, 2018
Merged
Changes from 1 commit
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 @@ -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 {
Expand All @@ -114,6 +118,14 @@ 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<File> vcfs = new LinkedHashSet<>(0);

/**
* The VCFs can be input as either one or more .args file(s) containing one VCF per line, or VCFs can be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment block got copied and pasted from above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops!

* specified explicitly on the command line.
*/
@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."
*/
Expand Down Expand Up @@ -178,10 +190,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<VariantContext> variants, final VariantContextWriter writer) {
if (variants.size() > 1){
private void processVariantsAtSamePosition(final List<VariantContext> variants, final VariantContextWriter writer) {
if (variants.size() >= minSampleCount){
final VariantContext mergedVc = AssemblyBasedCallerUtils.makeMergedVariantContext(variants);
final VariantContext outputVc = new VariantContextBuilder()
.source(mergedVc.getSource())
Expand Down