Set Operations Methods from GenomicRanges Not Working
1
0
Entering edit mode
lapatodm • 0
@lapatodm-11096
Last seen 8.2 years ago

Hello,

I am trying to determine which positions from my data.frame (dmp) are in my GRanges object CpGi. When I call intersect(), R reverts to the base version, even if I use GenomicRanges::intersect()

CpGi.sig   <- intersect(dmp, CpGi, ignore.strand=T) 

Error in base::intersect(x, y, ...) : 
  unused argument (ignore.strand = TRUE)
traceback()
3: base::intersect(x, y, ...)
2: GenomicRanges::intersect(dmp, CpGi, ignore.strand = T)
1: GenomicRanges::intersect(dmp, CpGi, ignore.strand = T)


I have also tried using both the development and release versions of GenomicRanges. In both package versions, union, setdiff, and other setOps methods are all being called from base rather than GenomicRanges. 

 

I tried the parallel version (pintersect()) and received this error:

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘pintersect’ for signature ‘"data.frame", "GRanges"’

Has anyone seen this problem before? From the help/vignette pages, I thought that data.frames were an acceptable object to use, particularly for pintersect()

Any help would be appreciated.

Thanks,

Dana

 

sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.4 (El Capitan)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] BiocInstaller_1.23.5 qvalue_2.4.2         GenomicRanges_1.25.9 GenomeInfoDb_1.8.1  
[5] IRanges_2.7.11       S4Vectors_0.11.9     BiocGenerics_0.19.2 

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.5      plyr_1.8.4       grid_3.3.0       gtable_0.2.0     magrittr_1.5     scales_0.4.0    
 [7] ggplot2_2.1.0    stringi_1.1.1    zlibbioc_1.18.0  reshape2_1.4.1   XVector_0.12.0   splines_3.3.0   
[13] tools_3.3.0      stringr_1.0.0    munsell_0.4.3    colorspace_1.2-6
genomicranges • 836 views
ADD COMMENT
0
Entering edit mode

Hi Dana,

All the problems you're seeing come from the fact that you're using a data.frame instead of a GRanges object. This is why base::intersect() is being called instead of the intersect method for GRanges objects. Not sure which part of the help/vignette exactly made you think that data.frames were an acceptable object to use. If you could be more precise, we could try to improve our documentation.

Thanks,

H.

ADD REPLY
0
Entering edit mode
@martin-morgan-1513
Last seen 10 weeks ago
United States

Try casting your data.frame to a GRanges, e.g., using makeGRangesFromDataFrame().

ADD COMMENT

Login before adding your answer.

Traffic: 626 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6