use of com.intel.genomicsdb.ChromosomeInterval in project gatk by broadinstitute.
the class GenomicsDBImport method initializeIntervals.
/**
* Loads our intervals using the best available sequence
* dictionary (as returned by {@link #getBestAvailableSequenceDictionary})
* to parse/verify them. Does nothing if no intervals were specified.
*/
private void initializeIntervals() {
if (intervalArgumentCollection.intervalsSpecified()) {
final SAMSequenceDictionary intervalDictionary = getBestAvailableSequenceDictionary();
if (intervalDictionary == null) {
throw new UserException("We require at least one input source that " + "has a sequence dictionary (reference or reads) when intervals are specified");
}
intervals = new ArrayList<>();
final List<SimpleInterval> simpleIntervalList = intervalArgumentCollection.getIntervals(intervalDictionary);
if (simpleIntervalList.size() > 1) {
throw new UserException("More than one interval specified. The tool takes only one");
}
for (final SimpleInterval simpleInterval : simpleIntervalList) {
intervals.add(new ChromosomeInterval(simpleInterval.getContig(), simpleInterval.getStart(), simpleInterval.getEnd()));
}
} else {
throw new UserException("No intervals specified");
}
}
Aggregations