GATK Engine: do not merge FilePointers that span multiple contigs

This affects both the non-experimental and experimental engine paths, and so
may break tests, but this is a necessary change.
This commit is contained in:
David Roazen 2012-09-27 17:59:02 -04:00
parent e82946e5c9
commit e740977994
2 changed files with 12 additions and 3 deletions

View File

@ -73,8 +73,15 @@ public class IntervalSharder implements Iterator<FilePointer> {
*/
public FilePointer next() {
FilePointer current = wrappedIterator.next();
while(wrappedIterator.hasNext() && current.isRegionUnmapped == wrappedIterator.peek().isRegionUnmapped && current.minus(wrappedIterator.peek()) == 0)
while ( wrappedIterator.hasNext() &&
current.isRegionUnmapped == wrappedIterator.peek().isRegionUnmapped &&
(current.getContigIndex() == wrappedIterator.peek().getContigIndex() || current.isRegionUnmapped) &&
current.minus(wrappedIterator.peek()) == 0 ) {
current = current.combine(parser,wrappedIterator.next());
}
return current;
}

View File

@ -42,8 +42,10 @@ public class LocusShardBalancer extends ShardBalancer {
public Shard next() {
FilePointer current = filePointers.next();
while(filePointers.hasNext() && current.minus(filePointers.peek()) == 0)
current = current.combine(parser,filePointers.next());
// FilePointers have already been combined as necessary at the IntervalSharder level. No
// need to do so again here.
return new LocusShard(parser,readsDataSource,current.getLocations(),current.fileSpans);
}