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
176 stars 23 forks source link

get_collectri ignores organism parameter setting #102

Closed woblkilr closed 8 months ago

woblkilr commented 8 months ago

Hello, thank you for your great package! I have noticed that when I run the get_collectri function the parameter setting 'organism' doesn't change the returning matrix no matter whether you put it on 'human' or 'mouse'.

library(decoupleR)

net = get_collectri(organism = 'mouse', split_complexes = F)
net2 = get_collectri(organism = 'human', split_complexes = F)

all.equal(net,net2)

if I run the code the command all.equal returns a True

this is my session info

> sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblas-r0.3.3.so;  LAPACK version 3.8.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               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    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/Berlin
tzcode source: system (glibc)

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

other attached packages:
 [1] homologene_1.4.68.19.3.27 pheatmap_1.0.12           ggplot2_3.4.4             patchwork_1.1.3          
 [5] tidyr_1.3.0               tibble_3.2.1              dplyr_1.1.4               decoupleR_2.7.1          
 [9] SeuratObject_5.0.0        Seurat_4.3.0.1           

loaded via a namespace (and not attached):
  [1] RColorBrewer_1.1-3     rstudioapi_0.14        jsonlite_1.8.4         magrittr_2.0.3         spatstat.utils_3.0-3  
  [6] rmarkdown_2.21         vctrs_0.6.2            ROCR_1.0-11            spatstat.explore_3.2-3 htmltools_0.5.5       
 [11] progress_1.2.2         curl_5.0.0             cellranger_1.1.0       sctransform_0.3.5      parallelly_1.36.0     
 [16] KernSmooth_2.23-21     desc_1.4.2             htmlwidgets_1.6.2      ica_1.0-3              plyr_1.8.8            
 [21] plotly_4.10.2          zoo_1.8-12             igraph_1.5.1           mime_0.12              lifecycle_1.0.3       
 [26] pkgconfig_2.0.3        Matrix_1.6-3           R6_2.5.1               fastmap_1.1.1          fitdistrplus_1.1-11   
 [31] future_1.33.0          shiny_1.7.4            digest_0.6.31          colorspace_2.1-0       ps_1.7.5              
 [36] rprojroot_2.0.3        tensor_1.5             irlba_2.3.5.1          progressr_0.14.0       fansi_1.0.4           
 [41] spatstat.sparse_3.0-2  httr_1.4.5             polyclip_1.10-4        abind_1.4-5            compiler_4.3.0        
 [46] remotes_2.4.2.1        bit64_4.0.5            withr_2.5.0            backports_1.4.1        logger_0.2.2          
 [51] pkgbuild_1.4.0         OmnipathR_3.8.2        MASS_7.3-60            sessioninfo_1.2.2      rappdirs_0.3.3        
 [56] tools_4.3.0            lmtest_0.9-40          httpuv_1.6.9           future.apply_1.11.0    goftest_1.2-3         
 [61] glue_1.6.2             callr_3.7.3            nlme_3.1-162           promises_1.2.0.1       grid_4.3.0            
 [66] checkmate_2.3.0        Rtsne_0.16             cluster_2.1.4          reshape2_1.4.4         generics_0.1.3        
 [71] gtable_0.3.4           spatstat.data_3.0-1    tzdb_0.4.0             data.table_1.14.8      hms_1.1.3             
 [76] xml2_1.3.4             sp_2.0-0               utf8_1.2.3             spatstat.geom_3.2-5    RcppAnnoy_0.0.21      
 [81] ggrepel_0.9.3          RANN_2.6.1             pillar_1.9.0           stringr_1.5.0          vroom_1.6.4           
 [86] spam_2.10-0            later_1.3.1            splines_4.3.0          lattice_0.21-8         bit_4.0.5             
 [91] survival_3.5-5         deldir_1.0-9           tidyselect_1.2.0       miniUI_0.1.1.1         pbapply_1.7-2         
 [96] knitr_1.42             gridExtra_2.3          scattermore_1.2        xfun_0.39              matrixStats_1.0.0     
[101] stringi_1.7.12         yaml_2.3.7             lazyeval_0.2.2         evaluate_0.20          codetools_0.2-19      
[106] BiocManager_1.30.22    cli_3.6.1              uwot_0.1.16            xtable_1.8-4           reticulate_1.32.0     
[111] processx_3.8.1         munsell_0.5.0          Rcpp_1.0.10            readxl_1.4.3           globals_0.16.2        
[116] spatstat.random_3.1-6  png_0.1-8              parallel_4.3.0         ellipsis_0.3.2         readr_2.1.4           
[121] prettyunits_1.1.1      dotCall64_1.1-0        listenv_0.9.0          viridisLite_0.4.2      scales_1.2.1          
[126] ggridges_0.5.4         leiden_0.4.3           purrr_1.0.1            crayon_1.5.2           rlang_1.1.1           
[131] rvest_1.0.3            cowplot_1.1.1         
deeenes commented 8 months ago

Hello @woblkilr, I couldn't reproduce the issue with recent versions of the packages. OmnipathR 3.8.2 is quite old, I think the best if you update the packages and try again:

library(remotes)
remotes::install_github('saezlab/OmnipathR')
remotes::install_github('saezlab/decoupleR')
woblkilr commented 8 months ago

I ran the code I mentioned above with OmnipathR 3.11.1 and decoupleR 2.8.0 and the problem still persists for me

deeenes commented 8 months ago

I'm sorry to hear that, then we should look into the logs. And we should try with an empty cache. Could you please run it like below and share the log messages:

library(OmnipathR)
library(decoupleR)
omnipath_set_console_loglevel('trace')
cachedir <- tempdir()
omnipath_set_cachedir(cachedir)
ci <- get_collectri(organism = 'mouse')

But before doing that, maybe I found the reason: looking into the code of decoupleR 2.8.0, some changes (f586e370) were not included in the release. It means, if you update to the development version from this git repo (2.9.0) there is a chance it will work:

library(remotes)
remotes::install_github('saezlab/decoupleR')

@PauBadiaM - we should backport this stuff to RELEASE_3_18, I've just pushed it to the branch here, can you please forward it to BioC?

woblkilr commented 8 months ago

Ok so I tried using decoupler 2.9.0 and it still returns the human interaction table if setting the parameter to mouse. However when i cleared the cache and ran the command again it returns the correct table. Thank you for your help :) !