satijalab / seurat-wrappers

Community-provided extensions to Seurat
GNU General Public License v3.0
296 stars 127 forks source link

Error running Monocle3 #52

Closed ashwinikumarkulkarni closed 4 years ago

ashwinikumarkulkarni commented 4 years ago

Hello! I have an integrated Seurat object (R 3.5.1, Seurat_3.1.5) which I am trying to use with SeuratWrapper's Monocle3 trajectory analysis (R 3.6.1, Seurat_3.1.5). Following the tutorial, I get following error running cluster_cells command. I also tried updating Seurat object using UpdateSeuratObject, but keep getting the same error. I can always re-run integration pipeline but I want to use the UMAP coordinates & cluster ids from my existing integration results. Please suggest a solution. Thanks!

> cds <- as.cell_data_set(integrated) Warning: Monocle 3 trajectories require cluster partitions, which Seurat does not calculate. Please run 'cluster_cells' on your cell_data_set object > cds <- cluster_cells(cds) Error: No dimensionality reduction for UMAP calculated. Please run reduce_dimensions with reduction_method = UMAP before running cluster_cells

bensong721 commented 4 years ago

Just wanted to say that I too am having this issue.

cds <- as.cell_data_set(ciona.integrated) Warning message: “Monocle 3 trajectories require cluster partitions, which Seurat does not calculate. Please run 'cluster_cells' on your cell_data_set object”

cds <- cluster_cells(cds) Error: No dimensionality reduction for UMAP calculated. Please run reduce_dimension with reduction_method = UMAP before running cluster_cells

cds <- reduce_dimension(cds, reduction_method = "UMAP") No preprocess_method specified, using preprocess_method = 'PCA'

cds <- preprocess_cds(cds, method = "PCA") Error in names(sf) <- colnames(SingleCellExperiment::counts(cds)): attempt to set an attribute on NULL

Any help would be appreciated!

ashuchawla commented 4 years ago

Wondering if you guys ran UMAP on Seurat object at all?

integrated <- RunUMAP(integrated, dims = 1:, reduction.name = "UMAP")

ashwinikumarkulkarni commented 4 years ago

@ashuchawla Yes! RunUMAP was already run during Seurat Integration pipeline. I already have the UMAP plot. And I want to map Monocle's pseudotime onto same UMAP coordinates.. which is where the error is.

mojaveazure commented 4 years ago

One of the requirements of Monocle 3 is that the dimensional reduction names are all upper-case, while Seurat defaults to lower-case names (eg. "UMAP" vs "umap"). The converter does not yet take care of this, but we are working on it. In the meantime, you can either pass reduction.name = "UMAP" to RunUMAP (as seen in the vignette) or rename a previously calculated UMAP result in Seurat before converting to Monocle 3

seurat.object[["UMAP"]] <- seurat.object[["umap"]]
# To save on memory, you can delete the original UMAP, but this is not necessary
seurat.object[["umap"]] <- NULL

Please note, the same issue applies for PCA (Seurat stores as "pca" instead of "PCA") and the same fix for UMAP applies here as well.

mojaveazure commented 4 years ago

This issue should be resolved in the latest version of SeuratWrappers. Thanks for reporting!

ashwinikumarkulkarni commented 4 years ago

Thanks a lot @mojaveazure! I think this will work. I am trying now!