Better interface to Genotypelikelihoods class. Now you need to specify the format (GL vs PL) of the output string when calling getAsString(). All likelihoods are represented as GLs internally. QualByDepth no longer does its own conversion.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4933 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2011-01-04 21:48:14 +00:00
parent d9270b2363
commit 85714621be
2 changed files with 3 additions and 9 deletions

View File

@ -47,13 +47,7 @@ public class QualByDepth implements InfoFieldAnnotation, StandardAnnotation {
if ( genotype.getValue().hasLikelihoods() ) {
GenotypeLikelihoods GLs = genotype.getValue().getLikelihoods();
double[] likelihoods = GLs.getAsVector();
if ( GLs.getKey() == VCFConstants.PHRED_GENOTYPE_LIKELIHOODS_KEY ) {
for (int i = 0; i < likelihoods.length; i++)
likelihoods[i] /= -10.0;
}
qual += 10.0 * getQual(likelihoods);
qual += 10.0 * getQual(GLs.getAsVector());
}
}

View File

@ -213,9 +213,9 @@ public class UnifiedGenotyperEngine {
}
HashMap<String, Object> attributes = new HashMap<String, Object>();
GenotypeLikelihoods likelihoods = new GenotypeLikelihoods(GL.getLikelihoods(), VCFConstants.GENOTYPE_LIKELIHOODS_KEY);
GenotypeLikelihoods likelihoods = new GenotypeLikelihoods(GL.getLikelihoods());
attributes.put(VCFConstants.DEPTH_KEY, GL.getDepth());
attributes.put(likelihoods.getKey(), likelihoods);
attributes.put(VCFConstants.GENOTYPE_LIKELIHOODS_KEY, likelihoods);
genotypes.put(GL.getSample(), new Genotype(GL.getSample(), noCall, Genotype.NO_NEG_LOG_10PERROR, null, attributes, false));
}