satijalab/seurat-wrappers

RunPresto fails because of mean.fxn not found

mihem opened this issue · 3 comments

mihem commented

RunPresto ist still my favorite way to quickly identify markers. Unfortunately, since the last Seurat update to 4.2 RunPresto fails.

SeuratWrappers::RunPresto(seurat_object, ident.1 = "1", assay = "RNA")

fails with

Error in mean.fxn(object[features, cells.1, drop = FALSE]) : could not find function "mean.fxn"

sessionInfo R version 4.2.1 (2022-06-23) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 22.04.1 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

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] SeuratWrappers_0.3.0 sp_1.5-0 SeuratObject_4.1.2
[4] Seurat_4.2.0

loaded via a namespace (and not attached):
[1] Rtsne_0.16 colorspace_2.0-3 deldir_1.0-6
[4] ellipsis_0.3.2 ggridges_0.5.4 spatstat.data_2.2-0
[7] leiden_0.4.3 listenv_0.8.0 remotes_2.4.2
[10] ggrepel_0.9.1 fansi_1.0.3 codetools_0.2-18
[13] splines_4.2.1 R.methodsS3_1.8.2 polyclip_1.10-0
[16] jsonlite_1.8.2 ica_1.0-3 cluster_2.1.4
[19] png_0.1-7 R.oo_1.25.0 rgeos_0.5-9
[22] uwot_0.1.14 shiny_1.7.2 sctransform_0.3.5
[25] spatstat.sparse_2.1-1 BiocManager_1.30.18 compiler_4.2.1
[28] httr_1.4.4 assertthat_0.2.1 Matrix_1.5-1
[31] fastmap_1.1.0 lazyeval_0.2.2 cli_3.4.1
[34] later_1.3.0 htmltools_0.5.3 tools_4.2.1
[37] rsvd_1.0.5 igraph_1.3.5 gtable_0.3.1
[40] glue_1.6.2 RANN_2.6.1 reshape2_1.4.4
[43] dplyr_1.0.10 Rcpp_1.0.9 scattermore_0.8
[46] presto_1.0.0 vctrs_0.4.2 nlme_3.1-160
[49] progressr_0.11.0 lmtest_0.9-40 spatstat.random_2.2-0
[52] stringr_1.4.1 globals_0.16.1 mime_0.12
[55] miniUI_0.1.1.1 lifecycle_1.0.3 irlba_2.3.5.1
[58] goftest_1.2-3 future_1.28.0 MASS_7.3-58.1
[61] zoo_1.8-11 scales_1.2.1 spatstat.core_2.4-4
[64] promises_1.2.0.1 spatstat.utils_2.3-1 parallel_4.2.1
[67] RColorBrewer_1.1-3 qs_0.25.4 reticulate_1.26
[70] pbapply_1.5-0 gridExtra_2.3 ggplot2_3.3.6
[73] rpart_4.1.16 stringi_1.7.8 rlang_1.0.6
[76] pkgconfig_2.0.3 matrixStats_0.62.0 lattice_0.20-45
[79] ROCR_1.0-11 purrr_0.3.5 tensor_1.5
[82] patchwork_1.1.2 htmlwidgets_1.5.4 cowplot_1.1.1
[85] tidyselect_1.2.0 parallelly_1.32.1 RcppAnnoy_0.0.19
[88] plyr_1.8.7 magrittr_2.0.3 R6_2.5.1
[91] generics_0.1.3 DBI_1.1.3 pillar_1.8.1
[94] mgcv_1.8-40 fitdistrplus_1.1-8 survival_3.4-0
[97] abind_1.4-5 tibble_3.1.8 future.apply_1.9.1
[100] KernSmooth_2.23-20 utf8_1.2.2 RApiSerialize_0.1.2
[103] spatstat.geom_2.4-0 plotly_4.10.0 grid_4.2.1
[106] data.table_1.14.4 digest_0.6.30 xtable_1.8-4
[109] tidyr_1.2.1 httpuv_1.6.6 R.utils_2.12.0
[112] RcppParallel_5.1.5 stringfish_0.15.7 munsell_0.5.0
[115] viridisLite_0.4.1

Downgrading Seurat to 4.1.1 via

packageurl <- "https://cran.r-project.org/src/contrib/Archive/Seurat/Seurat_4.1.1.tar.gz" install.packages(packageurl, repos=NULL, type="source")

solves the problem.

More specific, I think this is because of these changes by @mojaveazure satijalab/seurat@71193c0.

Can anyone help here?
@jaisonj708 maybe?

Thanks a lot!
Mischko

mihem commented

The same problem was reported shortly after this issue also in the Seurat repo
satijalab/seurat#6587

should be fixed now in the latest version of SeuratWrappers

mihem commented

Thanks for the fast fix.
I can confirm: works as expected and produced the same results as FindMarkers with wilcox test, just waaay faster.
However the original function presto::wilcoxauc produces different results (and is again substantially faster than RunPresto).
@AustinHartman Could you comment on that? Is this related to geometric mean vs arithmetic mean as suggested here satijalab/seurat#5542 ? What is the best practice advice?

Thanks,
Mischko