Avoid NaNs in the final output.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3973 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kiran 2010-08-08 05:16:52 +00:00
parent 3f6e44dc71
commit 64446f0ddf
1 changed files with 5 additions and 1 deletions

View File

@ -212,7 +212,11 @@ public class SelectVariants extends RodWalker<Integer, Integer> {
attributes.put("AC", alleleCount);
attributes.put("AN", numberOfAlleles);
attributes.put("AF", ((double) alleleCount) / ((double) numberOfAlleles));
if (numberOfAlleles == 0) {
attributes.put("AF", 0.0);
} else {
attributes.put("AF", ((double) alleleCount) / ((double) numberOfAlleles));
}
attributes.put("DP", depth);
sub = VariantContextUtils.modifyAttributes(sub, attributes);