Cleanup for new SampleUtils function
-- getVCFHeadersFromRods(rods) is now available so that you don't have getVCFHeadersFromRods(rods, null) throughout the codebase
This commit is contained in:
parent
35fe9c8a06
commit
67b022c34b
|
|
@ -41,6 +41,9 @@ public class CountVariants extends VariantEvaluator implements StandardEval {
|
||||||
public long nDeletions = 0;
|
public long nDeletions = 0;
|
||||||
@DataPoint(description = "Number of complex indels")
|
@DataPoint(description = "Number of complex indels")
|
||||||
public long nComplex = 0;
|
public long nComplex = 0;
|
||||||
|
@DataPoint(description = "Number of symbolic events")
|
||||||
|
public long nSymbolic = 0;
|
||||||
|
|
||||||
@DataPoint(description = "Number of mixed loci (loci that can't be classified as a SNP, Indel or MNP)")
|
@DataPoint(description = "Number of mixed loci (loci that can't be classified as a SNP, Indel or MNP)")
|
||||||
public long nMixed = 0;
|
public long nMixed = 0;
|
||||||
|
|
||||||
|
|
@ -131,8 +134,7 @@ public class CountVariants extends VariantEvaluator implements StandardEval {
|
||||||
nMixed++;
|
nMixed++;
|
||||||
break;
|
break;
|
||||||
case SYMBOLIC:
|
case SYMBOLIC:
|
||||||
// ignore symbolic alleles, but don't fail
|
nSymbolic++;
|
||||||
// todo - consistent way of treating symbolic alleles thgoughout codebase?
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ReviewedStingException("Unexpected VariantContext type " + vc1.getType());
|
throw new ReviewedStingException("Unexpected VariantContext type " + vc1.getType());
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ public class G1KPhaseITable extends VariantEvaluator {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String update2(VariantContext eval, VariantContext comp, RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
|
public String update2(VariantContext eval, VariantContext comp, RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
|
||||||
if ( eval == null ) return null;
|
if ( eval == null || eval.isMonomorphic() ) return null;
|
||||||
|
|
||||||
switch (eval.getType()) {
|
switch (eval.getType()) {
|
||||||
// case NO_VARIATION:
|
// case NO_VARIATION:
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ public class CombineVariants extends RodWalker<Integer, Integer> {
|
||||||
private boolean sitesOnlyVCF = false;
|
private boolean sitesOnlyVCF = false;
|
||||||
|
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
Map<String, VCFHeader> vcfRods = VCFUtils.getVCFHeadersFromRods(getToolkit(), null);
|
Map<String, VCFHeader> vcfRods = VCFUtils.getVCFHeadersFromRods(getToolkit());
|
||||||
|
|
||||||
if ( PRIORITY_STRING == null ) {
|
if ( PRIORITY_STRING == null ) {
|
||||||
PRIORITY_STRING = Utils.join(",", vcfRods.keySet());
|
PRIORITY_STRING = Utils.join(",", vcfRods.keySet());
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ public class SampleUtils {
|
||||||
|
|
||||||
// iterate to get all of the sample names
|
// iterate to get all of the sample names
|
||||||
|
|
||||||
for ( Map.Entry<String, VCFHeader> pair : VCFUtils.getVCFHeadersFromRods(toolkit, null).entrySet() ) {
|
for ( Map.Entry<String, VCFHeader> pair : VCFUtils.getVCFHeadersFromRods(toolkit).entrySet() ) {
|
||||||
Set<String> vcfSamples = pair.getValue().getGenotypeSamples();
|
Set<String> vcfSamples = pair.getValue().getGenotypeSamples();
|
||||||
for ( String sample : vcfSamples )
|
for ( String sample : vcfSamples )
|
||||||
addUniqueSample(samples, sampleOverlapMap, rodNamesToSampleNames, sample, pair.getKey());
|
addUniqueSample(samples, sampleOverlapMap, rodNamesToSampleNames, sample, pair.getKey());
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,10 @@ public class VCFUtils {
|
||||||
return getVCFHeadersFromRods(toolkit, names);
|
return getVCFHeadersFromRods(toolkit, names);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Map<String, VCFHeader> getVCFHeadersFromRods(GenomeAnalysisEngine toolkit) {
|
||||||
|
return getVCFHeadersFromRods(toolkit, (Collection<String>)null);
|
||||||
|
}
|
||||||
|
|
||||||
public static Map<String, VCFHeader> getVCFHeadersFromRods(GenomeAnalysisEngine toolkit, Collection<String> rodNames) {
|
public static Map<String, VCFHeader> getVCFHeadersFromRods(GenomeAnalysisEngine toolkit, Collection<String> rodNames) {
|
||||||
Map<String, VCFHeader> data = new HashMap<String, VCFHeader>();
|
Map<String, VCFHeader> data = new HashMap<String, VCFHeader>();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue