use of htsjdk.variant.variantcontext.GenotypeLikelihoods in project gatk by broadinstitute.
the class ReferenceConfidenceModelUnitTest method testIndelLikelihoods.
@Test
public void testIndelLikelihoods() {
GenotypeLikelihoods prev = model.getIndelPLs(HomoSapiensConstants.DEFAULT_PLOIDY, 0);
Assert.assertEquals(prev.getAsPLs(), new int[] { 0, 0, 0 });
Assert.assertEquals(-10 * GenotypeLikelihoods.getGQLog10FromLikelihoods(GenotypeType.HOM_REF.ordinal() - 1, prev.getAsVector()), 0.0);
for (int i = 1; i <= ReferenceConfidenceModel.MAX_N_INDEL_INFORMATIVE_READS; i++) {
final GenotypeLikelihoods current = model.getIndelPLs(HomoSapiensConstants.DEFAULT_PLOIDY, i);
final double prevGQ = -10 * GenotypeLikelihoods.getGQLog10FromLikelihoods(GenotypeType.HOM_REF.ordinal() - 1, prev.getAsVector());
final double currGQ = -10 * GenotypeLikelihoods.getGQLog10FromLikelihoods(GenotypeType.HOM_REF.ordinal() - 1, current.getAsVector());
Assert.assertTrue(prevGQ < currGQ, "GQ Failed with prev " + prev + " curr " + current + " at " + i);
Assert.assertTrue(prev.getAsPLs()[1] < current.getAsPLs()[1], "het PL failed with prev " + prev + " curr " + current + " at " + i);
Assert.assertTrue(prev.getAsPLs()[2] < current.getAsPLs()[2], "hom-var PL Failed with prev " + prev + " curr " + current + " at " + i);
// logger.warn("result at " + i + " is " + current);
prev = current;
}
}
Aggregations