Bug fix in ValidationSiteSelector: when input vcf had genotypes and was multiallelic, the parsing of the AF/AC fields was wrong. Better logic to unify parsing of field

This commit is contained in:
Guillermo del Angel 2012-02-06 10:33:12 -05:00
parent 30b937d2af
commit 090d87b48b
1 changed files with 14 additions and 15 deletions

View File

@ -71,8 +71,8 @@ public class KeepAFSpectrumFrequencySelector extends FrequencyModeSelector {
// recompute AF,AC,AN based on genotypes: // recompute AF,AC,AN based on genotypes:
// todo - - maybe too inefficient?? // todo - - maybe too inefficient??
VariantContextUtils.calculateChromosomeCounts(vc, attributes, false); VariantContextUtils.calculateChromosomeCounts(vc, attributes, false);
afArray = new double[] {Double.valueOf((String)attributes.get(VCFConstants.ALLELE_FREQUENCY_KEY))}; }
} else {
// sites-only vc or we explicitly tell to ignore genotypes; we trust the AF field if present // sites-only vc or we explicitly tell to ignore genotypes; we trust the AF field if present
if ( vc.hasAttribute(VCFConstants.ALLELE_FREQUENCY_KEY) ) { if ( vc.hasAttribute(VCFConstants.ALLELE_FREQUENCY_KEY) ) {
String afo = vc.getAttributeAsString(VCFConstants.ALLELE_FREQUENCY_KEY, null); String afo = vc.getAttributeAsString(VCFConstants.ALLELE_FREQUENCY_KEY, null);
@ -90,7 +90,6 @@ public class KeepAFSpectrumFrequencySelector extends FrequencyModeSelector {
else else
afArray = new double[] {Double.valueOf(afo)}; afArray = new double[] {Double.valueOf(afo)};
} }
}
if (afArray == null ) if (afArray == null )