bug in "dispersion" argument in edgeR - rpkmByGroup
1
0
Entering edit mode
@darioberaldi-6991
Last seen 2.1 years ago
United Kingdom

Hi- Trying to run the rpkmByGroup function from edgeR, I get the error below.

 rpkmByGroup(y, gene.length= rep(1000, nrow(y)))
Error in cpmByGroup.default(y = y, group = group, dispersion = dispersion,  : 
  formal argument "dispersion" matched by multiple actual arguments

I think it is because rpkmByGroup.default runs cpmByGroup with the dispersion argument specified twice:

rpkmByGroup.default
function (y, group = NULL, gene.length, dispersion = 0.05, offset = NULL, 
    weights = NULL, log = FALSE, prior.count = 2, ...) 
{
    if (is.null(group)) {
        group <- factor(rep_len(1, ncol(y)))
        levels(group) <- "AveRPKM"
    }
    z <- cpmByGroup(y = y, group = group, dispersion = dispersion, 
        dispersion = dispersion, offset = offset, weights = weights, 
        log = log, prior.count = prior.count, ...)
    if (log) {
        z - log2(gene.length/1000)
    }
    else {
        z/(gene.length/1000)
    }
}

Am I missing something or is this a bug? If the latter, I wonder if rpkmByGroup has been used at all and if it is recommendable to use.

Thanks!

sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS: /export/projects/III-data/wcmp_bioinformatics/db291g/miniconda3/envs/20190619_brett_ko_PB0312700/lib/R/lib/libRblas.so
LAPACK: /export/projects/III-data/wcmp_bioinformatics/db291g/miniconda3/envs/20190619_brett_ko_PB0312700/lib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8    LC_PAPER=en_GB.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] ggplot2_3.1.0     edgeR_3.26.0      limma_3.40.0      data.table_1.12.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1       magrittr_1.5     splines_3.5.1    tidyselect_0.2.5 munsell_0.5.0    colorspace_1.4-1 lattice_0.20-38  R6_2.4.0         rlang_0.3.4      plyr_1.8.4       dplyr_0.8.1      tools_3.5.1      grid_3.5.1       gtable_0.3.0     withr_2.1.2     
[16] lazyeval_0.2.2   assertthat_0.2.1 tibble_2.1.3     crayon_1.3.4     purrr_0.3.2      glue_1.3.1       compiler_3.5.1   pillar_1.4.1     scales_1.0.0     locfit_1.5-9.1   pkgconfig_2.0.2
edger rpkm • 1.7k views
ADD COMMENT
1
Entering edit mode
@gordon-smyth
Last seen 1 hour ago
WEHI, Melbourne, Australia

Yes, that is a bug, which was introduced to edgeR in the last Bioconductor release. I have fixed it now in edgeR 3.26.5. Thanks for the heads-up.

It is curious that you are running versions of limma and edgeR from the Bioconductor 3.9 release under R 3.5.1. Bioconductor 3.9 is designed for R 3.6.0, and you won't be able to install the current versions of limma or edgeR unless you do run 3.6.0.

ADD COMMENT
0
Entering edit mode

Hi Gordon- Thanks for quick reply, as always! About versions, I installed edgeR via conda/bioconda using conda install bioconductor-edger=3.26.0. It appears that the bioconda recipe for version 3.26.0 (here) requires limma >=3.40.0,<3.41.0.

ADD REPLY
0
Entering edit mode

I am able to reproduce this error using conda create --name edgeRenv bioconductor-edger.

It seems that Bioconda uses R from conda-forge (right now it uses R-3.5.1), and they are waiting for R-3.6.1 to be released before updating to that. This seems to be caused by the way Bioconda maintainers design their system.They do not add R-3.6.0 to their distribution, they wait for R-3.6.1.

Please try to install R 3.6.0 and install edgeR.

ADD REPLY
0
Entering edit mode

If you are able to use docker, and not worry about system dependencies,

In a Dockerfile

FROM bioconductor/bioconductor_full:RELEASE_3_9

RUN R -e "BiocManager::install('edgeR')

Then build,

docker build -t bioc-edgeR:latest -f <path>/Dockerfile

Use

docker run -it bioc-edgeR:latest R
ADD REPLY
0
Entering edit mode

The combination of R and limma versions you have will not run correcly, as has been noted here: https://stat.ethz.ch/pipermail/bioc-devel/2019-June/015240.html

You could either install R 3.6.0, or else down-grade limma and edgeR to Bioconductor 3.8 versions designed for R 3.5.X. In either case, everything would work correctly, including rpkmByGroup.

I explictly declared limma's dependence on R 3.6.0 in version 3.40.1 but not in 3.40.0.

ADD REPLY

Login before adding your answer.

Traffic: 529 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