Package org.broadinstitute.gatk.engine.contexts

Examples of org.broadinstitute.gatk.engine.contexts.AlignmentContext


        advance();
        if(nextLocus == null)
            throw new NoSuchElementException("No more elements remain in locus context queue.");

        // Cache the current and apply filtering.
        AlignmentContext current = nextLocus;

        // Indicate that the next operation will need to advance.
        nextLocus = null;
       
        return current;
View Full Code Here


            throw new NoSuchElementException("No next is available in the all locus view");

        // Flag to the iterator that no data is waiting in the queue to be processed.
        atNextElement = false;

        AlignmentContext currentLocus;

        // If actual data is present, return it.  Otherwise, return empty data.
        if (nextLocus != null && nextLocus.getLocation().equals(nextPosition))
            currentLocus = nextLocus;
        else
View Full Code Here

    private final static List<GATKSAMRecord> EMPTY_PILEUP_READS = Collections.emptyList();
    private final static List<Integer> EMPTY_PILEUP_OFFSETS = Collections.emptyList();
    private final static List<Boolean> EMPTY_DELETION_STATUS = Collections.emptyList();

    private AlignmentContext createEmptyLocus(GenomeLoc site) {
        return new AlignmentContext(site, new ReadBackedPileupImpl(site, EMPTY_PILEUP_READS, EMPTY_PILEUP_OFFSETS));
    }
View Full Code Here

        if ( DEBUG ) System.out.printf("rodLocusView.next() is at %s%n", site);

        // calculate the number of skipped bases, and update lastLoc so we can do that again in the next()
        long skippedBases = getSkippedBases( rodSite );
        lastLoc = site;
        return new AlignmentContext(site, new ReadBackedPileupImpl(site), skippedBases);
    }
View Full Code Here

        public AlignmentContext next() {
            if(!hasNext()) throw new NoSuchElementException("WindowMakerIterator is out of elements for this interval.");

            // Consume this alignment context.
            AlignmentContext toReturn = currentAlignmentContext;
            currentAlignmentContext = null;

            // Return the current element.
            return toReturn;
        }
View Full Code Here

        private void advance() {
            // Need to find the next element that is not past shard boundaries.  If we travel past the edge of
            // shard boundaries, stop and let the next interval pick it up.
            while(currentAlignmentContext == null && sourceIterator.hasNext()) {
                // Advance the iterator and try again.
                AlignmentContext candidateAlignmentContext = sourceIterator.peek();

                if(locus == null) {
                    // No filter present.  Return everything that LocusIteratorByState provides us.
                    currentAlignmentContext = sourceIterator.next();
                }
                else if(locus.isPast(candidateAlignmentContext.getLocation()))
                    // Found a locus before the current window; claim this alignment context and throw it away.
                    sourceIterator.next();
                else if(locus.containsP(candidateAlignmentContext.getLocation())) {
                    // Found a locus within the current window; claim this alignment context and call it the next entry.
                    currentAlignmentContext = sourceIterator.next();
                }
                else if(locus.isBefore(candidateAlignmentContext.getLocation())) {
                    // Whoops.  Skipped passed the end of the region.  Iteration for this window is complete.  Do
                    // not claim this alignment context in case it is part of the next shard.
                    break;
                }
                else
View Full Code Here

        // Can't do anything without a genotype here
        if(genotype == null)
            return null;

        int[] retVal = genotype.getAD();
        AlignmentContext context;

        if ( retVal == null && stratifiedContexts != null &&
                (context = stratifiedContexts.get(genotype.getSampleName())) != null){
            // If we get to this point, the getAD() function returned no information
            // about AlleleDepth by Sample - perhaps it wasn't annotated?
            // In that case, let's try to build it up using the algorithm that
            // was here in v 3.1-1 and earlier
            // Also, b/c of the assignment check in the if statement above,
            // we know we have a valid AlignmentContext for this sample!

            final ReadBackedPileup pileup = context.getBasePileup();
            final String bases = new String(pileup.getBases());
            List<Allele> alleles = vc.getAlleles();
            final int n_allele = alleles.size();
            retVal = new int[n_allele];
View Full Code Here

        if ( requestedGenotypeAnnotations.isEmpty() )
            return vc.getGenotypes();

        final GenotypesContext genotypes = GenotypesContext.create(vc.getNSamples());
        for ( final Genotype genotype : vc.getGenotypes() ) {
            AlignmentContext context = null;
            PerReadAlleleLikelihoodMap perReadAlleleLikelihoodMap = null;
            if (stratifiedContexts != null)
                context = stratifiedContexts.get(genotype.getSampleName());
            if (stratifiedPerReadAlleleLikelihoodMap != null)
                perReadAlleleLikelihoodMap = stratifiedPerReadAlleleLikelihoodMap.get(genotype.getSampleName());
View Full Code Here

        // create the iterator by state with the fake reads and fake records
        li = makeLTBS(reads,createTestReadProperties(DownsamplingMethod.NONE, true));

        Assert.assertTrue(li.hasNext());
        AlignmentContext context = li.next();
        ReadBackedPileup pileup = context.getBasePileup();
        Assert.assertEquals(pileup.depthOfCoverage(), 2, "Should see only 2 reads in pileup, even with unmapped and all I reads");

        final List<GATKSAMRecord> rawReads = li.transferReadsFromAllPreviousPileups();
        Assert.assertEquals(rawReads, reads, "Input and transferred read lists should be the same, and include the unmapped and all I reads");
    }
View Full Code Here

        // create the iterator by state with the fake reads and fake records
        li = makeLTBS(reads,readAttributes);

        while (li.hasNext()) {
            AlignmentContext context = li.next();
            ReadBackedPileup pileup = context.getBasePileup();
            Assert.assertEquals(pileup.depthOfCoverage(), 4);
        }
    }
View Full Code Here

TOP

Related Classes of org.broadinstitute.gatk.engine.contexts.AlignmentContext

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.