Cleanup, and support either by-interval traversals or full traversals in data source-backed code.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@362 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
2322bb7d86
commit
c2669021b8
|
|
@ -56,25 +56,40 @@ public class MicroManager {
|
||||||
|
|
||||||
public void execute( Walker walker, // the analysis technique to use.
|
public void execute( Walker walker, // the analysis technique to use.
|
||||||
List<GenomeLoc> locations ) { // list of work to do
|
List<GenomeLoc> locations ) { // list of work to do
|
||||||
ShardStrategy shardStrategy = ShardStrategyFactory.shatter( ShardStrategyFactory.SHATTER_STRATEGY.LINEAR,
|
ShardStrategy shardStrategy = null;
|
||||||
|
if( locations != null )
|
||||||
|
shardStrategy = ShardStrategyFactory.shatter( ShardStrategyFactory.SHATTER_STRATEGY.LINEAR,
|
||||||
|
ref.getSequenceDictionary(),
|
||||||
|
SHARD_SIZE,
|
||||||
|
locations );
|
||||||
|
else
|
||||||
|
shardStrategy = ShardStrategyFactory.shatter( ShardStrategyFactory.SHATTER_STRATEGY.LINEAR,
|
||||||
ref.getSequenceDictionary(),
|
ref.getSequenceDictionary(),
|
||||||
SHARD_SIZE );
|
SHARD_SIZE );
|
||||||
|
|
||||||
ReferenceIterator refIter = new ReferenceIterator(ref);
|
ReferenceIterator refIter = new ReferenceIterator(ref);
|
||||||
|
SAMBAMDataSource dataSource = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
dataSource = new SAMBAMDataSource( Arrays.asList( new String[] { reads.getCanonicalPath() } ) );
|
||||||
|
}
|
||||||
|
catch( SimpleDataSourceLoadException ex ) {
|
||||||
|
throw new RuntimeException( ex );
|
||||||
|
}
|
||||||
|
catch( IOException ex ) {
|
||||||
|
throw new RuntimeException( ex );
|
||||||
|
}
|
||||||
|
|
||||||
Object accumulator = ((LocusWalker<?,?>)walker).reduceInit();
|
Object accumulator = ((LocusWalker<?,?>)walker).reduceInit();
|
||||||
|
|
||||||
for(Shard shard: shardStrategy) {
|
for(Shard shard: shardStrategy) {
|
||||||
Iterator<SAMRecord> readShard = null;
|
Iterator<SAMRecord> readShard = null;
|
||||||
try {
|
try {
|
||||||
SAMBAMDataSource dataSource = new SAMBAMDataSource( Arrays.asList( new String[] { reads.getCanonicalPath() } ) );
|
|
||||||
readShard = dataSource.seek( shard.getGenomeLoc() );
|
readShard = dataSource.seek( shard.getGenomeLoc() );
|
||||||
}
|
}
|
||||||
catch( SimpleDataSourceLoadException ex ) {
|
catch( SimpleDataSourceLoadException ex ) {
|
||||||
throw new RuntimeException( ex );
|
throw new RuntimeException( ex );
|
||||||
}
|
}
|
||||||
catch( IOException ex ) {
|
|
||||||
throw new RuntimeException( ex );
|
|
||||||
}
|
|
||||||
|
|
||||||
ReferenceProvider referenceProvider = new ReferenceProvider( refIter );
|
ReferenceProvider referenceProvider = new ReferenceProvider( refIter );
|
||||||
LocusContextProvider locusProvider = new LocusContextProvider( readShard );
|
LocusContextProvider locusProvider = new LocusContextProvider( readShard );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue