Skip to content

Monocle 3 using Seurat object and PHATE #746

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

Open
Yanst86 opened this issue Jan 16, 2025 · 1 comment
Open

Monocle 3 using Seurat object and PHATE #746

Yanst86 opened this issue Jan 16, 2025 · 1 comment

Comments

@Yanst86
Copy link

Yanst86 commented Jan 16, 2025

Hi,

Apologies for posting a question here and not in the Google Group, the latter became home to spam in recent months so I preferred to ask my question here:
I am new to Monocle and would like to use my already processed Seurat object using Monocle3. In addition, I calculated a PHATE embedding and would very much like to use it and not the UMAP embedding used by default in Monocle3. I learned that I should use as.cell_data_set() to convert my Seurat object to something that can be used by Monocle3, but then I received a warning that cluster partitions should be calculated by Monocle as well. In addition, I can't find any official tutorial as to how should I process Seurat objects and use Monocle3 only for trajectory inference.

Can someone share a code as to how should I process my Seurat object and use a custom dimensionality reduction embedding using learn_graph()?

Many thanks in advance,
Yan

@carloelle
Copy link

Hello!

I was trying to do the same: running Monocle3 using a PHATE embedding. My case consists of malignant cells running over a differentiation path, cases in which typically UMAP would cluster by patients (or similarly) while PHATE could resolve the complexity.

Let cds be a cell_data_set, I separately computed PHATE for my matrix (will return a data.frame) and then called
phate<-as.matrix(phate)

In the meantime, let's compute the necessary preprocessing steps for cds. What i though is to compute first their UMAP embedding, then substitute the UMAP embedding with our PHATE embedding (for sure concerns will be risen, still let's analyse each step to ensure consistency):

library(monocle3)

cds<-preprocess_cds(cds,num_dim=50)
cds<-reduce_dimension(cds,reduction_method='UMAP')

cds@reduce_dim_aux$UMAP@listData$umap_model$embedding<-phate
cds@reduce_dim_aux$UMAP$model$umap_model$embedding<-phate
cds@reduce_dim_aux$UMAP$model@listData$umap_model$embedding<-phate
reduceDims(cds)$UMAP<-phate

then you can

cds<-cluster_cells(cds,reduction_method='UMAP') cds<-learn_graph(cds,use_partition=FALSE,verbose=TRUE)

use_partition can be either TRUE or FALSE depending if you want a single trajectory or multiple ones.

In my case this worked, but I noticed that the results were pretty disappointing, plus the consuption of RAM speeds up incredibly high. With standard UMAP it is not the case even for large datasets. We may adjust parameters in learn_graph_control(), but suggestions are welcome.

Cheers,
Carlo

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