monocle3系列之七:總結(jié)

monocle3系列之六:共調(diào)控基因模塊 - 簡書 (jianshu.com)
monocle3系列之五:差異基因分析 - 簡書 (jianshu.com)
monocle3系列之四:構(gòu)建軌跡 - 簡書 (jianshu.com)
monocle3系列之三:聚類 - 簡書 (jianshu.com)
monocle3系列之二:數(shù)據(jù)載入 - 簡書 (jianshu.com)
monocle3系列之一:安裝 - 簡書 (jianshu.com)

monocle是非常經(jīng)典的軌跡分析工具,使用起來也非常簡單,現(xiàn)將基本流程總結(jié)如下:

## 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)
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

推薦閱讀更多精彩內(nèi)容