Closed pablommesas closed 4 years ago
Hi Pablo
Thanks for pointing this out. This is because our datasets were generated (and put on zenodo) before we converted everything to sparse matrices.
Currently, a quick and dirty workaround for this is:
dataset$counts <- Matrix::Matrix(dataset$counts, sparse = TRUE)
dataset$expression <- Matrix::Matrix(dataset$expression, sparse = TRUE)
We will update the datasets soon on zenodo in which the expression and counts are saved as sparse objects.
Thank you guys! That did the trick :)
I would only point out that to be consistent with my previous code, the 'dataset' object does not actually contain the expression/count matrices explicitly but a function to load them from file, therefore, one should call the function explicitly dataset$expression()/dataset$counts()
The fixed code would look like:
dataset_file <- c("real/gold/stimulated-dendritic-cells-LPS_shalek/dataset.rds")
## Import data
dataset <- read_rds(derived_file(dataset_file, "01-datasets"))
## Currently, a quick and dirty workaround for this is: (https://github.com/dynverse/dyno/issues/47)
dataset$counts <- Matrix::Matrix(dataset$counts(), sparse = TRUE)
dataset$expression <- Matrix::Matrix(dataset$expression(), sparse = TRUE)
#c("slingshot", "monocle_ddrtree", "comp1", "paga_tree")
## Select Method
methods_selected <- "monocle_ddrtree" ## "paga_tree"
#methods_selected <- ti_monocle_ddrtree() ## ti_paga_tree()
## Infer trajectory
trajectory <- infer_trajectory(dataset, methods_selected, verbose = TRUE)
Ahh! You used the dynbenchmark/scripts/01-datasets/00-download_from_zenodo.R
script :)
I would recommend using this approach instead, then:
dataset$counts <- Matrix::Matrix(get_expression(dataset, "counts"), sparse = TRUE)
dataset$expression <- Matrix::Matrix(get_expression(dataset), sparse = TRUE)
Assuming this problem has been solved by now, if not feel free to request a reopen!
Hi! I ran into this issue when trying to infer a trajectory in one of your gold/datasets: gold/stimulated-dendritic-cells-LPS_shalek. I'm loading the dataset.rds which I assume contains everything that I need to run infer_trajectory() and other downstream analysis.
The error occurs when I use the infer_trajectory() using 'count' methods such as "monocle_ddrtree" or "paga_tree", as opposed to 'expression' methods such as "slingshot" and "comp1" (for which it works).
The error should be reproducible with the following code.
which returns: (for "monocle_ddrtree")
Similarly for "paga_tree":
The error seems to be similar:
I guess that it has to do with the fact that both methods are using the 'count' data instead of the 'expression' data, but I haven't found a way to solve this. I'm using your data wrong?
Thanks in advance!!