UMCUGenetics/MutationalPatterns

Compatibility for R 3.2.3

dyndna opened this issue · 6 comments

Very useful package!

Wonder if package can be made compatible with R 3.2.3?

Thanks

roelj commented

Thank you for your request. I'm setting up the environment to test it with R 3.2.3 for you. May I ask what distribution you're using (assuming you're using GNU/Linux)?

If you really can't wait, you can modify the required R version in DESCRIPTION, and use the devtools package to load it using:

$ cd /path/to/the/modified/MutationalPatterns/
$ R
> library(devtools)
> load_all()

If you're in luck, it will "just work". Otherwise, we will need to figure out another way.

Our cluster runs on RHEL 6, Linux 2.6.32-431.23.3.el6.x86_64

I tried changing DESCRIPTION to tweak version numbers but seems like warnings goes deep into several R packages and fear if this may change behavior of certain functions in MutationalPatterns package.

Unless it require R 3.3, would be nice to have backward compatibility with R 3.2 else no worry as we have R 3.3 environment under anaconda python.

R
library(devtools)
load_all()
Loading MutationalPatterns
Loading required package: GenomicRanges
Loading required package: S4Vectors
Loading required package: stats4
Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: NMF
Loading required package: pkgmaker
Loading required package: registry

Attaching package: ‘pkgmaker’

The following object is masked from ‘package:S4Vectors’:

    new2

The following object is masked from ‘package:base’:

    isNamespaceLoaded

Loading required package: rngtools
Loading required package: cluster
NMF - BioConductor layer [OK] | Shared memory capabilities [NO: bigmemory] | Cores 15/16
  To enable shared memory capabilities, try: install.extras('
NMF
')

Attaching package: ‘NMF’

The following object is masked from ‘package:GenomicRanges’:

    compare

The following object is masked from ‘package:IRanges’:

    compare

The following objects are masked from ‘package:S4Vectors’:

    compare, nrun

There were 23 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: In (function (dep_name, dep_ver = NA, dep_compare = NA)  ... :
  Need GenomicRanges >= 1.24.0 but loaded version is 1.22.4
2: replacing previous import by ‘ggplot2::unit’ when loading ‘NMF’
3: replacing previous import by ‘ggplot2::arrow’ when loading ‘NMF’
4: In (function (dep_name, dep_ver = NA, dep_compare = NA)  ... :
  Need BiocGenerics >= 0.18.0 but loaded version is 0.16.1
5: In (function (dep_name, dep_ver = NA, dep_compare = NA)  ... :
  Need VariantAnnotation >= 1.18.1 but loaded version is 1.16.4
6: In (function (dep_name, dep_ver = NA, dep_compare = NA)  ... :
  Need SummarizedExperiment >= 1.2.2 but loaded version is 1.0.2
7: In (function (dep_name, dep_ver = NA, dep_compare = NA)  ... :
  Need IRanges >= 2.6.0 but loaded version is 2.4.8
8: In (function (dep_name, dep_ver = NA, dep_compare = NA)  ... :
  Need GenomeInfoDb >= 1.8.1 but loaded version is 1.6.3
9: In (function (dep_name, dep_ver = NA, dep_compare = NA)  ... :
  Need Biostrings >= 2.40.0 but loaded version is 2.38.4
10: In loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
  namespace ‘BiocGenerics’ 0.16.1 is already loaded, but >= 0.18.0 is required
11: In loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
  namespace ‘IRanges’ 2.4.8 is already loaded, but >= 2.6.0 is required
12: In loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),  ... :
  namespace ‘BiocGenerics’ 0.16.1 is already loaded, but >= 0.18.0 is required
13: In loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),  ... :
  namespace ‘BiocGenerics’ 0.16.1 is already loaded, but >= 0.18.0 is required
14: In loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),  ... :
  namespace ‘BiocGenerics’ 0.16.1 is already loaded, but >= 0.18.0 is required
15: In loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),  ... :
  namespace ‘Biostrings’ 2.38.4 is already loaded, but >= 2.40.0 is required
16: In loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),  ... :
  namespace ‘GenomeInfoDb’ 1.6.3 is already loaded, but >= 1.8.1 is required
17: In loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),  ... :
  namespace ‘GenomeInfoDb’ 1.6.3 is already loaded, but >= 1.8.1 is required
18: In loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),  ... :
  namespace ‘GenomeInfoDb’ 1.6.3 is already loaded, but >= 1.8.1 is required
19: In loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),  ... :
  namespace ‘GenomeInfoDb’ 1.6.3 is already loaded, but >= 1.8.1 is required
20: In loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),  ... :
  namespace ‘GenomeInfoDb’ 1.6.3 is already loaded, but >= 1.8.1 is required
21: In loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),  ... :
  namespace ‘GenomeInfoDb’ 1.6.3 is already loaded, but >= 1.8.1 is required
22: In loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),  ... :
  namespace ‘SummarizedExperiment’ 1.0.2 is already loaded, but >= 1.2.2 is required
23: In loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),  ... :
  namespace ‘VariantAnnotation’ 1.16.4 is already loaded, but >= 1.18.1 is required
> 

roelj commented

Right. I understand the complexity of running multiple software environments on a single cluster.

So, the warnings make sense. You could lower the version requirements of the dependencies specified in the DESCRIPTION file. But, like you already said, I am unsure whether we use any functions that have changed, or simply weren't there in these older versions. So this requires more testing.

In the meanwhile, I do have a better solution for dependency management/package management than anaconda which leads to a more reliable and reproducible solution: GNU Guix. I am happy to discuss that. You can find my e-mail address in the Git commit history.

Roel -- thanks so much for making this code available. Samir -- thanks for starting this thread. We could also use R 3.2 compatibility, and to test this I made a bioconda (https://bioconda.github.io/) package with the 3.2 level bioconductor dependencies, swapping out the requirements in DESCRIPTION as needed. You can install for testing with:

conda install -c bioconda r-mutationalpatterns

We'll definitely report back if we find any issues as we test this. Thanks again.

Thanks @chapmanb and I have just used your bioconda recipe to install MutationalPatterns in my R 3.2.3 env. I had to add sed -i.bak 's/BiocGenerics (>= 0.18.0)/BiocGenerics (>= 0.16.1)/' DESCRIPTION to your https://github.com/bioconda/bioconda-recipes/blob/master/recipes/r-mutationalpatterns/build.sh

I was able to install it without errors. However, I have not yet tested any function. @roelj : See if you can go through build logs, https://github.com/dyndna/MutationalPatterns/tree/v0.2-beta_R3.2/build_logs and find any red flag which may be incompatible with one or more functions of MutationalPatterns, tag: v0.2-beta

roelj commented

Thanks @dyndna for preparing a patch. Unfortunately, this patch clutters the repository for supporting Bioconda's package management solution. In the build log output, we find some new warnings related to overlapping functions between packages:

Warning messages:
1: replacing previous import by ‘ggplot2::unit’ when loading ‘NMF’ 
2: replacing previous import by ‘ggplot2::arrow’ when loading ‘NMF’

So, there is a side-effect of lowering the dependency versions. So, it still needs more testing.

In the meantime, I updated the package recipe for GNU Guix in our GNU Guix package repository. So that's another option from which you can deploy most R packages in a verifiable reproducible way.

Thanks for your work.