Add GQ to list of genotype attributes for reg exp

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3791 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2010-07-14 19:01:11 +00:00
parent 78a4d8ec3d
commit 0226412b11
1 changed files with 4 additions and 2 deletions

View File

@ -28,6 +28,7 @@ import org.apache.commons.jexl2.MapContext;
//import org.apache.commons.jexl2.JexlHelper;
import org.broadinstitute.sting.utils.StingException;
import org.broadinstitute.sting.utils.Utils;
import org.broad.tribble.vcf.VCFConstants;
import java.util.*;
@ -167,7 +168,7 @@ class JEXLMap implements Map<VariantContextUtils.JexlVCMatchExp, Boolean> {
infoMap.put("CHROM", vc.getLocation().getContig());
infoMap.put("POS", String.valueOf(vc.getLocation().getStart()));
infoMap.put("TYPE", vc.getType().toString());
infoMap.put("QUAL", String.valueOf(10 * vc.getNegLog10PError()));
infoMap.put("QUAL", String.valueOf(vc.getPhredScaledQual()));
// add alleles
infoMap.put("ALLELES", Utils.join(";", vc.getAlleles()));
@ -193,10 +194,11 @@ class JEXLMap implements Map<VariantContextUtils.JexlVCMatchExp, Boolean> {
// add specific genotype if one is provided
if ( g != null ) {
infoMap.put("GT", g.getGenotypeString());
infoMap.put(VCFConstants.GENOTYPE_KEY, g.getGenotypeString());
infoMap.put("isHomRef", g.isHomRef() ? "1" : "0");
infoMap.put("isHet", g.isHet() ? "1" : "0");
infoMap.put("isHomVar", g.isHomVar() ? "1" : "0");
infoMap.put(VCFConstants.GENOTYPE_QUALITY_KEY, String.valueOf(g.getPhredScaledQual()));
for ( Map.Entry<String, Object> e : g.getAttributes().entrySet() )
infoMap.put(e.getKey(), String.valueOf(e.getValue()));
}