Package org.broadinstitute.gatk.utils.sam

Examples of org.broadinstitute.gatk.utils.sam.ArtificialBAMBuilder


     * A unit test that creates an artificial read for testing some code that uses reads
     */
    @Test()
    public void testWithBAMFile() {
        // create a fake BAM file, and iterate through it
        final ArtificialBAMBuilder bamBuilder = new ArtificialBAMBuilder(seq, 20, 10);
        final File bam = bamBuilder.makeTemporarilyBAMFile();
        final SAMFileReader reader = new SAMFileReader(bam);
        reader.setSAMRecordFactory(new GATKSamRecordFactory());

        final Iterator<SAMRecord> bamIt = reader.iterator();
        while ( bamIt.hasNext() ) {
View Full Code Here


        Assert.assertEquals(cache.getMaxCapacity(), max);
        Assert.assertEquals(cache.getNumDiscarded(), 0);
        Assert.assertEquals(cache.size(), 0);

        final ArtificialBAMBuilder bamBuilder = new ArtificialBAMBuilder(seq, nReadsPerLocus, nLoci);
        final List<GATKSAMRecord> reads = bamBuilder.makeReads();

        if ( addAllAtOnce ) {
            cache.addAll(reads);
        } else {
            for ( final GATKSAMRecord read : reads ) {
View Full Code Here

        final boolean downsample = downsampleTo != -1;
        final DownsamplingMethod downsampler = downsample
                ? new DownsamplingMethod(DownsampleType.BY_SAMPLE, downsampleTo, null)
                : new DownsamplingMethod(DownsampleType.NONE, null, null);

        final ArtificialBAMBuilder bamBuilder = new ArtificialBAMBuilder(header.getSequenceDictionary(), nReadsPerLocus, nLoci);
        bamBuilder.createAndSetHeader(nSamples).setReadLength(readLength).setAlignmentStart(1);

        final List<GATKSAMRecord> reads = bamBuilder.makeReads();
        li = new LocusIteratorByState(new FakeCloseableIterator<GATKSAMRecord>(reads.iterator()),
                createTestReadProperties(downsampler, keepReads),
                genomeLocParser,
                bamBuilder.getSamples());

        final Set<GATKSAMRecord> seenSoFar = new HashSet<GATKSAMRecord>();
        final Set<GATKSAMRecord> keptReads = new HashSet<GATKSAMRecord>();
        int bpVisited = 0;
        while ( li.hasNext() ) {
View Full Code Here

TOP

Related Classes of org.broadinstitute.gatk.utils.sam.ArtificialBAMBuilder

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.