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 inttoIntegerSafe(long coord) Convert a long coordinate to an integer, for use with interconverting between old style integer coordinates and new style long coordinates.static LocatabletoLocatable(HtsInterval interval) Convert an HtsInterval to aLocatabletoLocatableList(List<HtsInterval> intervals) Convert a List ofHtsIntervalto a list ofLocatable.static QueryIntervaltoQueryInterval(HtsInterval interval, SAMSequenceDictionary dictionary) Convert an HtsInterval to a QueryIntervalstatic QueryInterval[]toQueryIntervalArray(List<HtsInterval> intervals, SAMSequenceDictionary dictionary) Convert a list ofHtsIntervalto 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-HtsIntervalto 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-HtsIntervalto convert- Returns:
- a Locatable equivalent to
interval
-
toLocatableList
Convert a List ofHtsIntervalto a list ofLocatable.- Parameters:
intervals- list ofHtsIntervals to convert- Returns:
- a list of
Locatable
-
toQueryIntervalArray
@InternalAPI public static QueryInterval[] toQueryIntervalArray(List<HtsInterval> intervals, SAMSequenceDictionary dictionary) Convert a list ofHtsIntervalto an array ofQueryInterval- Parameters:
intervals- list ofHtsIntervals to convertdictionary- sequence dictionary to use- Returns:
- array of
QueryInterval
-
fromQueryIntervalArray
@InternalAPI public static List<HtsInterval> fromQueryIntervalArray(QueryInterval[] queryIntervals, SAMSequenceDictionary dictionary) - Parameters:
queryIntervals- list ofQueryIntervalto 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
coordif the conversion is safe - Throws:
IllegalArgumentException- if converting results in overflow
-