Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in rlang::set_names() get_progeny mouse #135

Open
bioshot-dotcom opened this issue Aug 6, 2024 · 2 comments
Open

Error in rlang::set_names() get_progeny mouse #135

bioshot-dotcom opened this issue Aug 6, 2024 · 2 comments
Assignees

Comments

@bioshot-dotcom
Copy link

Hello!

I was following this tutorial (https://saezlab.github.io/decoupleR/articles/pw_bk.html) for pathway activity inference. I have mouse data, so I tried:
net <- get_progeny(organism = 'mouse', top = 100)

but I got this:

> [2024-08-06 17:16:45] [SUCCESS] [OmnipathR] Loaded 700239 annotation records from cache.
> [2024-08-06 17:16:47] [SUCCESS] [OmnipathR] UniProt (rest.uniprot.org): loaded 17217 records from cache
> Error in `rlang::set_names()`:
> ! The size of `nm` (4) must be compatible with the size of `x` (0).
> Backtrace:
>  1. decoupleR::get_progeny(organism = "mouse", top = 100)
>  4. rlang::abort(message = message)
>  
> Error in rlang::set_names(., c("source", "target", "weight", "p_value")) :
> 6. stop(fallback)
> 5. signal_abort(cnd, .file)
> 4. abort(message = message)
> 3. rlang::set_names(., c("source", "target", "weight", "p_value"))
> 2. get_resource("PROGENy", organism = organism) %>% dplyr::distinct(pathway,
>     genesymbol, .keep_all = TRUE) %>% dplyr::mutate(weight = as.double(weight),
>     p_value = as.double(p_value)) %>% dplyr::select(genesymbol,
>     p_value, pathway, weight) %>% dplyr::group_by(pathway) %>% ...
> 1. get_progeny(organism = "mouse", top = 100)

R version: 4.4.1
decoupleR: 2.10.0
OmnipathR: 3.11.10
dplyr: 1.1.4
tibble: 3.2.1
tidyr: 1.3.1

@deeenes deeenes self-assigned this Aug 6, 2024
@deeenes
Copy link
Member

deeenes commented Aug 6, 2024

Hello, This error suggests that after the translation to mouse by orthologous gene pairs, zero rows remained in the data frame. One reason might be a corrupt cache item left behind after a failed download. To test this, I recommend to try with an empty cache:

library(OmnipathR)
library(decoupleR)

omnipath_set_console_loglevel('trace')
omnipath_set_cachedir(tempdir())

pr <- get_progeny(organism = 'mouse')

@bioshot-dotcom
Copy link
Author

I tried but I keep getting the same error, instead I solved with this:

net = as.tibble(progeny::model_mouse_full)
net <- net %>%
  mutate(target = as.character(gene),
         source = as.character(pathway)) %>%
  select(-gene, -pathway)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants