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
This commit is contained in:
kiran 2011-01-27 01:38:26 +00:00
parent 4a33cdacde
commit 2901299ff6
2 changed files with 11 additions and 6 deletions

View File

@ -90,6 +90,7 @@ public class NewVariantEvalWalker extends RodWalker<Integer, Integer> implements
private Set<String> knownNames = new TreeSet<String>();
private Set<String> evalNames = new TreeSet<String>();
private Set<String> sampleNames = new TreeSet<String>();
private int numSamples = 0;
// The list of stratifiers and evaluators to use
private TreeSet<VariantStratifier> stratificationObjects = null;
@ -366,13 +367,17 @@ public class NewVariantEvalWalker extends RodWalker<Integer, Integer> implements
// Now that we have all the rods categorized, determine the sample list from the eval rods.
Map<String, VCFHeader> vcfRods = VCFUtils.getVCFHeadersFromRods(getToolkit(), evalNames);
Set<String> 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<Integer, Integer> 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<Integer, Integer> implements
* @return the number of samples
*/
public int getNumSamples() {
return sampleNames.size();
return numSamples;
}
/**

View File

@ -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);