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
183 stars 24 forks source link

Error in parse(text = elt) #63

Closed arnaudmet closed 1 year ago

arnaudmet commented 1 year ago

Hi, I'm working on scRNAseq data and I've tried to run Dorothea several time using run_wmean(), run_viper() and still have the following error, even using the data provided for demonstration on the vignette.

Error in parse(text = elt) : <text>:1:5: unexpected symbol 
1: Use of
         ^ 

and I'm unable to find out how to solves this

R version 4.2.0 (2022-04-22)
attached base packages:
[1] methods   graphics  grDevices utils     datasets  base     

other attached packages:
[1] sp_1.5-0           SeuratObject_4.1.2 Seurat_4.2.0       decoupleR_2.2.2   
PauBadiaM commented 1 year ago

Hi @arnaudmet

Thanks for checking out the package! Is it possible to get a longer error message? Unfortunately this one is quite cryptic, making it hard to pinpoint which specific function is failing. Here are some things you can try also:

Hope this is helpful, let me know if it doesn't work.

arnaudmet commented 1 year ago

Thanks for your answer. unfortunatly this is the only error I have I already check the characters in my personal data and it seems correct. and i also try to change the argument sparse= But i also try to use data from the website : https://saezlab.github.io/decoupleR/articles/tf_sc.html and i steel have the same problem here is the code i used to run, it's a copy paste from the website

library(Seurat)
library(decoupleR)
net <- get_dorothea(organism='human', levels=c('A', 'B', 'C'))
net
inputs_dir <- system.file("extdata", package = "decoupleR")
data <- readRDS(file.path(inputs_dir, "sc_data.rds"))
DimPlot(data, reduction = "umap", label = TRUE, pt.size = 0.5) + NoLegend()
mat <- as.matrix(data@assays$RNA@data)
acts <- run_wmean(mat=mat, net=net, .source='source', .target='target',
                  .mor='mor', times = 100, minsize = 5)

I have tried to change the arguments for .sources,.target,.mor

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

and i have a different error

Error in `convert_f_defaults()`:
! Can't rename columns that don't exist.
✖ Columns `ADNP`, `ADNP`, `ADNP`, `ADNP`, `AHR`, etc. don't exist.
Run `rlang::last_error()` to see where the error occurred.

Thanks for you help

PauBadiaM commented 1 year ago

Mhmm this is weird, it works on my machine and on the BioC servers. Are you also getting the same unexpected symbol error when you run the vignette? When you changed the .source and others is normal that it doesn't work, you should pass the name of the column (as is shown in the vignette) not the column data itself.

Could you update decoupleR to its latest version and try the vignette again (2.3.2)? Either via BioConductor or Github, you can run:

remotes::install_github("saezlab/decoupleR")
arnaudmet commented 1 year ago

I delete my library folder and re-install seurat,decoupleR and it seems that it is acutally runing correctly. I will investigate, but apparently an other packages was the problem even if it was not loaded.

If I found what is the imcompatibility i will indicate you

Thanks

PauBadiaM commented 1 year ago

Aha! Those pesky package dependencies, thanks for checking it! Feel free to reopen this issue in case you needed.