@Override
protected LocationAwareSeekableRODIterator createIteratorFromResource(DataStreamSegment position, RMDTrack track) {
try {
if (position instanceof MappedStreamSegment) {
GenomeLoc pos = ((MappedStreamSegment) position).locus;
return new SeekableRODIterator(header,sequenceDictionary,referenceSequenceDictionary,genomeLocParser,track.query(pos));
} else {
return new SeekableRODIterator(header,sequenceDictionary,referenceSequenceDictionary,genomeLocParser,track.getIterator());
}
} catch (FileNotFoundException e) {
throw new UserException.CouldNotReadInputFile(fileDescriptor.getName(), "it could not be found");
} catch (IOException e) {
throw new ReviewedGATKException("Unable to create iterator for rod named " + fileDescriptor.getName(),e);