Examples of ExactACcounts


Examples of org.broadinstitute.gatk.tools.walkers.genotyper.afcalc.ExactACcounts

            // add AC=0 to the queue
            final int[] zeroCounts = new int[nAlleles];
            zeroCounts[0] = numChromosomes;

            ExactACset zeroSet =
                    new ExactACset(1, new ExactACcounts(zeroCounts));

            ACqueue.add(zeroSet);
            indexesToACset.put(zeroSet.getACcounts(), zeroSet);

            // keep processing while we have AC conformations that need to be calculated
            double maxLog10L = Double.NEGATIVE_INFINITY;
            while ( !ACqueue.isEmpty() ) {
                // compute log10Likelihoods
                final ExactACset ACset = ACqueue.remove();
                final double log10LofKs = calculateACConformationAndUpdateQueue(ACset, errorModel, alleleList, numObservations, maxLog10L, ACqueue, indexesToACset, pileup);

                // adjust max likelihood seen if needed
                maxLog10L = Math.max(maxLog10L, log10LofKs);
                // clean up memory
                indexesToACset.remove(ACset.getACcounts());
                if ( VERBOSE )
                    System.out.printf(" *** removing used set=%s%n", ACset.getACcounts());

             }


        }   else {
            int plIdx = 0;
            SumIterator iterator = new SumIterator(nAlleles, numChromosomes);
            while (iterator.hasNext()) {
                ExactACset ACset =
                       new ExactACset(1, new ExactACcounts(iterator.getCurrentVector()));
                // for observed base X, add Q(jX,k) to likelihood vector for all k in error model
                //likelihood(jA,jC,jG,jT) = logsum(logPr (errorModel[k],nA*Q(jA,k) +  nC*Q(jC,k) + nG*Q(jG,k) + nT*Q(jT,k))
                getLikelihoodOfConformation(ACset, errorModel, alleleList, numObservations, pileup);

                setLogPLs(plIdx++, ACset.getLog10Likelihoods()[0]);
View Full Code Here

Examples of org.broadinstitute.gatk.tools.walkers.genotyper.afcalc.ExactACcounts

    // Static methods
    public static void updateACset(final int[] newSetCounts,
                                    final LinkedList<ExactACset> ACqueue,
                                    final HashMap<ExactACcounts, ExactACset> indexesToACset) {

        final ExactACcounts index = new ExactACcounts(newSetCounts);
        if ( !indexesToACset.containsKey(index) ) {
            ExactACset newSet = new ExactACset(1, index);
            indexesToACset.put(index, newSet);
            ACqueue.add(newSet);    
            if (VERBOSE)
                System.out.println(" *** Adding set to queue:" + index.toString());
        }

    }
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.