monocle-release
monocle-release copied to clipboard
Is it possible to give dimension reduced data from Seurat to Monocle?
I have two time point data analysed using Seurat. I have done cell cycle correction and batch correction in Seurat. I would like to use the cell-cycel and batch corrected data to do pseudo time analysis using Monocle. I already have dimension reduced data. Following dataframe shows how my data looks like. Rownames are cell barcodes and columns are dimensions. Is it possible to give such input to Monocle to do pseudo-time analysis?
ACC1 ACC2 ACC3 ACC4 ACC5
AAACCTGAGAGCCTAG 0.2912968 1.9218620 -0.07594450 0.07920177 0.0214002
AAACCTGAGTGGCACA 1.3125555 -1.0346728 0.56284450 0.01348247 -0.1927503
AAACCTGCAATAACGA -0.3517998 -0.7054918 0.21015822 0.75798072 0.2751296
AAACCTGGTAGCTAAA 0.9580736 -0.5992308 0.01396823 0.57237873 -0.1930334
I am also interested in this type of function. I would like to do trajectory and pseudo time analysis on Monocle using data that has been corrected and clustered in Seurat.
I'm working on the same thing and here's what I've found: After importing Seurat object to Monocle, if you check: head(pData(imported_Seurat_object)), there should be a column of the clusters from Seurat. Then you use Seurat's clusters when plotting trajectory by specifying the column of Seurat's clusters: plot_cell_trajectory(imported_Seurat_object, color_by='the column of Seurat's clusters').
Also, I would like to know is it ok to use top 1,000 differentially expressed genes from Seurat's clusters as feature genes in Monocle trajectory analysis using setOrderingFilter() ?
This seems like a common question and I have seen it several times. Not that it related to this issue #162 . Please let me know if you have any further question after you read the other issue.
We should be able to make a FAQ and demonstrate how can we do this with a short tutorial.
Regarding to @qoiopipq 's question about the ordering genes. I feel the procedure is reasonable although I never test it. The other option is to use the over-dispersion genes Seurat used for clustering.
Thanks @qoiopipq
I am unable to use pData function on Seurat object.
> pData(seuratObj)
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘pData’ for signature ‘"seurat"’
@bishwaG pData() is in Monocle. Once you imported your Seurat object into Monocle, head(pData(Seurat object)) your Seurat clusters are in one of the columns.
same issue here. I used ImportCDS to convert my corrected, dimensional reduced, clustered Seurat object into a CellDataSet, which was successful and I got the clustering column from Seurat in my CellDataSet. Then I tried what @qoiopipq suggested, but got this error:
> plot_cell_trajectory(importedseuratobject, color_by = "CellType") Error in if (cds@dim_reduce_type == "ICA") { : argument is of length zero
I'd be thankful for any suggestions.
@esfandyari Did you just import your Seurat object and run plot_cell_trajectory straight away? You need to go through steps like estimating size factors & dispersion, setting feature genes, reduceDimension(using Monocle's DDRTree) and orderCells. Then you can run plot_cell_trajectory and specify the column of your Seurat's clusters.
@esfandyari, if you use importCDS function, then I think the data is taken from the raw.data slot and not from the data or the scale.data slots. So, your batch and other corrections may not get picked up. If you wish to preserve those, then I think you will have to do what @Xiaojieqiu said in https://github.com/cole-trapnell-lab/monocle-release/issues/162. I am in the same situation, with the need to do pseudotime on cell-cycle corrected normalized data from Seurat, and I'm going to try what was suggested in https://github.com/cole-trapnell-lab/monocle-release/issues/162
@esfandyari, if you use importCDS function, then I think the data is taken from the raw.data slot and not from the data or the scale.data slots. So, your batch and other corrections may not get picked up. If you wish to preserve those, then I think you will have to do what @Xiaojieqiu said in #162. I am in the same situation, with the need to do pseudotime on cell-cycle corrected normalized data from Seurat, and I'm going to try what was suggested in #162
Were you able to get this to work? I am working on a similar problem as well...
@esfandyari @CodeInTheSkies Were you able to get this to work? I am working on a similar problem as well...
Hi all,
Did anyone get this to work? I tried what is suggested in #162 but I get an error when I try to create the newCellDataSet using gaussianff.
I'm working on the same thing and here's what I've found: After importing Seurat object to Monocle, if you check: head(pData(imported_Seurat_object)), there should be a column of the clusters from Seurat. Then you use Seurat's clusters when plotting trajectory by specifying the column of Seurat's clusters: plot_cell_trajectory(imported_Seurat_object, color_by='the column of Seurat's clusters').
Also, I would like to know is it ok to use top 1,000 differentially expressed genes from Seurat's clusters as feature genes in Monocle trajectory analysis using setOrderingFilter() ?
Hi
I'm working on the same thing and here's what I've found: After importing Seurat object to Monocle, if you check: head(pData(imported_Seurat_object)), there should be a column of the clusters from Seurat. Then you use Seurat's clusters when plotting trajectory by specifying the column of Seurat's clusters: plot_cell_trajectory(imported_Seurat_object, color_by='the column of Seurat's clusters').
Also, I would like to know is it ok to use top 1,000 differentially expressed genes from Seurat's clusters as feature genes in Monocle trajectory analysis using setOrderingFilter() ?
Hi qoiopipq,
How to used Seurat pre-calculated reduced dimensions (umap) to do pseudotime in monocle?
Your suggestion is just color the cells in monocle trajectory according to Seurat clustering. However, the umap is different between monocle and Seurat due to the difference in normalization methods and genes selections.
How to make umap between two package consistent with each other? Thanks!
Best, Lei
I have two time point data analysed using Seurat. I have done cell cycle correction and batch correction in Seurat. I would like to use the cell-cycel and batch corrected data to do pseudo time analysis using Monocle. I already have dimension reduced data. Following dataframe shows how my data looks like. Rownames are cell barcodes and columns are dimensions. Is it possible to give such input to Monocle to do pseudo-time analysis?
ACC1 ACC2 ACC3 ACC4 ACC5 AAACCTGAGAGCCTAG 0.2912968 1.9218620 -0.07594450 0.07920177 0.0214002 AAACCTGAGTGGCACA 1.3125555 -1.0346728 0.56284450 0.01348247 -0.1927503 AAACCTGCAATAACGA -0.3517998 -0.7054918 0.21015822 0.75798072 0.2751296 AAACCTGGTAGCTAAA 0.9580736 -0.5992308 0.01396823 0.57237873 -0.1930334
Hi, the following code helped me out:
all_monocle@reducedDimW=t(all@[email protected]) all_monocle@reducedDimS=t(all@[email protected]) all_monocle@reducedDimK=t(all@[email protected])
"all" is the Seurat object and "all_monocle" is the monocle object import from "all" using "importCDS" function.
Best, Lei
I'm working on the same thing and here's what I've found: After importing Seurat object to Monocle, if you check: head(pData(imported_Seurat_object)), there should be a column of the clusters from Seurat. Then you use Seurat's clusters when plotting trajectory by specifying the column of Seurat's clusters: plot_cell_trajectory(imported_Seurat_object, color_by='the column of Seurat's clusters'). Also, I would like to know is it ok to use top 1,000 differentially expressed genes from Seurat's clusters as feature genes in Monocle trajectory analysis using setOrderingFilter() ?
Hi
I'm working on the same thing and here's what I've found: After importing Seurat object to Monocle, if you check: head(pData(imported_Seurat_object)), there should be a column of the clusters from Seurat. Then you use Seurat's clusters when plotting trajectory by specifying the column of Seurat's clusters: plot_cell_trajectory(imported_Seurat_object, color_by='the column of Seurat's clusters'). Also, I would like to know is it ok to use top 1,000 differentially expressed genes from Seurat's clusters as feature genes in Monocle trajectory analysis using setOrderingFilter() ?
Hi qoiopipq,
How to used Seurat pre-calculated reduced dimensions (umap) to do pseudotime in monocle?
Your suggestion is just color the cells in monocle trajectory according to Seurat clustering. However, the umap is different between monocle and Seurat due to the difference in normalization methods and genes selections.
How to make umap between two package consistent with each other? Thanks!
Best, Lei
I used Monocle2 for this. If I remember correctly, Monocle2 doesn't have UMAP for dimension reduction. Maybe you should try asking in Monocle3 User Group. The reason I suggested to use the same color scheme as Seurat, is easier to tell where Seurat's clusters sit along Monocle's trajectories. If everything works fine, same type of cells should next to each other along your trajectories. If you label same type of cells with different colors, it would be very difficult for your interpretation.
Cheers
Hi, @Lei-Tian's code did give me a direct hint, here is some simple change based on Lei's code:
cds@reducedDimW=t(seurat.integrated@[email protected]) cds@reducedDimS=t(seurat.integrated@[email protected]) cds@reducedDimK=t(seurat.integrated@[email protected])
here I usecca.aligned
as cell embeddings, which will retain the structure of umap embeddings by seurat RunUMAP
.
Hope this helps.
An update:
If I use seurat umap's cell embeddings, which will cause a incomplete branch as below:
however, if I use monocle's umap to learn graph, it will traverse the whole data as possible, as below:
@s849 Were you able to get it to work? I had the same exact problem with gaussianff(). Or did you by chance have a way around this? Thanks in advance!