Search
Question: Obtain the specific range that overlap
0
18 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
modified 18 months ago • written 18 months ago by julrodr8020
1
18 months ago by
Michael Lawrence10.0k
United States
Michael Lawrence10.0k 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))

I don't know why but...

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

You'll need to update your Biocondutor.

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.

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)

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

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

http://bioconductor.org/install/