Package htsjdk.beta.plugin.interval
Class HtsIntervalUtils
java.lang.Object
htsjdk.beta.plugin.interval.HtsIntervalUtils
Methods for interconverting between HtsQueryInterval and existing htsjdk types such as Locatable/QueryInterval
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List
<HtsInterval> fromQueryIntervalArray
(QueryInterval[] queryIntervals, SAMSequenceDictionary dictionary) static int
toIntegerSafe
(long coord) Convert a long coordinate to an integer, for use with interconverting between old style integer coordinates and new style long coordinates.static Locatable
toLocatable
(HtsInterval interval) Convert an HtsInterval to aLocatable
toLocatableList
(List<HtsInterval> intervals) Convert a List ofHtsInterval
to a list ofLocatable
.static QueryInterval
toQueryInterval
(HtsInterval interval, SAMSequenceDictionary dictionary) Convert an HtsInterval to a QueryIntervalstatic QueryInterval[]
toQueryIntervalArray
(List<HtsInterval> intervals, SAMSequenceDictionary dictionary) Convert a list ofHtsInterval
to an array ofQueryInterval
-
Constructor Details
-
HtsIntervalUtils
public HtsIntervalUtils()
-
-
Method Details
-
toQueryInterval
@InternalAPI public static QueryInterval toQueryInterval(HtsInterval interval, SAMSequenceDictionary dictionary) Convert an HtsInterval to a QueryInterval- Parameters:
interval
-HtsInterval
to convertdictionary
- sequence dictionary to use to convert string query names to contig index- Returns:
- a QueryInterval equivalent to
interval
-
toLocatable
Convert an HtsInterval to aLocatable
- Parameters:
interval
-HtsInterval
to convert- Returns:
- a Locatable equivalent to
interval
-
toLocatableList
Convert a List ofHtsInterval
to a list ofLocatable
.- Parameters:
intervals
- list ofHtsInterval
s to convert- Returns:
- a list of
Locatable
-
toQueryIntervalArray
@InternalAPI public static QueryInterval[] toQueryIntervalArray(List<HtsInterval> intervals, SAMSequenceDictionary dictionary) Convert a list ofHtsInterval
to an array ofQueryInterval
- Parameters:
intervals
- list ofHtsInterval
s to convertdictionary
- sequence dictionary to use- Returns:
- array of
QueryInterval
-
fromQueryIntervalArray
@InternalAPI public static List<HtsInterval> fromQueryIntervalArray(QueryInterval[] queryIntervals, SAMSequenceDictionary dictionary) - Parameters:
queryIntervals
- list ofQueryInterval
to convertdictionary
- sequence dictionary to use for the conversion- Returns:
- list of
HtsInterval
-
toIntegerSafe
Convert a long coordinate to an integer, for use with interconverting between old style integer coordinates and new style long coordinates. Throws on overflow.- Parameters:
coord
- long coordinate to convert- Returns:
- an integer representation of
coord
if the conversion is safe - Throws:
IllegalArgumentException
- if converting results in overflow
-