Package org.broadinstitute.gatk.engine.datasources.reads

Examples of org.broadinstitute.gatk.engine.datasources.reads.Shard


//        view.getReferenceContext(shard.getGenomeLoc()).getBase();
//    }

    @Test
    public void testOverlappingReferenceBases() {
        Shard shard = new MockLocusShard(genomeLocParser,Collections.singletonList(genomeLocParser.createGenomeLoc(sequenceFile.getSequenceDictionary().getSequence(0).getSequenceName(),
                                                                                                                   sequenceFile.getSequence("chrM").length() - 10,
                                                                                                                   sequenceFile.getSequence("chrM").length())));
        LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, null, genomeLocParser, shard.getGenomeLocs().get(0), null, sequenceFile, null);
        LocusReferenceView view = new LocusReferenceView(dataProvider);

        byte[] results = view.getReferenceBases(genomeLocParser.createGenomeLoc(sequenceFile.getSequenceDictionary().getSequence(0).getSequenceName(),
                                                                                sequenceFile.getSequence("chrM").length() - 10,
                                                                                sequenceFile.getSequence("chrM").length() + 9));
View Full Code Here



    /** Queries outside the bounds of the shard should result in reference context window trimmed at the shard boundary. */
    @Test
    public void testBoundsFailure() {
        Shard shard = new MockLocusShard(genomeLocParser,Collections.singletonList(genomeLocParser.createGenomeLoc(sequenceFile.getSequenceDictionary().getSequence(0).getSequenceName(), 1, 50)));

        LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, null, genomeLocParser, shard.getGenomeLocs().get(0), null, sequenceFile, null);
        LocusReferenceView view = new LocusReferenceView(dataProvider);

        GenomeLoc locus = genomeLocParser.createGenomeLoc(sequenceFile.getSequenceDictionary().getSequence(0).getSequenceName(), 50, 51);

        ReferenceContext rc = view.getReferenceContext(locus);
View Full Code Here

     * Compares the contents of the fasta and view at a specified location.
     *
     * @param loc
     */
    protected void validateLocation( GenomeLoc loc ) {
        Shard shard = new MockLocusShard(genomeLocParser,Collections.singletonList(loc));
        GenomeLocusIterator shardIterator = new GenomeLocusIterator(genomeLocParser,loc);

        LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, null, genomeLocParser, loc, null, sequenceFile, null);
        LocusReferenceView view = new LocusReferenceView(dataProvider);

        while (shardIterator.hasNext()) {
            GenomeLoc locus = shardIterator.next();

            ReferenceSequence expectedAsSeq = sequenceFile.getSubsequenceAt(locus.getContig(), locus.getStart(), locus.getStop());
            char expected = Character.toUpperCase(StringUtil.bytesToString(expectedAsSeq.getBases()).charAt(0));
            char actual = view.getReferenceContext(locus).getBaseAsChar();

            Assert.assertEquals(actual, expected, String.format("Value of base at position %s in shard %s does not match expected", locus.toString(), shard.getGenomeLocs())
            );
        }
    }
View Full Code Here

     */
    protected void queueNextShardTraverse( Walker walker, ReduceTree reduceTree ) {
        if (!traversalTasks.hasNext())
            throw new IllegalStateException("Cannot traverse; no pending traversals exist.");

        final Shard shard = traversalTasks.next();

        // todo -- add ownership claim here

        final ShardTraverser traverser = new ShardTraverser(this, walker, shard, outputTracker);

View Full Code Here

    @Test
    public void emptyAlignmentContextTest() {
        SAMRecordIterator iterator = new SAMRecordIterator();

        GenomeLoc shardBounds = genomeLocParser.createGenomeLoc("chr1", 1, 5);
        Shard shard = new LocusShard(genomeLocParser, new SAMDataSource(Collections.<SAMReaderID>emptyList(),new ThreadAllocation(),null,genomeLocParser),Collections.singletonList(shardBounds),Collections.<SAMReaderID,SAMFileSpan>emptyMap());
        WindowMaker windowMaker = new WindowMaker(shard,genomeLocParser,iterator,shard.getGenomeLocs());
        WindowMaker.WindowMakerIterator window = windowMaker.next();
        LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, null, genomeLocParser, window.getLocus(), window, null, null);

        LocusView view = createView(dataProvider);

        testReadsInContext(view, shard.getGenomeLocs(), Collections.<GATKSAMRecord>emptyList());
    }
