monocle3系列之六:共调控基因模块 - 简书 (jianshu.com)
monocle3系列之五:差异基因分析 - 简书 (jianshu.com)
monocle3系列之四:构建轨迹 - 简书 (jianshu.com)
monocle3系列之三:聚类 - 简书 (jianshu.com)
monocle3系列之二:数据载入 - 简书 (jianshu.com)
monocle3系列之一:安装 - 简书 (jianshu.com)
monocle是非常经典的轨迹分析工具,使用起来也非常简单,现将基本流程总结如下:
## Step 1: load data
cds <- new_cell_data_set(expression_matrix,
cell_metadata = cell_metadata,
gene_metadata = gene_annotation)
## Step 2: Normalize and pre-process the data
cds <- preprocess_cds(cds, num_dim = 100)
## Step 3: Remove batch effects with cell alignment
cds <- align_cds(cds, alignment_group = "batch")
## Step 4: Reduce the dimensions using UMAP
cds <- reduce_dimension(cds)
## Step 5: Cluster the cells
cds <- cluster_cells(cds)
## Step 6: Learn a graph
cds <- learn_graph(cds)
## Step 7: Order cells
cds <- order_cells(cds)
## Step 8: Perform differential expression analysis
## With regression:
gene_fits <- fit_models(cds, model_formula_str = "~embryo.time")
fit_coefs <- coefficient_table(gene_fits)
emb_time_terms <- fit_coefs %>% filter(term == "embryo.time")
emb_time_terms <- emb_time_terms %>% mutate(q_value = p.adjust(p_value))
sig_genes <- emb_time_terms %>% filter (q_value < 0.05) %>% pull(gene_short_name)
## With graph autocorrelation:
pr_test_res <- graph_test(cds, neighbor_graph="principal_graph", cores=4)
pr_deg_ids <- row.names(subset(pr_test_res, q_value < 0.05))
## Step 9: Plot the dynamics of genes as a function of pseudotime
AFD_genes <- c("gcy-8", "dac-1", "oig-8")
AFD_lineage_cds <- cds[rowData(cds)$gene_short_name %in% AFD_genes,
colData(cds)$cell.type %in% c("AFD")]
AFD_lineage_cds <- order_cells(AFD_lineage_cds)
plot_genes_in_pseudotime(AFD_lineage_cds,
color_cells_by="embryo.time.bin",
min_expr=0.5)