Monocle2: orderCells()
计算每个基因的
pseudotime
require(monocle)
require(Seurat)
require(dplyr)
#-------------------------------------------------------#
#Identify genes for ordering cells, "fullModelFormulaStr=" specify the conditions that we want to dominate the cell trajectory
#Or, we can use the genes identify by other ways
diff_test_res <- differentialGeneTest(Monocle2_object, fullModelFormulaStr = "~Media") #In this case, "Media" is condition that we want to dominate the cell trajectory
trajectory_ordering_genes <- row.names (subset(diff_test_res, qval < 0.01))
#-------------------------------------------------------#
#Set the highly variable genes for dimension reduction
Monocle2_object <- setOrderingFilter(Monocle2_object, ordering_genes=trajectory_ordering_genes)
#-------------------------------------------------------#
#Dimension reduction by PCA, then other method based on PCA results
#For pseudotime calculation, the dimension reduction method "DDRTree" is recommended
Monocle2_object <- reduceDimension(Monocle2_object, max_components = 2, num_dim = 6, reduction_method = 'DDRTree', verbose = T)
#-------------------------------------------------------#
#Order cells (calculate pseudotime) by dimension reduction results (not PCA) produced by reduceDimension()
Monocle2_object <- orderCells(Monocle2_object, num_paths=1)
#-------------------------------------------------------#
#Show the dimention reduction and pseudotime results
plot_cell_trajectory(Monocle2_object)
共有 0 条评论