Package org.broadinstitute.gatk.engine.contexts

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


        GenomeLoc lastLoc = range.get(range.size()-1);
        GenomeLoc bounds = genomeLocParser.createGenomeLoc(firstLoc.getContig(),firstLoc.getStart(),lastLoc.getStop());

        for( int i = bounds.getStart(); i <= bounds.getStop(); i++ ) {
            GenomeLoc site = genomeLocParser.createGenomeLoc("chr1",i);
            AlignmentContext locusContext = allLocusView.next();
            Assert.assertEquals(locusContext.getLocation(), site, "Locus context location is incorrect");
            int expectedReadsAtSite = 0;

            for( GATKSAMRecord read: reads ) {
                if(genomeLocParser.createGenomeLoc(read).containsP(locusContext.getLocation())) {
                    Assert.assertTrue(locusContext.getReads().contains(read),"Target locus context does not contain reads");
                    expectedReadsAtSite++;
                }
            }

            Assert.assertEquals(locusContext.getReads().size(), expectedReadsAtSite, "Found wrong number of reads at site");
        }

    }
View Full Code Here


        final SimpleTimer timer = new SimpleTimer().start();
        int bp = 0;
        double lastElapsed = 0;
        while ( libs.hasNext() ) {
            AlignmentContext context = libs.next();
            bp++;
            if ( timer.getElapsedTime() - lastElapsed > 10 ) {
                logger.info(bp + " iterations at " + context.getLocation());
                lastElapsed = timer.getElapsedTime();
            }
        }
        logger.info(String.format("runtime in seconds: %.2f", timer.getElapsedTime()));
View Full Code Here

    @Override
    public AlignmentContext next() {
        lazyLoadNextAlignmentContext();
        if (!hasNext())
            throw new NoSuchElementException("LocusIteratorByState: out of elements.");
        AlignmentContext currentAlignmentContext = nextAlignmentContext;
        nextAlignmentContext = null;
        return currentAlignmentContext;
    }
View Full Code Here

     *                                             for subsequent use
     * @return a AlignmentContext at position, or null if this isn't possible
     */
    public AlignmentContext advanceToLocus(final int position, final boolean stopAtFirstNonEmptySiteAfterPosition) {
        while ( hasNext() ) {
            final AlignmentContext context = next();

            if ( context == null )
                // we ran out of data
                return null;

            if ( context.getPosition() == position )
                return context;

            if ( context.getPosition() > position)
                return stopAtFirstNonEmptySiteAfterPosition ? context : null;
        }

        return null;
    }
View Full Code Here

                    fullPileup.put(sample, new ReadBackedPileupImpl(location, pile));
            }

            readStates.updateReadStates(); // critical - must be called after we get the current state offsets and location
            if (!fullPileup.isEmpty()) // if we got reads with non-D/N over the current position, we are done
                nextAlignmentContext = new AlignmentContext(location, new ReadBackedPileupImpl(location, fullPileup), false);
        }
    }
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.