cole-trapnell-lab / cicero-release

https://cole-trapnell-lab.github.io/cicero-release/
MIT License
56 stars 14 forks source link

Class compatibility issue between cicero3 (for monocle3) and monocle3. #68

Closed quinamatics closed 3 years ago

quinamatics commented 3 years ago

Hi, I'm getting the below issue while running cicero3 on my input_cds which was generated with monocle3. When I print out input_cds, I'm getting class: cell_data_set, which is incorrect, as pointed out in https://github.com/cole-trapnell-lab/cicero-release/issues/38. However, I'm completely following the documentation (copy and pasting commands), installing the correct monocle3 and cicero3 for monocle3 versions and this error still persists. It's very confusing so I would like some pointers as to what is wrong. By the way, when I run library(monocle3) and library(cicero) there are no logs.

The exact commands I run are: if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install(version = "3.11")

BiocManager::install(c('BiocGenerics', 'DelayedArray', 'DelayedMatrixStats', 'limma', 'S4Vectors','SingleCellExperiment', 'SummarizedExperiment', 'batchelor', 'Matrix.utils'))

install.packages("devtools") devtools::install_github('cole-trapnell-lab/leidenbase') devtools::install_github('cole-trapnell-lab/monocle3')

if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install(c("Gviz", "GenomicRanges", "rtracklayer"))

install.packages("devtools") devtools::install_github("cole-trapnell-lab/cicero-release", ref = "monocle3", force = TRUE)

And after loading my dataset (with commands straight from the cicero3 docs), I run this to get input_cds

`input_cds <- suppressWarnings(new_cell_data_set(indata, cell_metadata = cellinfo, gene_metadata = peakinfo))

input_cds <- monocle3::detect_genes(input_cds)

Ensure there are no peaks included with zero reads

input_cds <- input_cds[Matrix::rowSums(exprs(input_cds)) != 0,] `

This is when I see that input_cds has the wrong class name, but I followed the exact commands to install monocle3???

Screen Shot 2020-11-12 at 7 59 20 PM
quinamatics commented 3 years ago

Additionally, when I force install monocle3 again, the block seems to complete but I'm not sure if the other building/installing processes are even running. The screenshot of this is below

Screen Shot 2020-11-12 at 8 07 25 PM
hpliner commented 3 years ago

Hello, from your code it looks like somehow Cicero for monocle2 is being loaded. Can you post your sessionInfo()?

After reinstalling the various packages, are you restarting your R session? R does not reload packages that are already loaded even if they have been reinstalled, so if you haven't restarted R you will keep the same packages.

quinamatics commented 3 years ago

Here's my session info as well as the log for input_cds and the error (which is slighly different, but input_cds is still not correct). This is also after I restarted my R session (I just restarted the notebook kernel, if this isn't equivalent please let me know).

Screen Shot 2020-12-08 at 12 23 42 PM Screen Shot 2020-12-08 at 12 25 17 PM
hpliner commented 3 years ago

input_cds is correct. The correct class with monocle3 is cell_data_set

hpliner commented 3 years ago

The error you posted is related to the fact that the UMAP slot is empty. Have you calculated a UMAP?

quinamatics commented 3 years ago

Hi, I've gotten past that error. However I now have this error. Upon searching in past examples it seems like this exact issue hasn't been brought up yet. I've also posted screenshots of my input_cds and umap coordinates

Screen Shot 2020-12-21 at 7 43 40 PM Screen Shot 2020-12-21 at 7 44 31 PM
quinamatics commented 3 years ago

Also, I saw the error here: https://github.com/cole-trapnell-lab/monocle3/issues/291, but I've already included the fix in my code. Here is a screenshot of how I work with the input_cds, also there is a warning about using a standard svd. Is that the reason behind the bug?

Screen Shot 2020-12-21 at 8 21 01 PM
hpliner commented 3 years ago

Hello, You're running into this error because you're attempting to make a cicero cds with only 80 cells - with a k value of 50, it's not possible to make sufficient aggregated cell groups. Internally such a small matrix gets converted to a different type which throws the error.

While you could get past the error by lower the k value, Cicero is designed to be used for many more cells (maybe 500), so I would not expect robust results with so few cells.