Closed zyb1984 closed 1 year ago
Thanks for using scITD.
I just retested the walkthrough and it still seems to be working. Can you confirm if you're running it with the example data or your own dataset and whether you're using the Github version or the CRAN version of the package?
The reshape_loadings() function can be found in the plot_tucker.R file. This function is internal (not exported), but should be accessible to the other functions in the package, so I wonder if this has to do with how you installed/load the package.
Thanks for your reply I ran the Walkthrough with the example data, and I had solved this problem. This error message was caused by some NA value in the results of "get transformed expression for each gene by summing d_score * scaled exp", and I fixed the function of run_fgsea with add "exp_vals <- exp_vals [is.finite(exp_vals)] "
Seconding that I also had to use the fix of @zyb1984 the be able to run the example walkthrough. I tried both the CRAN and GitHub version and both needed the fix. My sessionInfo()
:
R version 4.3.1 (2023-06-16)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Stream 8
Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblaso-r0.3.15.so; LAPACK version 3.9.0
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] scITD_1.0.3 Matrix_1.6-1
loaded via a namespace (and not attached):
[1] tidyselect_1.2.0 dplyr_1.1.2 fastmap_1.1.0 digest_0.6.29 lifecycle_1.0.3 cluster_2.1.4 ellipsis_0.3.2 Cairo_1.6-0 processx_3.5.2 magrittr_2.0.2
[11] compiler_4.3.1 rlang_1.1.1 tools_4.3.1 utf8_1.2.2 data.table_1.14.2 prettyunits_1.1.1 pkgbuild_1.3.1 curl_4.3.2 plyr_1.8.6 RColorBrewer_1.1-2
[21] BiocParallel_1.34.2 pkgload_1.2.4 babelgene_22.9 withr_2.5.0 purrr_1.0.2 BiocGenerics_0.46.0 desc_1.4.2 grid_4.3.1 stats4_4.3.1 fansi_1.0.2
[31] colorspace_2.0-2 edgeR_3.42.4 ggplot2_3.4.3 scales_1.2.1 iterators_1.0.14 cli_3.6.1 crayon_1.5.0 generics_0.1.2 remotes_2.4.2 rstudioapi_0.13
[41] ica_1.0-2 reshape2_1.4.4 rjson_0.2.21 sessioninfo_1.2.2 cachem_1.0.6 stringr_1.5.0 splines_4.3.1 parallel_4.3.1 msigdbr_7.5.1 matrixStats_1.0.0
[51] vctrs_0.6.3 devtools_2.4.3 callr_3.7.0 IRanges_2.34.1 GetoptLong_1.0.5 S4Vectors_0.38.1 clue_0.3-64 Rmisc_1.5.1 magick_2.7.5 testthat_3.1.2
[61] locfit_1.5-9.8 foreach_1.5.2 limma_3.56.2 glue_1.6.2 codetools_0.2-19 ps_1.6.0 cowplot_1.1.1 stringi_1.7.6 shape_1.4.6 gtable_0.3.0
[71] rTensor_1.4.8 ComplexHeatmap_2.16.0 munsell_0.5.0 tibble_3.2.1 pillar_1.9.0 brio_1.1.3 fgsea_1.26.0 circlize_0.4.15 R6_2.5.1 doParallel_1.0.17
[81] rprojroot_2.0.2 lattice_0.21-8 png_0.1-7 memoise_2.0.1 fastmatch_1.1-3 Rcpp_1.0.11 nlme_3.1-162 mgcv_1.8-42 fs_1.5.2 usethis_2.2.2
[91] pkgconfig_2.0.3 GlobalOptions_0.1.2
Thank you for pointing this out! I was using an older version of fgsea that does not error when there are some NaN values included. The NaN genes you remove with exp_vals <- exp_vals [is.finite(exp_vals)]
are simply ones that had 0 expression in all donors, as the scale()
function gives NaN when there is zero variance. Therefore, this correction is totally fine to do and I'll go ahead and update this in the package asap.
When I tried to follow the Walkthrough “http://pklab.med.harvard.edu/jonathan/ ” , an errow reported with “run_gsea_one_factor” function, and error message with “Error in preparePathwaysAndStats(pathways, stats, minSize, maxSize, gseaParam, : Not all stats values are finite numbers” Then I tried to check the original code of “run_gsea_one_factor” function, but when the enrichment method arguments were set with "fgsea", all was ok, But when the enrichment method arguments were set with "hypergeometric", an error message had reported, and with “Error in reshape_loadings(sr_col, genes, ctypes) : with no"reshape_loadings" function”. So, I tried to check the "reshape_loadings" function, I found no information with this "reshape_loadings" function, Could you help me with some information or suggestion about the "reshape_loadings" function? With session info() R version 4.2.2 (2022-10-31 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19044) attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] scITD_1.0.2 Matrix_1.5-3 And the scITD package was installed through CRAN.