Question: Bug in vsn2 in package vsn?
gravatar for Peter Langfelder
2.8 years ago by
United States
Peter Langfelder2.3k wrote:

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
> 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)

 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=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 • 508 views
ADD COMMENTlink modified 2.8 years ago by Wolfgang Huber13k • written 2.8 years ago by Peter Langfelder2.3k
Answer: Bug in vsn2 in package vsn?
gravatar for Wolfgang Huber
2.8 years ago by
EMBL European Molecular Biology Laboratory
Wolfgang Huber13k wrote:

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



ADD COMMENTlink modified 2.8 years ago • written 2.8 years ago by Wolfgang Huber13k

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

ADD REPLYlink written 2.8 years ago by Peter Langfelder2.3k
Please log in to add an answer.


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