Search
Question: Obtain the specific range that overlap
0
gravatar for julrodr80
11 months ago by
julrodr8020
julrodr8020 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

cnv_2

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 11 months ago • written 11 months ago by julrodr8020
1
gravatar for Michael Lawrence
11 months ago by
United States
Michael Lawrence9.8k 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 11 months ago by Michael Lawrence9.8k

I don't know why but... 

findOverlapPairs()
Error: could not find function "findOverlapPairs"

ADD REPLYlink written 11 months ago by julrodr8020

You'll need to update your Biocondutor.

ADD REPLYlink written 11 months ago by Michael Lawrence9.8k

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 11 months ago by julrodr8020

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,

write.csv(rownames(installed.packages()),file="rpacks.txt")

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

library(BiocInstaller)

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

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

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

http://bioconductor.org/install/

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

Help
Access

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