Bug in vsn2 in package vsn?
1
1
Entering edit mode
@peter-langfelder-4469
Last seen 4 weeks ago
United States

Unless I'm missing something, there seems to be a bug in the variance stabilization function vsn2 or the predict method for the vsn object when calib="none". Below is a self-contained example with random data. Thanks!

>#Simulate data
>library(vsn);
> nGenes = 1000;
> nSamples = 100;
> data = exp(matrix(rnorm(nGenes * nSamples), nGenes, nSamples) + log(1:nGenes));
### Run vsn2 with default arguments: no problems
> fit = vsn2(data)
vsn2: 1000 x 100 matrix (1 stratum). Please use 'meanSdPlot' to verify the fit.
> vsdata = predict(fit, newdata = data);

### Run vsn2 without calibration
> fit2 = vsn2(data, calib = "none")
vsn2: 1000 x 100 matrix (1 stratum). Please use 'meanSdPlot' to verify the fit.
> vsdata2 = predict(fit2, newdata = data);
Error in vsn2trsf(newdata, object@coefficients, strata, hoffset = if (log2scale) object@hoffset else NULL) :
  'p' has wrong dimensions.

 

> sessionInfo()
R version 3.3.1 Patched (2016-07-30 r71015)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Fedora 24 (Twenty Four)

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] parallel  stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
[1] vsn_3.42.3          Biobase_2.32.0      BiocGenerics_0.18.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.6           lattice_0.20-33       grid_3.3.1           
 [4] plyr_1.8.4            gtable_0.2.0          affy_1.50.0          
 [7] scales_0.4.0          ggplot2_2.1.0         BiocInstaller_1.22.3
[10] zlibbioc_1.18.0       affyio_1.42.0         limma_3.28.17        
[13] preprocessCore_1.34.0 munsell_0.4.3         colorspace_1.2-6     


 

vsn vsn2 • 1.2k views
ADD COMMENT
0
Entering edit mode
@wolfgang-huber-3550
Last seen 19 days ago
EMBL European Molecular Biology Laborat…

Dear Peter

Thank you for pointing this out and the clear bug report. This should be fixed in the devel branch in vsn >= 3.43.9, which is in the subversion repository now and should be online in a couple of days.

As the vsn2 function's manual page says, the calib="none" option is an experimental feature, and even though it was entered more than eight years ago, I am not sure it was ever properly tested, and certainly I have not had my mind on it for a while. The bug that you observed (and that I now fixed) is that this option was not passed down to a helper function within the package. In any case, I would be interested in your mileage with this functionality and any feedback you may have.

Kind regards

Wolfgang

 

ADD COMMENT
0
Entering edit mode

Thanks - I will report whatever nuggets of wisdom I can find...

ADD REPLY

Login before adding your answer.

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