Question: Obtain the specific range that overlap
gravatar for julrodr80
21 months ago by
julrodr8030 wrote:



I have two dataframes: cnv_1

chr     start   end
3   62860387    63000898
12  31296219    31406907
14  39762575    39769146
19  43372386    43519442
19  56419263    56572829


chr     start   end
6   30994163    30995078
19  43403531    44608011
18  1731154 1833682
3   46985863    47164711

with aprox 150000 entries each. I would like to know which fragments of cnv_1overlap in any way with cnv_2, and -this is the most important for me- to obtain the specific region that overlap. For example, doing that to the data.frames of the example, to obtain:

chr     start   end
19  43403531 43519442

thank you very much

ADD COMMENTlink modified 21 months ago • written 21 months ago by julrodr8030
gravatar for Michael Lawrence
21 months ago by
United States
Michael Lawrence10k wrote:

First make them GRanges,

cnv_gr_1 <- GRanges(cnv_1)
cnv_gr_2 <- GRanges(cnv_2)

And then find overlaps and the intersecting part of each overlapping pair:

pintersect(findOverlapPairs(cnv_gr_1, cnv_gr_2))


ADD COMMENTlink written 21 months ago by Michael Lawrence10k

I don't know why but... 

Error: could not find function "findOverlapPairs"

ADD REPLYlink written 21 months ago by julrodr8030

You'll need to update your Biocondutor.

ADD REPLYlink written 21 months ago by Michael Lawrence10k

I have this problem

Error: Bioconductor version 3.2 cannot be upgraded with R version 3.2.3

It's very frustrating, is the only function that does't work.

ADD REPLYlink written 21 months ago by julrodr8030

You'd need to update your R, and then your Bioconductor installation (in that order). It'll always help if you post your `sessionInfo()` along with your post, that way everyone knows exactly what platform and what versions of package you have installed. 

If you want a copy of all the packages you have installed in your current R, to carry over to the new installation of R, you can do something like this in R,


These can be installed in an R script (on a new R installation) or interactively with,


lst <- unlist(read.csv("rpacks.txt"))

lapply(as.character(lst), biocLite, ask=FALSE)

Also, please take a look at the documentation for this,

ADD REPLYlink modified 21 months ago • written 21 months ago by nitesh.turaga130
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 278 users visited in the last hour