Package org.broadinstitute.gatk.utils.exceptions

Examples of org.broadinstitute.gatk.utils.exceptions.ReviewedGATKException


                        if (phasedCurGenotypeRelativeToPrevious) {
                            Genotype prevHetGenotype = phaseWindow.phaseRelativeToGenotype();
                            SNPallelePair prevAllelePair = new SNPallelePair(prevHetGenotype);
                            if (!prevHetGenotype.hasAnyAttribute(HP_KEY))
                                throw new ReviewedGATKException("Internal error: missing haplotype markings for previous genotype, even though we put it there...");
                            String[] prevPairNames = (String[]) prevHetGenotype.getAnyAttribute(HP_KEY);

                            String[] curPairNames = ensurePhasing(allelePair, prevAllelePair, prevPairNames, pr.haplotype);
                            Genotype phasedGt = new GenotypeBuilder(gt)
                                    .alleles(allelePair.getAllelesAsList())
View Full Code Here


        Ensure that curAllelePair is phased relative to prevAllelePair as specified by hap.
     */

    public static String[] ensurePhasing(SNPallelePair curAllelePair, SNPallelePair prevAllelePair, String[] prevPairNames, Haplotype hap) {
        if (hap.size() < 2)
            throw new ReviewedGATKException("LOGICAL ERROR: Only considering haplotypes of length > 2!");

        String[] curPairNames = prevPairNames;

        byte prevBase = hap.getBase(0); // The 1st base in the haplotype
        byte curBase = hap.getBase(1)// The 2nd base in the haplotype
View Full Code Here

        // ASSUMES that: isUnfilteredCalledDiploidGenotype(vrGt) && vrGt.isHet() [vrGt = vr.variant.getGenotype(sample)]

        public PhasingWindow(VariantAndReads vr, String sample, List<GenotypeAndReadBases> prevHetGenotypes, int goBackFromEndOfPrevHets) {
            if (prevHetGenotypes.isEmpty() || goBackFromEndOfPrevHets >= prevHetGenotypes.size()) // no previous sites against which to phase
                throw new ReviewedGATKException("Should never get empty set of previous sites to phase against");

            // Include these previously phased sites in the phasing computation:
            List<GenotypeAndReadBases> listHetGenotypes = new LinkedList<GenotypeAndReadBases>(prevHetGenotypes);

            phaseRelativeToIndex = listHetGenotypes.size() - 1 - goBackFromEndOfPrevHets;
View Full Code Here

            case INDEL:
                return evalVC.isStructuralIndel() || evalVC.isIndel() || evalVC.isMixed() || evalVC.isSymbolic();
            case BOTH:
                return true;
            default:
                throw new ReviewedGATKException( "Encountered unknown recal mode: " + mode );
        }
    }
View Full Code Here

           where the other allele is chosen at each site
         */
        private Haplotype complement(Haplotype hap) {
            int numSites = SNPallelePairs.length;
            if (hap.size() != numSites)
                throw new ReviewedGATKException("INTERNAL ERROR: hap.size() != numSites");

            // Take the other base at EACH position of the Haplotype:
            byte[] complementBases = new byte[numSites];
            for (int i = 0; i < numSites; i++)
                complementBases[i] = SNPallelePairs[i].getOtherBase(hap.getBase(i));
View Full Code Here

    private Allele top;
    private Allele bottom;

    public AllelePair(Genotype gt) {
        if (gt.getPloidy() != 2)
            throw new ReviewedGATKException("AllelePair must have ploidy of 2! incoming gt was"+gt.toBriefString());

        this.top = gt.getAllele(0);
        this.bottom = gt.getAllele(1);
    }
View Full Code Here

        if (logLikelihoods == null){
            log10Likelihoods = new double[likelihoodDim];
            Arrays.fill(log10Likelihoods, MIN_LIKELIHOOD);
        } else {
            if (logLikelihoods.length != likelihoodDim)
                throw new ReviewedGATKException("BUG: inconsistent parameters when creating GeneralPloidyGenotypeLikelihoods object");

            log10Likelihoods = logLikelihoods; //.clone(); // is clone needed?
        }
        fillCache();
        LOG10_PLOIDY = Math.log10((double)numChromosomes);
View Full Code Here

       
        public void setInitialStateVector(final int[] stateVector) {
            if (restrictSumTo > 0) {
                // check that desired vector is valid
                if (MathUtils.sum(stateVector) != restrictSumTo)
                    throw new ReviewedGATKException("BUG: initial state vector nor compatible with sum iterator");

                final int numAlleles = currentState.length;
                final int ploidy = restrictSumTo;

                linearIndex = GeneralPloidyGenotypeLikelihoods.getLinearIndex(stateVector, numAlleles, ploidy);
            }
            else
                throw new ReviewedGATKException("BUG: Not supported");

        }
View Full Code Here

                if (a.isReference())
                    refAllele = a;
            }

            if (refAllele == null)
                throw new ReviewedGATKException("BUG: no ref alleles in passed in allele list!");

            // count number of elements in pileup
            for (PileupElement elt : pileup) {
                if (VERBOSE)
                    System.out.format("base:%s isNextToDel:%b isNextToIns:%b eventBases:%s eventLength:%d\n",elt.getBase(), elt.isBeforeDeletionStart(),elt.isBeforeInsertion(),elt.getBasesOfImmediatelyFollowingInsertion(),elt.getLengthOfImmediatelyFollowingIndel());
View Full Code Here

     * @param locus      The locus given as a GenomeLoc
     * @param pileup     The pileup of that locus, this exclusively contains the sample
     */
    public void addLocus(GenomeLoc locus, ReadBackedPileup pileup) {
        if (!interval.containsP(locus))
            throw new ReviewedGATKException(String.format("Locus %s is not part of the Interval %s", locus, interval));

        // a null pileup means there nothing to add
        if (pileup != null) {
            final int locusIndex = locus.getStart() - interval.getStart();
            final int rawCoverage = pileup.depthOfCoverage();
View Full Code Here

TOP

Related Classes of org.broadinstitute.gatk.utils.exceptions.ReviewedGATKException

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.