saezlab / decoupleR

R package to infer biological activities from omics data using a collection of methods.
https://saezlab.github.io/decoupleR/
GNU General Public License v3.0
190 stars 24 forks source link

Error in `convert_f_defaults()`: #79

Closed hemantgujar closed 1 year ago

hemantgujar commented 1 year ago

Hi

I was following the tutorial from here - https://saezlab.github.io/decoupleR/articles/tf_sc.html However, I got stuck with this error and don't know how to fix this. Can someone please help.

acts <- run_wmean(mat = mat, net=net, .source = 'source', .target = 'target', .mor = 'mor', times = 100, minsize = 5)

Error in `convert_f_defaults()`:
! Can't rename columns that don't exist.
✖ Column `source` doesn't exist.
Run `rlang::last_trace()` to see where the error occurred.

sessionInfo()

R version 4.2.3 (2023-03-15 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] OmnipathR_3.6.0 ggrepel_0.9.3 SeuratDisk_0.0.0.9020 pheatmap_1.0.12
[5] ggplot2_3.4.2 patchwork_1.1.2 tidyr_1.3.0 tibble_3.2.1
[9] dplyr_1.1.1 decoupleR_2.4.0 SeuratObject_4.1.3 Seurat_4.3.0

loaded via a namespace (and not attached): [1] readxl_1.4.2 backports_1.4.1 plyr_1.8.8 igraph_1.4.2
[5] lazyeval_0.2.2 sp_1.6-0 splines_4.2.3 listenv_0.9.0
[9] scattermore_0.8 digest_0.6.31 dorothea_1.10.0 htmltools_0.5.5
[13] fansi_1.0.4 magrittr_2.0.3 checkmate_2.1.0 tensor_1.5
[17] cluster_2.1.4 ROCR_1.0-11 tzdb_0.3.0 limma_3.54.2
[21] globals_0.16.2 readr_2.1.4 matrixStats_0.63.0 vroom_1.6.1
[25] spatstat.sparse_3.0-1 prettyunits_1.1.1 colorspace_2.1-0 rvest_1.0.3
[29] rappdirs_0.3.3 xfun_0.38 crayon_1.5.2 jsonlite_1.8.4
[33] progressr_0.13.0 spatstat.data_3.0-1 survival_3.5-3 zoo_1.8-12
[37] glue_1.6.2 polyclip_1.10-4 gtable_0.3.3 leiden_0.4.3
[41] future.apply_1.10.0 abind_1.4-5 scales_1.2.1 spatstat.random_3.1-4 [45] miniUI_0.1.1.1 Rcpp_1.0.10 viridisLite_0.4.1 xtable_1.8-4
[49] progress_1.2.2 reticulate_1.28 bit_4.0.5 htmlwidgets_1.6.2
[53] httr_1.4.5 RColorBrewer_1.1-3 ellipsis_0.3.2 ica_1.0-3
[57] pkgconfig_2.0.3 farver_2.1.1 uwot_0.1.14 deldir_1.0-6
[61] utf8_1.2.3 tidyselect_1.2.0 labeling_0.4.2 rlang_1.1.0
[65] reshape2_1.4.4 later_1.3.0 munsell_0.5.0 cellranger_1.1.0
[69] tools_4.2.3 cli_3.6.1 generics_0.1.3 ggridges_0.5.4
[73] evaluate_0.20 stringr_1.5.0 fastmap_1.1.1 yaml_2.3.7
[77] goftest_1.2-3 knitr_1.42 bit64_4.0.5 fitdistrplus_1.1-8
[81] bcellViper_1.34.0 purrr_1.0.1 RANN_2.6.1 pbapply_1.7-0
[85] future_1.32.0 nlme_3.1-162 mime_0.12 xml2_1.3.3
[89] hdf5r_1.3.8 compiler_4.2.3 rstudioapi_0.14 plotly_4.10.1
[93] curl_5.0.0 png_0.1-8 spatstat.utils_3.0-2 stringi_1.7.12
[97] logger_0.2.2 lattice_0.20-45 Matrix_1.5-3 vctrs_0.6.1
[101] pillar_1.9.0 lifecycle_1.0.3 BiocManager_1.30.20 spatstat.geom_3.1-0
[105] lmtest_0.9-40 RcppAnnoy_0.0.20 data.table_1.14.8 cowplot_1.1.1
[109] irlba_2.3.5.1 httpuv_1.6.9 R6_2.5.1 promises_1.2.0.1
[113] KernSmooth_2.23-20 gridExtra_2.3 parallelly_1.35.0 codetools_0.2-19
[117] MASS_7.3-58.2 withr_2.5.0 sctransform_0.3.5 parallel_4.2.3
[121] hms_1.1.3 grid_4.2.3 rmarkdown_2.21 Rtsne_0.16
[125] spatstat.explore_3.1-0 shiny_1.7.4

PauBadiaM commented 1 year ago

Hi @hemantgujar

Did you modify somehow the dataframe net? It is complaining that the column source is not present there, could you check it exists? Else you can change the argument .source to the value of the column name with source names. Hope this is helpful.

hemantgujar commented 1 year ago

Ya i was having problem with get_dorothea so i used this

net <- dorothea::dorothea_mm_pancancer
head(net)

But after restarting R the problem was solved. So I continue to use get_dorothea function and there were no errors after that. Thanks a lot.

Also, I have one more question. How can I run run_wmean faster ? Thanks

PauBadiaM commented 1 year ago

Hi @hemantgujar

In case you want to run the enrichment faster you can lower the number of permutations (the argument times) but results might be less reliable. Another alternative is to use run_ulm, which its results converge most of the time with run_wmean and we show they have similar performances in the manuscript but runs faster. The last alternative is to switch to the python version of decoupler, which is way faster and memory efficient than the R one. Hope this is helpful.

hemantgujar commented 1 year ago

Thanks a lot.