Cleaning up the inheritance hierarchy from the previous commit.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2738 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
88495a39d4
commit
e7f5c93fe5
|
|
@ -41,7 +41,7 @@ import java.net.URL;
|
||||||
* Internal class for reading and querying BAM files.
|
* Internal class for reading and querying BAM files.
|
||||||
*/
|
*/
|
||||||
class BAMFileReader2
|
class BAMFileReader2
|
||||||
extends SAMFileReader2.ReaderImplementation2 {
|
extends SAMFileReader.ReaderImplementation {
|
||||||
// True if reading from a File rather than an InputStream
|
// True if reading from a File rather than an InputStream
|
||||||
private boolean mIsSeekable = false;
|
private boolean mIsSeekable = false;
|
||||||
// For converting bytes into other primitive types
|
// For converting bytes into other primitive types
|
||||||
|
|
|
||||||
|
|
@ -62,14 +62,6 @@ public class SAMFileReader2 implements Iterable<SAMRecord> {
|
||||||
private ReaderImplementation mReader = null;
|
private ReaderImplementation mReader = null;
|
||||||
private File samFile = null;
|
private File samFile = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal interface for SAM/BAM file reader implementations.
|
|
||||||
* Implemented as an abstract class to enforce better access control.
|
|
||||||
*/
|
|
||||||
static abstract class ReaderImplementation2 extends SAMFileReader.ReaderImplementation {
|
|
||||||
abstract CloseableIterator<SAMRecord> getIterator(List<Chunk> chunks);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare to read a SAM or BAM file. Indexed lookup not allowed because reading from InputStream.
|
* Prepare to read a SAM or BAM file. Indexed lookup not allowed because reading from InputStream.
|
||||||
*/
|
*/
|
||||||
|
|
@ -200,14 +192,14 @@ public class SAMFileReader2 implements Iterable<SAMRecord> {
|
||||||
public CloseableIterator<SAMRecord> iterator(List<Chunk> chunks) {
|
public CloseableIterator<SAMRecord> iterator(List<Chunk> chunks) {
|
||||||
// TODO: Add sanity checks so that we're not doing this against a BAM file.
|
// TODO: Add sanity checks so that we're not doing this against a BAM file.
|
||||||
if(!(mReader instanceof BAMFileReader2))
|
if(!(mReader instanceof BAMFileReader2))
|
||||||
throw new PicardException("This call requires a ReaderImplementation2-compliant interface");
|
throw new PicardException("This call cannot be performed without a backing BAMFileReader2");
|
||||||
return ((BAMFileReader2)mReader).getIterator(chunks);
|
return ((BAMFileReader2)mReader).getIterator(chunks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Chunk> getOverlappingFilePointers(final String sequence, final int start, final int end) {
|
public List<Chunk> getOverlappingFilePointers(final String sequence, final int start, final int end) {
|
||||||
// TODO: Add sanity checks so that we're not doing this against a BAM file.
|
// TODO: Add sanity checks so that we're not doing this against a BAM file.
|
||||||
if(!(mReader instanceof BAMFileReader2))
|
if(!(mReader instanceof BAMFileReader2))
|
||||||
throw new PicardException("This call requires a ReaderImplementation2-compliant interface");
|
throw new PicardException("This call cannot be performed without a backing BAMFileReader2");
|
||||||
return ((BAMFileReader2)mReader).getOverlappingFilePointers(sequence,start,end);
|
return ((BAMFileReader2)mReader).getOverlappingFilePointers(sequence,start,end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.broadinstitute.sting.gatk.datasources.shards;
|
||||||
|
|
||||||
|
import net.sf.samtools.Chunk;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A common interface for shards that natively understand the BAM format.
|
||||||
|
*
|
||||||
|
* @author mhanna
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
public interface BAMFormatAwareShard extends Shard {
|
||||||
|
/**
|
||||||
|
* Get the list of chunks delimiting this shard.
|
||||||
|
* @return a list of chunks that contain data for this shard.
|
||||||
|
*/
|
||||||
|
public List<Chunk> getChunks();
|
||||||
|
}
|
||||||
|
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||||
* @author mhanna
|
* @author mhanna
|
||||||
* @version 0.1
|
* @version 0.1
|
||||||
*/
|
*/
|
||||||
public class BlockDelimitedReadShard extends ReadShard {
|
public class BlockDelimitedReadShard extends ReadShard implements BAMFormatAwareShard {
|
||||||
/**
|
/**
|
||||||
* The list of chunks to retrieve when loading this shard.
|
* The list of chunks to retrieve when loading this shard.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package org.broadinstitute.sting.gatk.datasources.shards;
|
||||||
|
|
||||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||||
import org.broadinstitute.sting.utils.GenomeLocSortedSet;
|
import org.broadinstitute.sting.utils.GenomeLocSortedSet;
|
||||||
|
import org.broadinstitute.sting.utils.StingException;
|
||||||
import net.sf.samtools.Chunk;
|
import net.sf.samtools.Chunk;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -35,29 +36,30 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* A shard that's delimited based on the index rather than
|
* A shard that's delimited based on the index rather than
|
||||||
*/
|
*/
|
||||||
public class IndexDelimitedLocusShard implements Shard {
|
public class IndexDelimitedLocusShard extends LocusShard implements BAMFormatAwareShard {
|
||||||
|
|
||||||
/**
|
|
||||||
* a collection of genomic locations to interate over
|
|
||||||
*/
|
|
||||||
private final GenomeLocSortedSet intervals;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of the chunks associated with this shard.
|
* A list of the chunks associated with this shard.
|
||||||
*/
|
*/
|
||||||
private final List<Chunk> chunks;
|
private final List<Chunk> chunks;
|
||||||
|
|
||||||
IndexDelimitedLocusShard(GenomeLocSortedSet intervals, List<Chunk> chunks) {
|
/**
|
||||||
this.intervals = intervals;
|
* An IndexDelimitedLocusShard can be used either for LOCUS or LOCUS_INTERVAL shard types.
|
||||||
this.chunks = chunks;
|
* Track which type is being used.
|
||||||
}
|
*/
|
||||||
|
private final ShardType shardType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The locations represented by this shard.
|
* Create a new locus shard, divided by index.
|
||||||
* @return the genome location represented by this shard
|
* @param intervals List of intervals to process.
|
||||||
|
* @param chunks Chunks associated with that interval.
|
||||||
|
* @param shardType Type of the shard; must be either LOCUS or LOCUS_INTERVAL.
|
||||||
*/
|
*/
|
||||||
public List<GenomeLoc> getGenomeLocs() {
|
IndexDelimitedLocusShard(List<GenomeLoc> intervals, List<Chunk> chunks, ShardType shardType) {
|
||||||
return intervals.toList();
|
super(intervals);
|
||||||
|
this.chunks = chunks;
|
||||||
|
if(shardType != ShardType.LOCUS && shardType != ShardType.LOCUS_INTERVAL)
|
||||||
|
throw new StingException("Attempted to create an IndexDelimitedLocusShard with invalid shard type: " + shardType);
|
||||||
|
this.shardType = shardType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -69,19 +71,10 @@ public class IndexDelimitedLocusShard implements Shard {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the type of shard, LOCUS_INTERVAL.
|
* returns the type of shard.
|
||||||
* @return LOCUS_INTERVAL, indicating the shard type
|
|
||||||
*/
|
|
||||||
public ShardType getShardType() {
|
|
||||||
return ShardType.LOCUS_INTERVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* String representation of this shard.
|
|
||||||
* @return A string representation of the boundaries of this shard.
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public ShardType getShardType() {
|
||||||
return intervals.toString();
|
return shardType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -78,7 +78,7 @@ public class IndexDelimitedLocusShardStrategy implements ShardStrategy {
|
||||||
List<Chunk> filePointers = locations.get(loc);
|
List<Chunk> filePointers = locations.get(loc);
|
||||||
locations.remove(loc);
|
locations.remove(loc);
|
||||||
|
|
||||||
return new IndexDelimitedLocusShard(GenomeLocSortedSet.createSetFromList(Arrays.asList(loc)),filePointers);
|
return new IndexDelimitedLocusShard(Collections.singletonList(loc),filePointers,Shard.ShardType.LOCUS_INTERVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** we don't support the remove command */
|
/** we don't support the remove command */
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package org.broadinstitute.sting.gatk.datasources.shards;
|
package org.broadinstitute.sting.gatk.datasources.shards;
|
||||||
|
|
||||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||||
|
import org.broadinstitute.sting.utils.Utils;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -34,17 +35,16 @@ import java.util.List;
|
||||||
* in place so it's easier to change guts later.
|
* in place so it's easier to change guts later.
|
||||||
*/
|
*/
|
||||||
public class LocusShard implements Shard {
|
public class LocusShard implements Shard {
|
||||||
|
|
||||||
// currently our location
|
// currently our location
|
||||||
final GenomeLoc mLoc;
|
final List<GenomeLoc> loci;
|
||||||
|
|
||||||
public LocusShard(GenomeLoc loc) {
|
public LocusShard(List<GenomeLoc> loci) {
|
||||||
this.mLoc = loc;
|
this.loci = loci;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return the genome location represented by this shard */
|
/** @return the genome location represented by this shard */
|
||||||
public List<GenomeLoc> getGenomeLocs() {
|
public List<GenomeLoc> getGenomeLocs() {
|
||||||
return Collections.singletonList(mLoc);
|
return loci;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -56,21 +56,12 @@ public class LocusShard implements Shard {
|
||||||
return ShardType.LOCUS;
|
return ShardType.LOCUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* return a shard representing the passed in GenomeLoc
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static LocusShard toShard(GenomeLoc loc) {
|
|
||||||
return new LocusShard(loc);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* String representation of this shard.
|
* String representation of this shard.
|
||||||
* @return A string representation of the boundaries of this shard.
|
* @return A string representation of the boundaries of this shard.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return mLoc.toString();
|
return Utils.join(";",loci);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import org.broadinstitute.sting.utils.StingException;
|
||||||
import org.broadinstitute.sting.utils.GenomeLocParser;
|
import org.broadinstitute.sting.utils.GenomeLocParser;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.Collections;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* User: aaron
|
* User: aaron
|
||||||
|
|
@ -195,7 +196,7 @@ public abstract class LocusShardStrategy implements ShardStrategy {
|
||||||
if (nextStart + proposedSize - 1 < length) {
|
if (nextStart + proposedSize - 1 < length) {
|
||||||
lastGenomeLocSize = proposedSize;
|
lastGenomeLocSize = proposedSize;
|
||||||
mLoc = GenomeLocParser.createGenomeLoc(dic.getSequence(seqLoc).getSequenceIndex(), nextStart, nextStart + proposedSize - 1);
|
mLoc = GenomeLocParser.createGenomeLoc(dic.getSequence(seqLoc).getSequenceIndex(), nextStart, nextStart + proposedSize - 1);
|
||||||
return LocusShard.toShard(mLoc);
|
return new LocusShard(Collections.singletonList(mLoc));
|
||||||
}
|
}
|
||||||
// else we can't make it in the current location, we have to stitch one together
|
// else we can't make it in the current location, we have to stitch one together
|
||||||
else {
|
else {
|
||||||
|
|
@ -208,7 +209,7 @@ public abstract class LocusShardStrategy implements ShardStrategy {
|
||||||
|
|
||||||
// move to the next contig
|
// move to the next contig
|
||||||
// the next sequence should start at the begining of the next contig
|
// the next sequence should start at the begining of the next contig
|
||||||
Shard ret = LocusShard.toShard(GenomeLocParser.createGenomeLoc(dic.getSequence(seqLoc).getSequenceIndex(), nextStart, nextStart + lastGenomeLocSize - 1));
|
Shard ret = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc(dic.getSequence(seqLoc).getSequenceIndex(), nextStart, nextStart + lastGenomeLocSize - 1)));
|
||||||
|
|
||||||
// now jump ahead to the next contig
|
// now jump ahead to the next contig
|
||||||
jumpContig();
|
jumpContig();
|
||||||
|
|
|
||||||
|
|
@ -49,27 +49,19 @@ public class BlockDrivenSAMDataSource extends SAMDataSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
public StingSAMIterator seek(Shard shard) {
|
public StingSAMIterator seek(Shard shard) {
|
||||||
if(!(shard instanceof BlockDelimitedReadShard) && !(shard instanceof IndexDelimitedLocusShard))
|
if(!(shard instanceof BAMFormatAwareShard))
|
||||||
throw new StingException("BlockDrivenSAMDataSource cannot operate on shards of type: " + shard);
|
throw new StingException("BlockDrivenSAMDataSource cannot operate on shards of type: " + shard.getClass());
|
||||||
|
|
||||||
if(shard instanceof ReadShard) {
|
// Since the beginning of time for the GATK, enableVerification has been true only for ReadShards. I don't
|
||||||
CloseableIterator<SAMRecord> iterator = reader.iterator(((BlockDelimitedReadShard)shard).getChunks());
|
// know why this is. Please add a comment here if you do.
|
||||||
return applyDecoratingIterators(true,
|
boolean enableVerification = shard instanceof ReadShard;
|
||||||
StingSAMIteratorAdapter.adapt(reads, iterator),
|
|
||||||
reads.getDownsamplingFraction(),
|
|
||||||
reads.getValidationExclusionList().contains(ValidationExclusion.TYPE.NO_READ_ORDER_VERIFICATION),
|
|
||||||
reads.getSupplementalFilters());
|
|
||||||
}
|
|
||||||
else if(shard instanceof IndexDelimitedLocusShard) {
|
|
||||||
CloseableIterator<SAMRecord> iterator = reader.iterator(((IndexDelimitedLocusShard)shard).getChunks());
|
|
||||||
return applyDecoratingIterators(false,
|
|
||||||
StingSAMIteratorAdapter.adapt(reads, iterator),
|
|
||||||
reads.getDownsamplingFraction(),
|
|
||||||
reads.getValidationExclusionList().contains(ValidationExclusion.TYPE.NO_READ_ORDER_VERIFICATION),
|
|
||||||
reads.getSupplementalFilters());
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new UnsupportedOperationException("Unable to infer type of this shard.");
|
CloseableIterator<SAMRecord> iterator = reader.iterator(((BAMFormatAwareShard)shard).getChunks());
|
||||||
|
return applyDecoratingIterators(enableVerification,
|
||||||
|
StingSAMIteratorAdapter.adapt(reads,iterator),
|
||||||
|
reads.getDownsamplingFraction(),
|
||||||
|
reads.getValidationExclusionList().contains(ValidationExclusion.TYPE.NO_READ_ORDER_VERIFICATION),
|
||||||
|
reads.getSupplementalFilters());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ import org.broadinstitute.sting.gatk.iterators.GenomeLocusIterator;
|
||||||
|
|
||||||
import net.sf.picard.reference.ReferenceSequence;
|
import net.sf.picard.reference.ReferenceSequence;
|
||||||
import net.sf.samtools.util.StringUtil;
|
import net.sf.samtools.util.StringUtil;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 The Broad Institute
|
* Copyright (c) 2009 The Broad Institute
|
||||||
*
|
*
|
||||||
|
|
@ -54,7 +56,7 @@ public class LocusReferenceViewTest extends ReferenceViewTemplate {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOverlappingReferenceBases() {
|
public void testOverlappingReferenceBases() {
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc(0, sequenceFile.getSequence("chrM").length() - 10, sequenceFile.getSequence("chrM").length()));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc(0, sequenceFile.getSequence("chrM").length() - 10, sequenceFile.getSequence("chrM").length())));
|
||||||
|
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, null, sequenceFile, null);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, null, sequenceFile, null);
|
||||||
LocusReferenceView view = new LocusReferenceView(dataProvider);
|
LocusReferenceView view = new LocusReferenceView(dataProvider);
|
||||||
|
|
@ -71,7 +73,7 @@ public class LocusReferenceViewTest extends ReferenceViewTemplate {
|
||||||
/** Queries outside the bounds of the shard should generate an error. */
|
/** Queries outside the bounds of the shard should generate an error. */
|
||||||
@Test(expected = InvalidPositionException.class)
|
@Test(expected = InvalidPositionException.class)
|
||||||
public void testBoundsFailure() {
|
public void testBoundsFailure() {
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc(0, 1, 50));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc(0, 1, 50)));
|
||||||
|
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, null, sequenceFile, null);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, null, sequenceFile, null);
|
||||||
LocusReferenceView view = new LocusReferenceView(dataProvider);
|
LocusReferenceView view = new LocusReferenceView(dataProvider);
|
||||||
|
|
@ -86,7 +88,7 @@ public class LocusReferenceViewTest extends ReferenceViewTemplate {
|
||||||
* @param loc
|
* @param loc
|
||||||
*/
|
*/
|
||||||
protected void validateLocation( GenomeLoc loc ) {
|
protected void validateLocation( GenomeLoc loc ) {
|
||||||
Shard shard = new LocusShard(loc);
|
Shard shard = new LocusShard(Collections.singletonList(loc));
|
||||||
GenomeLocusIterator shardIterator = new GenomeLocusIterator(shard.getGenomeLocs());
|
GenomeLocusIterator shardIterator = new GenomeLocusIterator(shard.getGenomeLocs());
|
||||||
|
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, null, sequenceFile, null);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, null, sequenceFile, null);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
||||||
SAMRecordIterator iterator = new SAMRecordIterator();
|
SAMRecordIterator iterator = new SAMRecordIterator();
|
||||||
|
|
||||||
GenomeLoc shardBounds = GenomeLocParser.createGenomeLoc("chr1", 1, 5);
|
GenomeLoc shardBounds = GenomeLocParser.createGenomeLoc("chr1", 1, 5);
|
||||||
Shard shard = new LocusShard(shardBounds);
|
Shard shard = new LocusShard(Collections.singletonList(shardBounds));
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
||||||
|
|
||||||
LocusView view = createView(dataProvider);
|
LocusView view = createView(dataProvider);
|
||||||
|
|
@ -59,7 +59,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
||||||
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
||||||
|
|
||||||
GenomeLoc shardBounds = GenomeLocParser.createGenomeLoc("chr1", 1, 5);
|
GenomeLoc shardBounds = GenomeLocParser.createGenomeLoc("chr1", 1, 5);
|
||||||
Shard shard = new LocusShard(shardBounds);
|
Shard shard = new LocusShard(Collections.singletonList(shardBounds));
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
||||||
|
|
||||||
LocusView view = createView(dataProvider);
|
LocusView view = createView(dataProvider);
|
||||||
|
|
@ -72,7 +72,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
||||||
SAMRecord read = buildSAMRecord("chr1", 1, 5);
|
SAMRecord read = buildSAMRecord("chr1", 1, 5);
|
||||||
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
||||||
|
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chr1", 1, 10));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
||||||
LocusView view = createView(dataProvider);
|
LocusView view = createView(dataProvider);
|
||||||
|
|
||||||
|
|
@ -84,7 +84,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
||||||
SAMRecord read = buildSAMRecord("chr1", 6, 10);
|
SAMRecord read = buildSAMRecord("chr1", 6, 10);
|
||||||
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
||||||
|
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chr1", 1, 10));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
||||||
LocusView view = createView(dataProvider);
|
LocusView view = createView(dataProvider);
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
||||||
SAMRecord read = buildSAMRecord("chr1", 3, 7);
|
SAMRecord read = buildSAMRecord("chr1", 3, 7);
|
||||||
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
||||||
|
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chr1", 1, 10));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
||||||
LocusView view = createView(dataProvider);
|
LocusView view = createView(dataProvider);
|
||||||
|
|
||||||
|
|
@ -108,7 +108,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
||||||
SAMRecord read = buildSAMRecord("chr1", 1, 10);
|
SAMRecord read = buildSAMRecord("chr1", 1, 10);
|
||||||
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
||||||
|
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chr1", 6, 15));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 6, 15)));
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
||||||
LocusView view = createView(dataProvider);
|
LocusView view = createView(dataProvider);
|
||||||
|
|
||||||
|
|
@ -120,7 +120,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
||||||
SAMRecord read = buildSAMRecord("chr1", 6, 15);
|
SAMRecord read = buildSAMRecord("chr1", 6, 15);
|
||||||
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
||||||
|
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chr1", 1, 10));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
||||||
LocusView view = createView(dataProvider);
|
LocusView view = createView(dataProvider);
|
||||||
|
|
||||||
|
|
@ -133,7 +133,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
||||||
SAMRecord read2 = buildSAMRecord("chr1", 6, 10);
|
SAMRecord read2 = buildSAMRecord("chr1", 6, 10);
|
||||||
SAMRecordIterator iterator = new SAMRecordIterator(read1, read2);
|
SAMRecordIterator iterator = new SAMRecordIterator(read1, read2);
|
||||||
|
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chr1", 1, 10));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
||||||
LocusView view = createView(dataProvider);
|
LocusView view = createView(dataProvider);
|
||||||
|
|
||||||
|
|
@ -150,7 +150,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
||||||
SAMRecord read4 = buildSAMRecord("chr1", 6, 10);
|
SAMRecord read4 = buildSAMRecord("chr1", 6, 10);
|
||||||
SAMRecordIterator iterator = new SAMRecordIterator(read1, read2, read3, read4);
|
SAMRecordIterator iterator = new SAMRecordIterator(read1, read2, read3, read4);
|
||||||
|
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chr1", 1, 10));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
||||||
LocusView view = createView(dataProvider);
|
LocusView view = createView(dataProvider);
|
||||||
|
|
||||||
|
|
@ -167,7 +167,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
||||||
SAMRecord read4 = buildSAMRecord("chr1", 5, 9);
|
SAMRecord read4 = buildSAMRecord("chr1", 5, 9);
|
||||||
SAMRecordIterator iterator = new SAMRecordIterator(read1, read2, read3, read4);
|
SAMRecordIterator iterator = new SAMRecordIterator(read1, read2, read3, read4);
|
||||||
|
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chr1", 1, 10));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
||||||
LocusView view = createView(dataProvider);
|
LocusView view = createView(dataProvider);
|
||||||
|
|
||||||
|
|
@ -186,7 +186,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
||||||
SAMRecord read6 = buildSAMRecord("chr1", 6, 10);
|
SAMRecord read6 = buildSAMRecord("chr1", 6, 10);
|
||||||
SAMRecordIterator iterator = new SAMRecordIterator(read1, read2, read3, read4, read5, read6);
|
SAMRecordIterator iterator = new SAMRecordIterator(read1, read2, read3, read4, read5, read6);
|
||||||
|
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chr1", 1, 10));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
||||||
LocusView view = createView(dataProvider);
|
LocusView view = createView(dataProvider);
|
||||||
|
|
||||||
|
|
@ -212,7 +212,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
||||||
SAMRecordIterator iterator = new SAMRecordIterator(read01, read02, read03, read04, read05, read06,
|
SAMRecordIterator iterator = new SAMRecordIterator(read01, read02, read03, read04, read05, read06,
|
||||||
read07, read08, read09, read10, read11, read12);
|
read07, read08, read09, read10, read11, read12);
|
||||||
|
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chr1", 6, 15));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 6, 15)));
|
||||||
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
ShardDataProvider dataProvider = new ShardDataProvider(shard, iterator);
|
||||||
LocusView view = createView(dataProvider);
|
LocusView view = createView(dataProvider);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ public class ReferenceOrderedViewTest extends BaseTest {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testNoBindings() {
|
public void testNoBindings() {
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chrM",1,30));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chrM",1,30)));
|
||||||
ShardDataProvider provider = new ShardDataProvider(shard, null, seq, Collections.<ReferenceOrderedDataSource>emptyList());
|
ShardDataProvider provider = new ShardDataProvider(shard, null, seq, Collections.<ReferenceOrderedDataSource>emptyList());
|
||||||
ReferenceOrderedView view = new ManagingReferenceOrderedView( provider );
|
ReferenceOrderedView view = new ManagingReferenceOrderedView( provider );
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@ public class ReferenceOrderedViewTest extends BaseTest {
|
||||||
ReferenceOrderedData rod = new ReferenceOrderedData("tableTest", file, TabularROD.class);
|
ReferenceOrderedData rod = new ReferenceOrderedData("tableTest", file, TabularROD.class);
|
||||||
ReferenceOrderedDataSource dataSource = new ReferenceOrderedDataSource(rod);
|
ReferenceOrderedDataSource dataSource = new ReferenceOrderedDataSource(rod);
|
||||||
|
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chrM",1,30));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chrM",1,30)));
|
||||||
|
|
||||||
ShardDataProvider provider = new ShardDataProvider(shard, null, seq, Collections.singletonList(dataSource));
|
ShardDataProvider provider = new ShardDataProvider(shard, null, seq, Collections.singletonList(dataSource));
|
||||||
ReferenceOrderedView view = new ManagingReferenceOrderedView( provider );
|
ReferenceOrderedView view = new ManagingReferenceOrderedView( provider );
|
||||||
|
|
@ -95,7 +95,7 @@ public class ReferenceOrderedViewTest extends BaseTest {
|
||||||
ReferenceOrderedDataSource dataSource2 = new ReferenceOrderedDataSource(rod2);
|
ReferenceOrderedDataSource dataSource2 = new ReferenceOrderedDataSource(rod2);
|
||||||
|
|
||||||
|
|
||||||
Shard shard = new LocusShard(GenomeLocParser.createGenomeLoc("chrM",1,30));
|
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chrM",1,30)));
|
||||||
|
|
||||||
ShardDataProvider provider = new ShardDataProvider(shard, null, seq, Arrays.asList(dataSource1,dataSource2));
|
ShardDataProvider provider = new ShardDataProvider(shard, null, seq, Arrays.asList(dataSource1,dataSource2));
|
||||||
ReferenceOrderedView view = new ManagingReferenceOrderedView( provider );
|
ReferenceOrderedView view = new ManagingReferenceOrderedView( provider );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue