Question: bug in "dispersion" argument in edgeR - rpkmByGroup
0
gravatar for dario.beraldi
4 months ago by
United Kingdom
dario.beraldi0 wrote:

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 • 169 views
ADD COMMENTlink modified 4 months ago by rosehahn85830 • written 4 months ago by dario.beraldi0
Answer: bug in "dispersion" argument in edgeR - rpkmByGroup
1
gravatar for Gordon Smyth
4 months ago by
Gordon Smyth38k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth38k wrote:

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 COMMENTlink modified 4 months ago • written 4 months ago by Gordon Smyth38k

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 REPLYlink written 4 months ago by dario.beraldi0

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 REPLYlink written 4 months ago by nitesh.turaga140

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 REPLYlink written 4 months ago by nitesh.turaga140

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 REPLYlink modified 4 months ago • written 4 months ago by Gordon Smyth38k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 178 users visited in the last hour