Closed Pazuzzilla closed 1 year ago
Huh that's weird, you seem to have the right versions for OmniPathR
and decoupleR
. I tried and I do get the correct network:
df <- decoupleR::get_collectri(organism='mouse', split_complexes=FALSE)
df
[2023-06-23 15:19:25] [SUCCESS] [OmnipathR] Downloaded 38823 interactions.
# A tibble: 38,665 × 3
source target mor
<chr> <chr> <dbl>
1 Myc Tert 1
2 Spi1 Bglap2 1
3 Spi1 Bglap 1
4 Spi1 Bglap3 1
5 Smad3 Jun 1
6 Smad4 Jun 1
7 Stat5a Il2 1
8 Stat5b Il2 1
9 Rela Fas 1
10 Wt1 Nr0b1 1
# … with 38,655 more rows
# ℹ Use `print(n = ...)` to see more rows
Maybe it's the cache? @deeenes , what is your opinion? What was the command to reset the cache in the R version of omnipath? Just in case I would try to reinstall from github, reset your R session and try again:
remotes::install_github('saezlab/omnipathr')
remotes::install_github('saezlab/decoupleR')
Just like Pau, I experience the correct behaviour. I don't see anything wrong in the code, and also I can't imagine caching can cause this issue, though it can't harm to try with an empty cache. In this procedure we get mouse records from the server, the translation from human to mouse doesn't happen in the client side but during the database build. In the log we can see the organisms=10090
parameter:
library(decoupleR)
library(OmnipathR)
omnipath_set_console_loglevel('trace')
ci <- get_collectri('mouse', split_complexes = FALSE)
[2023-06-23 15:33:04] [INFO] [OmnipathR] Cache record does not exist: `https://omnipathdb.org/interactions?genesymbols=yes&datasets=collectri&organisms=10090&dorothea_levels=A,B&fields=evidences,sources,references,curation_effort&loops=yes&license=academic`
[2023-06-23 15:33:04] [INFO] [OmnipathR] Retrieving URL: `https://omnipathdb.org/interactions?genesymbols=yes&datasets=collectri&organisms=10090&dorothea_levels=A,B&fields=evidences,sources,references,curation_effort&loops=yes&license=academic`
[2023-06-23 15:33:04] [TRACE] [OmnipathR] Attempt 1/3: `https://omnipathdb.org/interactions?genesymbols=yes&datasets=collectri&organisms=10090&dorothea_levels=A,B&fields=evidences,sources,references,curation_effort&loops=yes&license=academic`
[2023-06-23 15:33:05] [TRACE] [OmnipathR] Reading JSON from `/home/denes/.cache/OmnipathR/cache.json` (encoding: UTF-8).
[2023-06-23 15:33:05] [TRACE] [OmnipathR] JSON validation successful: TRUE
[2023-06-23 15:33:05] [TRACE] [OmnipathR] Reading JSON from `/home/denes/.cache/OmnipathR/cache.json` (encoding: UTF-8).
[2023-06-23 15:33:05] [TRACE] [OmnipathR] JSON validation successful: TRUE
[2023-06-23 15:33:05] [INFO] [OmnipathR] Cache item `107896962c7d5fc50d4cbc51809a591cd50bb105` version 1: status changed from `unknown` to `started`.
[2023-06-23 15:33:05] [TRACE] [OmnipathR] Exporting object to RDS: `/home/denes/.cache/OmnipathR/107896962c7d5fc50d4cbc51809a591cd50bb105-1.rds`.
[2023-06-23 15:33:06] [TRACE] [OmnipathR] Exported RDS to `/home/denes/.cache/OmnipathR/107896962c7d5fc50d4cbc51809a591cd50bb105-1.rds`.
[2023-06-23 15:33:06] [INFO] [OmnipathR] Download ready [key=107896962c7d5fc50d4cbc51809a591cd50bb105, version=1]
[2023-06-23 15:33:06] [TRACE] [OmnipathR] Reading JSON from `/home/denes/.cache/OmnipathR/cache.json` (encoding: UTF-8).
[2023-06-23 15:33:06] [TRACE] [OmnipathR] JSON validation successful: TRUE
[2023-06-23 15:33:06] [INFO] [OmnipathR] Cache item `107896962c7d5fc50d4cbc51809a591cd50bb105` version 1: status changed from `started` to `ready`.
[2023-06-23 15:33:06] [TRACE] [OmnipathR] Converting JSON column `evidences` to list.
[2023-06-23 15:33:08] [TRACE] [OmnipathR] Restricting interaction records to datasets: collectri; and resources: any
[2023-06-23 15:33:10] [TRACE] [OmnipathR] Filtering evidence columns: positive, negative, directed, undirected; to datasets: collectri; and resources: any
[2023-06-23 15:34:10] [SUCCESS] [OmnipathR] Downloaded 38823 interactions.
ci
# A tibble: 38,665 × 3
source target mor
<chr> <chr> <dbl>
1 Myc Tert 1
2 Spi1 Bglap2 1
3 Spi1 Bglap 1
4 Spi1 Bglap3 1
5 Smad3 Jun 1
6 Smad4 Jun 1
7 Stat5a Il2 1
8 Stat5b Il2 1
9 Rela Fas 1
10 Wt1 Nr0b1 1
# ℹ 38,655 more rows
# ℹ Use `print(n = ...)` to see more rows
And how to empty the cache:
library(OmnipathR)
omnipath_cache_wipe()
Please keep us updated, as this issue is kind of mysterious, I can't guess the reason right away. If you could share the trace
level log (similar to the one I pasted above) that might give a clue.
Hi,
just an update, reset the R session worked fine as solution, unfortunately i tried it before reading your advice so i can't produce the trace of when the problem was here. Sorry, if i'm going to face the problem again i will give you more informations about it.
Thanks for your job.
Hello, I have faced the same issue in a server environment. I have tried the solution proposed above, clearing the cache, and I still get the human output. I noticed that in the log section, the organism id is set again in human
ci <- get_collectri('mouse', split_complexes = FALSE)
[2023-09-11 11:00:02] [INFO] [OmnipathR] Cache record does not exist: `https://omnipathdb.org/interactions?genesymbols=yes&datasets=collectri&organisms=9606&dorothea_levels=A,B&fields=evidences,sources,references,curation_effort&license=academic`
[2023-09-11 11:00:02] [INFO] [OmnipathR] Retrieving URL: `https://omnipathdb.org/interactions?genesymbols=yes&datasets=collectri&organisms=9606&dorothea_levels=A,B&fields=evidences,sources,references,curation_effort&license=academic`
[2023-09-11 11:00:02] [TRACE] [OmnipathR] Attempt 1/3: `https://omnipathdb.org/interactions?genesymbols=yes&datasets=collectri&organisms=9606&dorothea_levels=A,B&fields=evidences,sources,references,curation_effort&license=academic`
...
The session info output is the following:
> sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 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=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
[4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
[7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
time zone: Etc/UTC
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] OmnipathR_3.9.4 decoupleR_2.6.0
loaded via a namespace (and not attached):
[1] rappdirs_0.3.3 utf8_1.2.3 generics_0.1.3 tidyr_1.3.0
[5] xml2_1.3.4 stringi_1.7.12 lattice_0.21-8 hms_1.1.3
[9] digest_0.6.31 magrittr_2.0.3 evaluate_0.21 grid_4.3.0
[13] fastmap_1.1.1 cellranger_1.1.0 jsonlite_1.8.4 Matrix_1.5-4.1
[17] progress_1.2.2 backports_1.4.1 httr_1.4.6 rvest_1.0.3
[21] purrr_1.0.1 fansi_1.0.4 cli_3.6.1 rlang_1.1.1
[25] crayon_1.5.2 bit64_4.0.5 withr_2.5.0 yaml_2.3.7
[29] parallel_4.3.0 tools_4.3.0 tzdb_0.4.0 checkmate_2.2.0
[33] dplyr_1.1.2 curl_5.0.0 vctrs_0.6.2 logger_0.2.2
[37] R6_2.5.1 lifecycle_1.0.3 stringr_1.5.0 bit_4.0.5
[41] vroom_1.6.3 pkgconfig_2.0.3 pillar_1.9.0 later_1.3.1
[45] glue_1.6.2 Rcpp_1.0.10 xfun_0.39 tibble_3.2.1
[49] tidyselect_1.2.0 knitr_1.43 htmltools_0.5.5 igraph_1.4.3
[53] rmarkdown_2.22 readr_2.1.4 compiler_4.3.0 prettyunits_1.1.1
[57] readxl_1.4.2
If you have any suggestion it would be really helpful, thank you.
Hi @ChrisTzaferis,
It could be that at that moment the omnipath
server was down. Could you try again now? What do you think @deeenes ?
Hi @PauBadiaM , thank you for your response. I have also tried it in a local conda environment with R 4.3.0 and I have the same problem today.
omnipath_cache_wipe()
[2023-09-18 11:41:59] [SUCCESS] [OmnipathR] Removing all cache contents from /home/tzafchris/.cache/OmnipathR
.
library(decoupleR) library(OmnipathR) omnipath_set_console_loglevel('trace') mouse_com_false <- get_collectri('mouse', split_complexes = FALSE) [2023-09-18 11:42:48] [INFO] [OmnipathR] Cache record does not exist:
https://omnipathdb.org/interactions?genesymbols=yes&datasets=collectri&organisms=9606&dorothea_levels=A,B&fields=evidences,sources,references,curation_effort&license=academic
[2023-09-18 11:42:48] [INFO] [OmnipathR] Retrieving URL:https://omnipathdb.org/interactions?genesymbols=yes&datasets=collectri&organisms=9606&dorothea_levels=A,B&fields=evidences,sources,references,curation_effort&license=academic
[2023-09-18 11:42:48] [TRACE] [OmnipathR] Attempt 1/3:https://omnipathdb.org/interactions?genesymbols=yes&datasets=collectri&organisms=9606&dorothea_levels=A,B&fields=evidences,sources,references,curation_effort&license=academic
[2023-09-18 11:42:49] [TRACE] [OmnipathR] Reading JSON from/home/tzafchris/.cache/OmnipathR/cache.json
(encoding: UTF-8). [2023-09-18 11:42:49] [TRACE] [OmnipathR] JSON validation successful: TRUE [2023-09-18 11:42:49] [TRACE] [OmnipathR] Reading JSON from/home/tzafchris/.cache/OmnipathR/cache.json
(encoding: UTF-8). [2023-09-18 11:42:49] [TRACE] [OmnipathR] JSON validation successful: TRUE [2023-09-18 11:42:49] [INFO] [OmnipathR] Cache item099e7af92f71a88d7560d65cea14c1970f66c0b6
version 1: status changed fromunknown
tostarted
. [2023-09-18 11:42:49] [TRACE] [OmnipathR] Exporting object to RDS:/home/tzafchris/.cache/OmnipathR/099e7af92f71a88d7560d65cea14c1970f66c0b6-1.rds
. [2023-09-18 11:42:50] [TRACE] [OmnipathR] Exported RDS to/home/tzafchris/.cache/OmnipathR/099e7af92f71a88d7560d65cea14c1970f66c0b6-1.rds
. [2023-09-18 11:42:50] [INFO] [OmnipathR] Download ready [key=099e7af92f71a88d7560d65cea14c1970f66c0b6, version=1] [2023-09-18 11:42:50] [TRACE] [OmnipathR] Reading JSON from/home/tzafchris/.cache/OmnipathR/cache.json
(encoding: UTF-8). [2023-09-18 11:42:50] [TRACE] [OmnipathR] JSON validation successful: TRUE [2023-09-18 11:42:50] [INFO] [OmnipathR] Cache item099e7af92f71a88d7560d65cea14c1970f66c0b6
version 1: status changed fromstarted
toready
. [2023-09-18 11:42:50] [TRACE] [OmnipathR] Converting JSON columnevidences
to list. [2023-09-18 11:42:51] [TRACE] [OmnipathR] Restricting interaction records to datasets: collectri; and resources: any [2023-09-18 11:42:52] [TRACE] [OmnipathR] Filtering evidence columns: positive, negative, directed, undirected; to datasets: collectri; and resources: any [2023-09-18 11:43:11] [SUCCESS] [OmnipathR] Downloaded 64495 interactions. mouse_com_false
A tibble: 42,595 × 3 source target mor
I managed to reproduce the issue with decoupleR 2.6.0, which is the current release. With the development version (2.7.0) we see the correct behaviour, we get mouse data for mouse queries. @ChrisTzaferis I recommend you to update the decoupleR from github:
library(remotes)
remotes::install_github('saezlab/decoupleR')
Thank you @deeenes for your suggestion! Indeed with the version 2.7.0 I can get the mouse interactions. One last question, regarding the same issue, is if you get different number of interactions by setting the parameter complexes = True/False, because in my case the same number is retrieved in both cases.
Briefly: it seems alright to me, there are no complexes in the mouse CollecTRI dataset.
More details:
CollecTRI contains almost no complexes: the only two TF complex present are the NFKB and the AP1. The parameter split_complexes
does only this, I'm not sure about the idea behind that code. If you only want to control whether the interactions of those two complexes are included, you can use the entity_types
argument from OmnipathR
:
ci_complexes <- get_collectri('mouse', entity_types = c('complex', 'protein'))
ci_only_proteins <- get_collectri('mouse', entity_types = 'protein')
However, the two data frames, as processed and used by decoupleR, will be identical, because it uses only gene symbols, and the name of the complexes will match certain gene symbols. In addition, those two complexes from CollecTRI are getting lost in human → mouse translation. They are both major master TFs, with about 23k interactions between ~20 TF varieties and 1.1k target genes in human.
library(OmnipathR)
ci_p_h <- collectri(entity_types = 'protein')
ci_p_m <- collectri(organism = 10090L, entity_types = 'protein')
ci_c_h <- collectri(entity_types = c('complex', 'protein'))
ci_c_m <- collectri(organism = 10090L, entity_types = c('complex', 'protein'))
Thank you very much @deeenes for your time and your help!
Hi,
I'm trying to run the Transcription factor activity inference from scRNA-seq on my dataset. When trying to get the network with:
net <- get_collectri(organism="mouse", split_complexes=FALSE)
i get the same network as if "human" was select as organism:
Is it correct? Maybe i've misunderstood something, I think i have everything up to date. My sessionInfo below. Thanks