[BioC] Intersecting two chromosomal ranges but keeping the unique ones

Steve Lianoglou mailinglist.honeypot at gmail.com
Mon Mar 12 19:31:16 CET 2012


As an aside, don't forget to hit "reply all" when responding to bioc
emails, so our correspondence stays on the list.


On Mon, Mar 12, 2012 at 12:12 PM, Yadav Sapkota <ysapkota at ualberta.ca> wrote:
> Hi Steve,
> Thank you very much for the prompt reply.
> I tried countOverlaps, match and %in% functions and they all work but the
> output is in logical format. I was wondering if I could just append the
> results of any of these three functions with the output given by INTERSECT
> function as Rangelist (same as query or subject format)

Well, you can just use the result of these functions to index your
ranges in order to keep the ones that are TRUE, eg:

R> subject.only <- subject[countOverlaps(subject, Query) == 0]
R> temp <- c(intersected, subject.only)

... and ... I guess you can take it from here?


Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

More information about the Bioconductor mailing list