Package org.broadinstitute.gatk.tools.walkers.genotyper

Examples of org.broadinstitute.gatk.tools.walkers.genotyper.GenotypeAlleleCounts


        final int bestLikelihoodIndex = MathUtils.minElementIndex(PL);
        final int numberOfAlleles = vc.getNAlleles();
        final int ploidy = g.getPloidy();
        final GenotypeLikelihoodCalculator calculator = GenotypeLikelihoodCalculators.getInstance(ploidy, numberOfAlleles);
        final GenotypeAlleleCounts genotypeAlleleCounts = calculator.genotypeAlleleCountsAt(bestLikelihoodIndex);
        final int[] AC = new int[numberOfAlleles - 1];
        final double[] AF = new double[numberOfAlleles - 1];
        final int allelesPresentCount = genotypeAlleleCounts.distinctAlleleCount();
        for (int i = 0; i < allelesPresentCount; i++) {
            final int alleleIndex = genotypeAlleleCounts.alleleIndexAt(i);
            if (alleleIndex == 0) continue; // skip the reference allele.
            final int alleleCount = genotypeAlleleCounts.alleleCountAt(i);
            AC[alleleIndex - 1] = alleleCount;
            AF[alleleIndex - 1] = ((double) alleleCount) / (double) ploidy;
        }
        gb.attribute(VCFConstants.MLE_PER_SAMPLE_ALLELE_COUNT_KEY, Utils.asList(AC));
        gb.attribute(VCFConstants.MLE_PER_SAMPLE_ALLELE_FRACTION_KEY, Utils.asList(AF));
View Full Code Here


        final int numNewAltAlleles = allelesToUse.size() - 1;

        // find the genotype with maximum likelihoods
        final int PLindex = numNewAltAlleles == 0 ? 0 : MathUtils.maxElementIndex(newLikelihoods);
        final GenotypeLikelihoodCalculator calculator = GenotypeLikelihoodCalculators.getInstance(numChromosomes,allelesToUse.size());
        final GenotypeAlleleCounts alleleCounts = calculator.genotypeAlleleCountsAt(PLindex);

        gb.alleles(alleleCounts.asAlleleList(allelesToUse));

        // remove PLs if necessary
        if (newLikelihoods.length > MAX_LENGTH_FOR_POOL_PL_LOGGING)
            gb.noPL();
View Full Code Here

TOP

Related Classes of org.broadinstitute.gatk.tools.walkers.genotyper.GenotypeAlleleCounts

Copyright © 2018 www.massapicom. 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.