View Full Code Here

    public void singleReadTest() {
        GATKSAMRecord read = buildSAMRecord("read1","chr1", 1, 5);
        SAMRecordIterator iterator = new SAMRecordIterator(read);

        GenomeLoc shardBounds = genomeLocParser.createGenomeLoc("chr1", 1, 5);
        Shard shard = new MockLocusShard(genomeLocParser,Collections.singletonList(shardBounds));
        WindowMaker windowMaker = new WindowMaker(shard,genomeLocParser,iterator,shard.getGenomeLocs());
        WindowMaker.WindowMakerIterator window = windowMaker.next();
        LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), genomeLocParser, window.getLocus(), window, null, null);

        LocusView view = createView(dataProvider);

        testReadsInContext(view, shard.getGenomeLocs(), Collections.singletonList(read));
    }
View Full Code Here

    @Test
    public void readCoveringFirstPartTest() {
        GATKSAMRecord read = buildSAMRecord("read1","chr1", 1, 5);
        SAMRecordIterator iterator = new SAMRecordIterator(read);

        Shard shard = new MockLocusShard(genomeLocParser,Collections.singletonList(genomeLocParser.createGenomeLoc("chr1", 1, 10)));
        WindowMaker windowMaker = new WindowMaker(shard,genomeLocParser,iterator,shard.getGenomeLocs());
        WindowMaker.WindowMakerIterator window = windowMaker.next();
        LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), genomeLocParser, window.getLocus(), window, null, null);
        LocusView view = createView(dataProvider);

        testReadsInContext(view, shard.getGenomeLocs(), Collections.singletonList(read));
    }
View Full Code Here

    @Test
    public void readCoveringLastPartTest() {
        GATKSAMRecord read = buildSAMRecord("read1","chr1", 6, 10);
        SAMRecordIterator iterator = new SAMRecordIterator(read);

        Shard shard = new MockLocusShard(genomeLocParser,Collections.singletonList(genomeLocParser.createGenomeLoc("chr1", 1, 10)));
        WindowMaker windowMaker = new WindowMaker(shard,genomeLocParser,iterator,shard.getGenomeLocs());
        WindowMaker.WindowMakerIterator window = windowMaker.next();
        LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), genomeLocParser, window.getLocus(), window, null, null);
        LocusView view = createView(dataProvider);

        testReadsInContext(view, shard.getGenomeLocs(), Collections.singletonList(read));
    }
View Full Code Here

    @Test
    public void readCoveringMiddleTest() {
        GATKSAMRecord read = buildSAMRecord("read1","chr1", 3, 7);
        SAMRecordIterator iterator = new SAMRecordIterator(read);

        Shard shard = new MockLocusShard(genomeLocParser,Collections.singletonList(genomeLocParser.createGenomeLoc("chr1", 1, 10)));
        WindowMaker windowMaker = new WindowMaker(shard,genomeLocParser,iterator,shard.getGenomeLocs());
        WindowMaker.WindowMakerIterator window = windowMaker.next();
        LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), genomeLocParser, window.getLocus(), window, null, null);
        LocusView view = createView(dataProvider);

        testReadsInContext(view, shard.getGenomeLocs(), Collections.singletonList(read));
    }
View Full Code Here

    @Test
    public void readAndLocusOverlapAtLastBase() {
        GATKSAMRecord read = buildSAMRecord("read1","chr1", 1, 5);
        SAMRecordIterator iterator = new SAMRecordIterator(read);

        Shard shard = new MockLocusShard(genomeLocParser,Collections.singletonList(genomeLocParser.createGenomeLoc("chr1", 5, 5)));
        WindowMaker windowMaker = new WindowMaker(shard,genomeLocParser,iterator,shard.getGenomeLocs());
        WindowMaker.WindowMakerIterator window = windowMaker.next();
        LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), genomeLocParser, window.getLocus(), window, null, null);
        LocusView view = createView(dataProvider);

        testReadsInContext(view, shard.getGenomeLocs(), Collections.singletonList(read));
    }
View Full Code Here

TOP

Related Classes of org.broadinstitute.gatk.engine.datasources.reads.Shard

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.