Examples of GenotypeLikelihoods


Examples of htsjdk.variant.variantcontext.GenotypeLikelihoods

        model.close();
    }

    @Test
    public void testWorstGL() {
        final GenotypeLikelihoods gq10 = GenotypeLikelihoods.fromPLField("0,10,100");
        final GenotypeLikelihoods gq20 = GenotypeLikelihoods.fromPLField("0,20,200");
        final GenotypeLikelihoods gq0 = GenotypeLikelihoods.fromPLField("20,0,200");

        Assert.assertSame(model.getGLwithWorstGQ(gq10, gq20), gq10);
        Assert.assertSame(model.getGLwithWorstGQ(gq20, gq10), gq10);
        Assert.assertSame(model.getGLwithWorstGQ(gq10, gq0), gq0);
        Assert.assertSame(model.getGLwithWorstGQ(gq0, gq10), gq0);
View Full Code Here

Examples of htsjdk.variant.variantcontext.GenotypeLikelihoods

        Assert.assertSame(model.getGLwithWorstGQ(gq0, gq10), gq0);
    }

    @Test
    public void testIndelLikelihoods() {
        GenotypeLikelihoods prev = model.getIndelPLs(HomoSapiensConstants.DEFAULT_PLOIDY,0);
        Assert.assertEquals(prev.getAsPLs(), new int[]{0, 0, 0});
        Assert.assertEquals(-10 * prev.getLog10GQ(GenotypeType.HOM_REF), 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 * prev.getLog10GQ(GenotypeType.HOM_REF);
            final double currGQ = -10 * current.getLog10GQ(GenotypeType.HOM_REF);
            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;
        }
    }
View Full Code Here

Examples of htsjdk.variant.variantcontext.GenotypeLikelihoods

        final int genotypeCount = calculator.genotypeCount();
        final int testGenotypeCount = Math.min(30000,genotypeCount);
        final int sampleCount = readCount.length;
        for (int s = 0; s < sampleCount ; s++) {
            final ReadLikelihoods.Matrix<Allele> sampleLikelihoods = readLikelihoods.sampleMatrix(s);
            final GenotypeLikelihoods genotypeLikelihoods = calculator.genotypeLikelihoods(sampleLikelihoods);
            final double[] genotypeLikelihoodsDoubles = genotypeLikelihoods.getAsVector();
            Assert.assertEquals(genotypeLikelihoodsDoubles.length,genotypeCount);
            for (int i = 0; i < testGenotypeCount; i++) {
                final GenotypeAlleleCounts genotypeAlleleCounts = calculator.genotypeAlleleCountsAt(i);
                Assert.assertNotNull(genotypeLikelihoods);
                final double[] readGenotypeLikelihoods = new double[sampleLikelihoods.readCount()];
View Full Code Here

Examples of htsjdk.variant.variantcontext.GenotypeLikelihoods

        Assert.assertNotNull(gLikelihoods);
        AlleleListUnitTester.assertAlleleList(gLikelihoods, AlleleListUtils.asList(genotypingAlleleList));
        SampleListUnitTester.assertSampleList(gLikelihoods,SampleListUtils.asList(sampleList));
        final int sampleCount = gLikelihoods.sampleCount();
        for (int i = 0; i < sampleCount; i++) {
            final GenotypeLikelihoods sampleLikelihoods = gLikelihoods.sampleLikelihoods(i);
            Assert.assertNotNull(sampleLikelihoods);
            final double[] values = sampleLikelihoods.getAsVector();
            Assert.assertNotNull(values);
            Assert.assertEquals(values.length, GenotypeLikelihoodCalculators.getInstance(ploidies[i], genotypingAlleleList.alleleCount()).genotypeCount());
            for (int j = 0; j < values.length; j++)
                Assert.assertTrue(values[j] <= 0);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.