which are necessary if you want to get your hands on the coordinates, either as int or as Position. Until now, I needed to access the coordinates to:
calculate 0-based start and end coordinates of a GenomicRegion to query Jannovar's interval tree for overlapping/neighboring items. The items are stored in the interval array using 0-based coordinates on Strand.POSITIVE
GenomicRegion region = ... // e.g. region corresponding to <DEL>
GenomicRegion posZeroBased = region.toPositiveStrand().toZeroBased();
IntervalArray<Transcript> intervalArray = intervalArrayMap.get(posZeroBased.contigId());
IntervalArray<Transcript>.QueryResult result = intervalArray.findOverlappingWithInterval(posZeroBased.start(), posZeroBased.end());
// ... process the result
calculate distance to upstream/downstream exon border for a variant located in the exon (an example is too out of context to be included here)
I am thinking whether we need to add this method. On one hand it would fit these use cases, on the other hand we might use the chained .toPositiveStrand().toZeroBased() here and only use the primitive-based methods for tasks like identifying overlaps, distances between regions, etc..
@julesjacobsen - how about hanging these methods on
GenomicRegion
to allow normalizing start/end coordinates to a given strand and coordinate system?The methods above would be used instead of constructs like:
which are necessary if you want to get your hands on the coordinates, either as
int
or asPosition
. Until now, I needed to access the coordinates to:GenomicRegion
to query Jannovar's interval tree for overlapping/neighboring items. The items are stored in the interval array using 0-based coordinates onStrand.POSITIVE
I am thinking whether we need to add this method. On one hand it would fit these use cases, on the other hand we might use the chained
.toPositiveStrand().toZeroBased()
here and only use the primitive-based methods for tasks like identifying overlaps, distances between regions, etc..