使用例
load
suppressPackageStartupMessages(library(Seurat))
suppressPackageStartupMessages(library(SeuratWrappers))
suppressPackageStartupMessages(library(monocle3))
so <- readRDS("*.rds")
cds <- as.cell_data_set(so)
cds <- estimate_size_factors(cds)
cds <- cluster_cells(cds, reduction_method = "UMAP")
cds <- learn_graph(cds, use_partition = T)
plot_cells(cds,
color_cells_by = "partition",
label_principal_point = T,
graph_label_size = 6,
cell_size = .5)
plot_cells(cds,
color_cells_by = "partition",
graph_label_size = 6,
cell_size = 1)
cds <- order_cells(cds, root_pr_nodes = c("Y_*"))
plot_cells(cds,
color_cells_by = "pseudotime",
show_trajectory_graph = T,
graph_label_size = 6,
cell_size = 1
)
genes <- c("Col1a1")
sub_cds <- cds[row.names(cds) %in% genes,]
plot_genes_in_pseudotime(sub_cds, label_by_short_name = F,
color_cells_by="seurat_clusters", min_expr = 0.1)
参考文献