Examples of AlignmentContext


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

            Set<List<GATKSAMRecord>> readSets = uniqueReadSets(readsAtLoc((GATKSAMRecord) read, iter));
            if ( DEBUG ) logger.debug(String.format("*** TraverseDuplicates.traverse at %s with %d read sets", site, readSets.size()));

            // Jump forward in the reference to this locus location
            AlignmentContext locus = new AlignmentContext(site, new ReadBackedPileupImpl(site));

            // update the number of duplicate sets we've seen
            dataProvider.getShard().getReadMetrics().incrementNumIterations();

            // actually call filter and map, accumulating sum
View Full Code Here

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

            if ( done )
                return false;
            else {

                while( locusView.hasNext() ) {
                    final AlignmentContext locus = locusView.next();
                    final GenomeLoc location = locus.getLocation();

                    rememberLastLocusLocation(location);

                    // get all of the new reads that appear in the current pileup, and them to our list of reads
                    // provided we haven't seen them before
                    final Collection<GATKSAMRecord> reads = locusView.getLIBS().transferReadsFromAllPreviousPileups();
                    for( final GATKSAMRecord read : reads ) {
                        // note that ActiveRegionShards span entire contigs, so this check is in some
                        // sense no longer necessary, as any read that appeared in the last shard would now
                        // by definition be on a different contig.  However, the logic here doesn't hurt anything
                        // and makes us robust should we decided to provide shards that don't fully span
                        // contigs at some point in the future
                        if ( ! appearedInLastShard(locOfLastReadAtTraversalStart, read) ) {
                            rememberLastReadLocation(read);
                            myReads.add(read);
                        }
                    }

                    // skip this location -- it's not part of our engine intervals
                    if ( outsideEngineIntervals(location) )
                        continue;

                    // we've move across some interval boundary, restart profile
                    final boolean flushProfile = ! activityProfile.isEmpty()
                            && ( activityProfile.getContigIndex() != location.getContigIndex()
                            || location.getStart() != activityProfile.getStop() + 1);
                    final List<MapData> newActiveRegions = prepActiveRegionsForProcessing(walker, flushProfile, false, referenceOrderedDataView);

                    dataProvider.getShard().getReadMetrics().incrementNumIterations();

                    // create reference context. Note that if we have a pileup of "extended events", the context will
                    // hold the (longest) stretch of deleted reference bases (if deletions are present in the pileup).
                    final ReferenceContext refContext = referenceView.getReferenceContext(location);

                    // Iterate forward to get all reference ordered data covering this location
                    final RefMetaDataTracker tracker = referenceOrderedDataView.getReferenceOrderedDataAtLocus(locus.getLocation());

                    // Call the walkers isActive function for this locus and add them to the list to be integrated later
                    addIsActiveResult(walker, tracker, refContext, locus);

                    maxReadsInMemory = Math.max(myReads.size(), maxReadsInMemory);
View Full Code Here

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

            // only do this if the walker isn't done!
            final RodLocusView rodLocusView = (RodLocusView)locusView;
            final long nSkipped = rodLocusView.getLastSkippedBases();
            if ( nSkipped > 0 ) {
                final GenomeLoc site = rodLocusView.getLocOneBeyondShard();
                final AlignmentContext ac = new AlignmentContext(site, new ReadBackedPileupImpl(site), nSkipped);
                final M x = walker.map(null, null, ac);
                sum = walker.reduce(x, sum);
            }
        }
View Full Code Here

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

            return locusView.hasNext() && ! engine.exceedsRuntimeLimit();
        }

        @Override
        public MapData next() {
            final AlignmentContext locus = locusView.next();
            final GenomeLoc location = locus.getLocation();

            //logger.info("Pulling data from MapDataIterator at " + location);

            // create reference context. Note that if we have a pileup of "extended events", the context will
            // hold the (longest) stretch of deleted reference bases (if deletions are present in the pileup).
View Full Code Here

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

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

            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

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

    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

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

        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

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

        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

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

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