Question: Obtain the specific range that overlap
0
gravatar for julrodr80
2.9 years ago by
julrodr8030
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

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

genomicranges overlap range • 518 views
ADD COMMENTlink modified 2.9 years ago • written 2.9 years ago by julrodr8030
Answer: Obtain the specific range that overlap
1
gravatar for Michael Lawrence
2.9 years ago by
United States
Michael Lawrence11k 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 2.9 years ago by Michael Lawrence11k

I don't know why but... 

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

ADD REPLYlink written 2.9 years ago by julrodr8030

You'll need to update your Biocondutor.

ADD REPLYlink written 2.9 years ago by Michael Lawrence11k

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 2.9 years 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,

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 2.9 years ago • written 2.9 years ago by nitesh.turaga140
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 16.09
Traffic: 341 users visited in the last hour