Bug fix for validation site selector: records with AC=0 in them were always being thrown out if input vcf was sites-only, even when -ignorePolymorphicStatus flag was set

This commit is contained in:
Guillermo del Angel 2012-02-14 21:11:24 -05:00
parent d5fce22d78
commit 7dc6f73399
1 changed files with 9 additions and 6 deletions

View File

@ -52,13 +52,16 @@ public class UniformSamplingFrequencySelector extends FrequencyModeSelector {
if (! selectedInTargetSamples && !IGNORE_POLYMORPHIC) if (! selectedInTargetSamples && !IGNORE_POLYMORPHIC)
return; return;
} else { } else {
if ( attributes.containsKey(VCFConstants.ALLELE_COUNT_KEY) ) { if (!IGNORE_POLYMORPHIC) {
int ac = vc.getAttributeAsInt(VCFConstants.ALLELE_COUNT_KEY, 0); if (vc.getAttributes().containsKey(VCFConstants.ALLELE_COUNT_KEY))
if (ac == 0) return; // site not polymorphic {
int ac = vc.getAttributeAsInt(VCFConstants.ALLELE_COUNT_KEY, 0);
if (ac == 0) return; // site not polymorphic
}
else
// no allele count field in VC
return;
} }
else
return;
} }
// create bare-bones event and log in corresponding bin // create bare-bones event and log in corresponding bin
// attributes contains AC,AF,AN pulled from original vc, and we keep them here and log in output file for bookkeeping purposes // attributes contains AC,AF,AN pulled from original vc, and we keep them here and log in output file for bookkeeping purposes