Closed gtrichard closed 6 years ago
If you want to find overlaps to the same region, do:
dummy <- GInteractions(seq_along(regions), seq_along(regions), regions)
final <- subsetByOverlaps(gi, dummy)
If you want to find overlaps between gi
and any two elements of regions
, use linkOverlaps
.
Your proposed approach uses regions=
, which doesn't correspond to any argument that I recall. The closest is use.region=
.
dummy <- GInteractions(seq_along(regions), seq_along(regions), regions) final <- subsetByOverlaps(gi, dummy)
Did the trick it seems, thank you very much @LTLA for the quick and precise answer!
For regions=
, yes I got it wrong while typing my question here, I meant use.region=
as you suggested.
Dear InteractionSet developers,
I recently started to use InteractionSet and it is an awesome R package, many thanks for the hard work.
I have one, perhaps naive, question about the overlap methods since I did not find such a case in the documentation of InteractionSet.
Given a GInteraction object
gi
and a GRanges objectregions
, I would like to only keep thegi
anchors1 and anchors2 that overlap with theregions
.As I understood, when using
subsetByOverlaps(gi, regions)
, I will get the anchors1 overlapping withregions
(with whatever anchors2) and the anchors2 overlapping withregions
(with whatever anchors1), but not the exclusive cases where anchors1 AND anchors2 are both overlapping withregions
, and this is what I am trying to achieve.I tried
But I don't get why there is a difference between:
And I'm not sure this is the right way to achieve what I want.
Do you have any suggestion to achieve it?
Many thanks, Gautier