library("RAPIDR")
makeBinnedCountsFile(c("nfamele1_sorted.bam","nfamele2_sorted.bam","nMALE1_sorted.bam","nMALE2_sorted.bam","T-SRR611848_1_sorted.bam"),c("nfamele1","nfamele2","nMALE1","nMALE2","T-SRR611848"),"binnedcounts.r",mask=NULL,k=20000)
I am getting the following error in a script that was working a month before
Error in unloadNamespace(package) :
namespace ‘GenomicRanges’ is imported by ‘RAPIDR’, ‘GenomicAlignments’, ‘Rsamtools’ so cannot be unloaded
Error in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc, :
Package ‘GenomicRanges’ version 1.20.8 cannot be unloaded

This seems like a weird one, in addition to what Herve asks for, you can try to start R in "vanilla" mode, ie. from the terminal launch R via a call like so:
Perhaps there's some issue with R starting up and loading a previously saved workspace (is there an
.RDatafile in the working directory you launch R from (or your home directory(?)). Launching with--vanillawill run R without loading some of these things.Ok, I'm sorry. I will write to RAPIDR authors, anyway i do not understand why GenomicRanges changes so much, when i write a program i expect some estability with libraries. This kind of bug is not reported for the first time in Rapidr. My last update of the genomic ranges library was las 19/10, so a week ago
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.3 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=hr_HR.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=hr_HR.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=hr_HR.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=hr_HR.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RAPIDR_0.1.1
loaded via a namespace (and not attached):
[1] IRanges_2.2.9 Rsamtools_1.20.4 Biostrings_2.36.4
[4] bitops_1.0-6 GenomicAlignments_1.4.1 chron_2.3-47
[7] GenomeInfoDb_1.4.3 futile.options_1.0.0 stats4_3.2.2
[10] zlibbioc_1.14.0 XVector_0.8.0 data.table_1.9.6
[13] S4Vectors_0.6.6 futile.logger_1.4.1 BiocParallel_1.2.21
[16] lambda.r_1.1.7 PropCIs_0.2-5 parallel_3.2.2
[19] BiocGenerics_0.14.0 GenomicRanges_1.20.8
Are you sure this happens only with the latest GenomicRanges? Btw, the RAPIDR package has some serious issues. From just a short glance at the code,
makeBinnedCountsFile()is obviously broken (the line to write out the masked counts is commented out for some reason). Deeper in the code, it callslibrary()to load a BSgenome package, when it should really be usingrequireNamespace()(probably related to this bug). It then reads a BED file usingread.tableand forgets to add 1 to the start positions. And the list goes on.A likely cause of this error is that R is attempting to attach a package namespace that has already been loaded from a different version of the package. In such cases, it will attempt to unload the old namespace.
You're using BioC 3.1 which is not supported anymore: the latest release is BioC 3.2 which was released 2 weeks ago. Please update at your earliest convenience. Because BioC 3.2 uses the same version of R as BioC 3.1, updating is as easy as running:
source("http://bioconductor.org/biocLite.R") biocLite("BiocUpgrade")Note that CRAN packages that depend on BioC packages are at the risk to break when we release a new version of BioC. We have no control on these packages (in particular we didn't have an opportunity to build/check them against the new release) so there is nothing we can do about it. This is why having CRAN packages that depend on BioC packages is fundamentally a broken model but that's another story.
H.
Thanks you Herve, I will proceed as you suggest