Minor bugfixes / consistency fixes to filter strings of Genotypes and AC/AF annotations

-- GenotypeBuilder now sorts the list of filter strings so that the output is in a consistent order
-- calculateChromosomeCounts removes the AC/AF fields entirely when there are no alt alleles, to be on VCF spec for A defined info field values
This commit is contained in:
Mark DePristo 2012-06-30 11:22:27 -04:00
parent 6ebefcc89f
commit 5ad9a98a15
2 changed files with 5 additions and 1 deletions

View File

@ -382,7 +382,7 @@ public final class GenotypeBuilder {
else if ( filters.size() == 1 )
return filter(filters.get(0));
else
return filter(ParsingUtils.join(";", filters));
return filter(ParsingUtils.join(";", ParsingUtils.sortList(filters)));
}
/**

View File

@ -147,6 +147,10 @@ public class VariantContextUtils {
attributes.put(VCFConstants.ALLELE_COUNT_KEY, alleleCounts.size() == 1 ? alleleCounts.get(0) : alleleCounts);
attributes.put(VCFConstants.ALLELE_FREQUENCY_KEY, alleleFreqs.size() == 1 ? alleleFreqs.get(0) : alleleFreqs);
} else {
// if there's no alt AC and AF shouldn't be present
attributes.remove(VCFConstants.ALLELE_COUNT_KEY);
attributes.remove(VCFConstants.ALLELE_FREQUENCY_KEY);
}
}