Examples of AlignmentContext


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

                createTestReadProperties(downsampler, false),
                genomeLocParser,
                samples);

        while ( li.hasNext() ) {
            final AlignmentContext next = li.next();
            Assert.assertTrue(next.getBasePileup().getNumberOfElements() <= downsampleTo, "Too many elements in pileup " + next);
            // TODO -- assert that there are <= X reads in memory after GC for some X
        }
    }
View Full Code Here

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

                LocusIteratorByState.sampleListForSAMWithoutReadGroups());

        int expectedPos = read.getAlignmentStart() + nClipsOnLeft;
        int nPileups = 0;
        while ( li.hasNext() ) {
            final AlignmentContext next = li.next();
            Assert.assertEquals(next.getLocation().getStart(), expectedPos);
            nPileups++;
            expectedPos++;
        }

        final int nExpectedPileups = nReadContainingPileups;
View Full Code Here

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

                            LocusIteratorByStateBaseTest.createTestReadProperties(),
                            genomeLocParser,
                            LocusIteratorByState.sampleListForSAMWithoutReadGroups());

            while ( libs.hasNext() ) {
                AlignmentContext context = libs.next();
            }
        }
    }
View Full Code Here

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

            if( expectedReadsAtSite < 1 )
                continue;

            Assert.assertTrue(coveredLocusView.hasNext(),"Incorrect number of loci in view");

            AlignmentContext locusContext = coveredLocusView.next();
            Assert.assertEquals(locusContext.getLocation(), site, "Target locus context location is incorrect");
            Assert.assertEquals(locusContext.getReads().size(), expectedReadsAtSite, "Found wrong number of reads at site");

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

        Assert.assertFalse(coveredLocusView.hasNext(),"Iterator is not bounded at boundaries of shard");
    }       
View Full Code Here

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

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

        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

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

    @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

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

     *                                             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

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

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