I'm looking to create 3 Hits
objects with GenomicRanges
. I've depicted these below.
findOverlaps(..., type="start")
is not adequate for returning hit1
since it misses the overlaps where the starts are not exactly aligned. Although maxgap
would help with this, I'm unsure how to use it in this instance since the value of maxgap
will depend on the width of each interval. Likewise for findOverlaps(..., type="end")
and findOverlaps(..., type="equal")
for hit2
and hit3
, respectively. No within
overlaps should be captured by any of the Hits objects.
Is there a simple way to do this with GenomicRanges
?
Hi, sorry but your question is not really clear to me. From what I understand: hit1 overlap over the start position but not the end position; hit2 overlap over the end but not the start; hit3 overlap both start and end. Is it correct?
I suspect you may use the resize function to get GRanges objects with the start and end positions (e.g. my.start = resize(myreads, width=1, fix='start') and so on), and use them for the intersections.