Hi
I am using edgeR in an R package and as per suggested by the R programming conventions I have edgeR as a dependent package in my DESCRIPTION file and access all necessary functions using '::' without explicitly importing the package.
I noticed that at least one function (in this case cpm()) performs differently for the edgeR::cpm() and the explicity imported library(edgeR) followed by cpm(). For example,.....
> counts <- matrix(runif(100),nrow=10)
> edgeR::cpm(counts)
Error in UseMethod("cpm") :
no applicable method for 'cpm' applied to an object of class "c('matrix', 'double', 'numeric')"
> library(edgeR)
Loading required package: limma
> head(cpm(counts))
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 114169.46 175834.67 51510.14 5363.237 16401.74 20479.495 145975.39
[2,] 17889.77 205688.98 48416.19 173692.384 76566.96 105343.698 117467.74
[3,] 87684.26 40121.46 77551.01 10736.874 30670.39 158437.246 79489.89
[4,] 132548.07 64048.08 209063.65 155286.875 56091.63 95910.305 160060.34
[5,] 137226.54 132122.98 41612.64 35344.474 178261.47 144418.546 116470.77
[6,] 85941.99 17211.45 89683.65 68780.111 102690.63 5998.291 20945.59
[,8] [,9] [,10]
[1,] 67399.30 131078.05 21695.84
[2,] 87848.82 154380.04 143763.65
[3,] 70340.30 132632.08 70341.64
[4,] 175579.99 109640.29 156180.73
[5,] 22645.61 78318.51 154752.79
[6,] 188434.65 122780.09 133685.27
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] 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
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] edgeR_3.12.0 limma_3.26.9 BiocInstaller_1.20.1
loaded via a namespace (and not attached):
[1] tools_3.2.2
Is this expected behavior or a quirk in edgeR?
Thanks,
Bharath
Thanks for your clarification.