rcastelo / GSVA

Gene set variation analysis
198 stars 40 forks source link

How to Set the 'zscore' Method in Recent Versions of GSVA Analysis? #185

Closed Li-mengjie closed 1 month ago

Li-mengjie commented 1 month ago

Hello, in the older version of the GSVA analysis, I used the command score <- gsva(expr, m_df, method="zscore", parallel.sz=150) to perform the calculation. However, in the recent versions, despite my efforts to learn, I still don't know how to set the method to "zscore" because this method analyzes very quickly. Can you help me solve this problem? Thank you!

axelklenk commented 1 month ago

Hi Li-mengjie,

thanks for using GSVA!

In previous versions of GSVA any value of argument method could be combined with any other argument settings which has sometimes caused confusion. Therefore, recent versions of GSVA employ an object-oriented approach where so-called parameter objects avoid this kind of problems. In your case, for running the z-score method, you would first create a zscore parameter object:

zpar <- zscoreParam(expr, m_df)

In addition, previously there were two methods to control parallel execution and in recent versions argument parallel.sz has been dropped in favor of Bioconductor's BiocParallel approach. Most probably you want to use parallel executon on multiple cores via a MulticoreParam object (see https://bioconductor.org/packages/release/bioc/html/BiocParallel.html for more details).

Parallel execution is not a parameter to a particular analysis method and hence not part of the parameter object. In order to run your z-score analysis in parallel, you would then use:

score <- gsva(zpar, BPPARAM=MulticoreParam(150))

Please let me know if this solves your problem or not and don't hesitate to get back to us if you have more questions.

Li-mengjie commented 1 month ago

Thank you very much for your patient explanation.