I have had the same poblem (now twice) as mentioned in this post (from 2013, by someone else)
http://bioc-devel.r-project.narkive.com/9nMVTTgy/error-installing-genomicranges
** preparing package for lazy loading Error in fmls[[***@signature]] <- quote(rowData(x)) : object of type 'symbol' is not subsettable Error : unable to load R code in package 'GenomicRanges'
Seems that there was a new release GenomicRanges, 1.22.0. of GenomicRanges, and I was not able to install it on top of 1.20. Same error as above.
I was able to "resolve" this by removing the call for generic function "duplicated". Actually I removed a string "duplicated" from a loop in... :
GenomicRanges/R/SummarizedExperiment-rowData-methods.R
SummarizedExperiment/R/RangedSummarizedExperiment-class.R
Specifically, I removed it from here [in c(...)] in RangedSummarizedExperiment-class.R
:
## Single dispatch, generic signature fun(x, ...)
local({
.funs <-
c("duplicated", "end", "end<-", "ranges", "seqinfo", "seqnames",
"start", "start<-", "strand", "width", "width<-")
GenomicRanges/R/SummarizedExperiment-rowData-methods.R
contains a similar block of code, and I removed duplicated from the c() Vector as well.
For no apparent reason, R interprets a call to "duplicated()" as a symbol and not as a function. No Idea why this is so; and don't know which "duplicated" causes the bug at installation time.
showMethods("duplicated")
now gives this result on my problematic computer:
x="ANY" x="CompressedIntegerList" x="CompressedList" x="DataTable" x="Dups" x="GenomicRanges" x="List" x="Rle" x="Vector" x="XRawList"
and on a computer where SummarizedExperiment 1.0.0 and is depedecy GenomicRanges 1.22 can be properly installed,
showMethods("duplicated")
now gives this result:
x="ANY" x="CompressedIntegerList" x="CompressedList" x="DataTable" x="Dups" x="GenomicRanges" x="List" x="RangedSummarizedExperiment" x="Rle" x="SummarizedExperiment" x="Vector" x="XRawList"
How can I really resolve the issue? What might be wrong with duplicated()?. My R was installed from source
R version 3.2.2 (2015-08-14) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 15.04 locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats4 parallel stats graphics grDevices utils datasets methods base other attached packages: [1] airway_0.104.0 SummarizedExperiment_1.0.0 Biobase_2.30.0 GenomicRanges_1.22.0 [5] GenomeInfoDb_1.6.0 IRanges_2.4.0 S4Vectors_0.8.0 BiocGenerics_0.16.0 [9] BiocInstaller_1.20.0 colorout_1.1-1 loaded via a namespace (and not attached): [1] coin_1.1-0 lattice_0.20-33 codetools_0.2-14 mvtnorm_1.0-3 zoo_1.7-12 grid_3.2.2 [7] zlibbioc_1.16.0 XVector_0.10.0 multcomp_1.4-1 party_1.0-23 strucchange_1.5-1 sandwich_2.3-4 [13] splines_3.2.2 TH.data_1.0-6 survival_2.38-3 modeltools_0.2-21
Built the tar,gz file and installed with R CMD INSTALL
source("http://www.bioconductor.org/biocLite.R") Bioconductor version 3.2 (BiocInstaller 1.20.0), ?biocLite for help > biocValid() [1] TRUE
While your changes to the package code might have allowed it to be installed, it is not the source of the problem. I'd suggest that you remove your patched version
remove.packages("GenomicRanges")
then start a new R session from the command line and using the --vanilla option, so that no additional packages are loaded and no other software is getting in the way. It would then be helpful to report exactly what happens, so for meI tried R --vanilla as local user, I tried it as root, I removed GenomicRanges subdirectory, tried both again. I experimented with setting .libPaths(). I removed all R installations in /usr/{lib,bin...} and now use /usr/local and a personal library in my /home directory.
The error did never go away, whatever I did.
But can you please do as I asked and demonstrated, and report the transcript of the session? And please use remove.packages("GenomicRanges"), repeating as necessary until told that there is no package to remove. And for good measure report the output of traceback() and sessionInfo() after the error.
added below