Search in sources :

Example 1 with ChromosomeInterval

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");
    }
}
Also used : ChromosomeInterval(com.intel.genomicsdb.ChromosomeInterval) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval) UserException(org.broadinstitute.hellbender.exceptions.UserException) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary)

Aggregations

ChromosomeInterval (com.intel.genomicsdb.ChromosomeInterval)1 SAMSequenceDictionary (htsjdk.samtools.SAMSequenceDictionary)1 UserException (org.broadinstitute.hellbender.exceptions.UserException)1 SimpleInterval (org.broadinstitute.hellbender.utils.SimpleInterval)1