From 2901299ff6dc680e2164ce16b7bb1490aeb3878d Mon Sep 17 00:00:00 2001 From: kiran Date: Thu, 27 Jan 2011 01:38:26 +0000 Subject: [PATCH] Sets the number of samples to all of the samples in the file when it's not specifed on the command-line explicitly. GenotypeConcordance no longer a standard evaluation. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5094 348d0f76-0448-11de-a6fe-93d51630548a --- .../newvarianteval/NewVariantEvalWalker.java | 15 ++++++++++----- .../evaluators/GenotypeConcordance.java | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/NewVariantEvalWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/NewVariantEvalWalker.java index 60f4e371a..e8a84e075 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/NewVariantEvalWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/NewVariantEvalWalker.java @@ -90,6 +90,7 @@ public class NewVariantEvalWalker extends RodWalker implements private Set knownNames = new TreeSet(); private Set evalNames = new TreeSet(); private Set sampleNames = new TreeSet(); + private int numSamples = 0; // The list of stratifiers and evaluators to use private TreeSet stratificationObjects = null; @@ -366,13 +367,17 @@ public class NewVariantEvalWalker extends RodWalker implements // Now that we have all the rods categorized, determine the sample list from the eval rods. Map vcfRods = VCFUtils.getVCFHeadersFromRods(getToolkit(), evalNames); Set vcfSamples = SampleUtils.getSampleList(vcfRods, VariantContextUtils.GenotypeMergeType.REQUIRE_UNIQUE); - sampleNames.add(ALL_SAMPLE_NAME); // If we're not using the per-sample stratification, don't bother loading the sample list if (Arrays.asList(STRATIFICATIONS_TO_USE).contains("Sample")) { sampleNames.addAll(SampleUtils.getSamplesFromCommandLineInput(vcfSamples, SAMPLE_EXPRESSIONS)); + numSamples = sampleNames.size(); + } else { + numSamples = vcfSamples.size(); } + sampleNames.add(ALL_SAMPLE_NAME); + // Initialize select expressions jexlExpressions.addAll(VariantContextUtils.initializeMatchExps(SELECT_NAMES, SELECT_EXPS)); @@ -491,10 +496,10 @@ public class NewVariantEvalWalker extends RodWalker implements } if ( trackName.contains("eval") ) { - vc = getSubsetOfVariantContext(vc, sampleNamesMinusAll); + VariantContext vcsub = (sampleNamesMinusAll.size() > 0) ? getSubsetOfVariantContext(vc, sampleNamesMinusAll) : vc; - if (byFilter || !vc.isFiltered()) { - vcs.put(ALL_SAMPLE_NAME, vc); + if (byFilter || !vcsub.isFiltered()) { + vcs.put(ALL_SAMPLE_NAME, vcsub); } } @@ -601,7 +606,7 @@ public class NewVariantEvalWalker extends RodWalker implements * @return the number of samples */ public int getNumSamples() { - return sampleNames.size(); + return numSamples; } /** diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/evaluators/GenotypeConcordance.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/evaluators/GenotypeConcordance.java index 416ec34d9..354b61d9c 100755 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/evaluators/GenotypeConcordance.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/newvarianteval/evaluators/GenotypeConcordance.java @@ -44,7 +44,7 @@ import java.util.*; */ @Analysis(name = "Genotype Concordance", description = "Determine the genotype concordance between the genotypes in difference tracks") -public class GenotypeConcordance extends VariantEvaluator implements StandardEval { +public class GenotypeConcordance extends VariantEvaluator { private static final boolean PRINT_INTERESTING_SITES = true; protected final static Logger logger = Logger.getLogger(GenotypeConcordance.class);