生信人

找回密码
立即注册
搜索
热搜: 活动 交友 discuz
发新帖

0

收听

12

听众

279

主题
发表于 2022-8-2 14:59:41 | 查看: 546| 回复: 0
本帖最后由 生信喵 于 2022-8-2 18:04 编辑

一、软件介绍
1.1 monocel3
       Monocel3是单细胞分析领域一个重要的R 包,它是之前 Monocel和 Monocel2的升级版本,之前的 Monocel2 主要用于单细胞拟时分析。而新版本的 Monocel3 在原有基础上,还可以进行聚类,单细胞亚型分类,细胞注释,拟时分析,基因表达等分析。包含了 Seurat+SingleR 的功能,可以说一个 R 包可以完成单细胞数据分析绝大部分的功能。使用同一个 R 包分析起来更加方便。
       目前 monocel3 已经取代了之前的 monocel2,不过目前仍处于开发版,还有很多功能在完善过程中。
Monocle3 主要有三大功能,
       1. 分群、计数细胞 Clustering, classifying, and counting cells
       2. 构建细胞轨迹 Constructing single-cell trajectories.
       3. 差异表达分析 Differential expression analysis.
       官网:https://cole-trapnell-lab.github.io/monocle3/
       帮助文档:https://cole-trapnell-lab.github.io/monocle3/docs/introduction/
       文章:https://cole-trapnell-lab.github.io/monocle3/papers/

1.2 monocel3 升级功能
       相比于 monocel2,新版软件主要做了以下升级。https://cole-trapnell-lab.github.io/monocle3/docs/updates/
       1、A better structured workflow to learn developmental trajectories.一个更好的构建分化轨迹的方法
       2、Support for the UMAP algorithm to initialize trajectory inference.支持 UMAP 推断发育轨迹
       3、Support for trajectories with multiple roots.支持多个祖源(toots)的发育推断
       4、Ways to learn trajectories that have loops or points of convergence.Algorithms that automatically partition cells to learn disjoint or parallel trajectories using ideas from "approximate graph abstraction".增加 approximate graph abstraction 理解各条发育轨迹的分离及平行发育的轨迹。
       5、A new statistical test for genes that have trajectory-dependent expression. This replaces both the old differentialGeneTest() function and BEAM().新的轨迹依赖表达基因分析方法:替换 monocle2 中的 differalgenetest()函数和 BEAM()
       6、Project query data set onto a reference.整合数据集分析;
       7、Transfer annotations to query data set from reference.直接将注释结果转换为模板,用于新细胞鉴定;
       8、Save and load Monocle objects and transformation models.增加 save_monocle_objects 和 load_monocle_objects 函数保存结果。
       9、Mixed negative binomial distribution for fit_models.支持负二项分布模型
       10、A 3D interface to visualize trajectories and gene expression.支持 3D 视图可视化轨迹分析和基因差异表达分析结果。
       总而言之,QC,聚类,亚群鉴定,细胞轨迹分析等Monocel3都可以完成。

1.3 软件安装
软件是一个 R 包,有多种方式进行安装,下面推荐三种安装方法,适应不同的使用情况。
方法一:Bioconductor 安装
  1. #安装一些依赖包
  2. BiocManager::install(c('BiocGenerics', 'DelayedArray', 'DelayedMatrixStats',
  3.                        'limma', 'lme4', 'S4Vectors', 'SingleCellExperiment',
  4.                        'SummarizedExperiment', 'batchelor', 'Matrix.utils',
  5.                        'HDF5Array', 'terra', 'ggrastr'),lib = "/opt/R/4.2.1/lib/R/library",destdir = '/home/xhs/Rpack/download')
复制代码
方法二:通过 github 安装
  1. install.packages("devtools")
  2. devtools::install_github('cole-trapnell-lab/monocle3')
复制代码
如果网络无法连接到 github,可以将安装包下载到本地,然后本地安装。
  1. #下载 github 软件包,本地安装
复制代码
方法三:利用 bioconda 安装
  1. conda install -c bioconda r-monocle3
复制代码

1.4 分析流程

monocle3 分析流程图
Monocle 包数据分析主要包含以下过程:
1、读入数据,保存为 cell_data_set 类;
  1. cds <- new_cell_data_set(expression_matrix,
  2. cell_metadata = cell_metadata,
  3. gene_metadata = gene_annotation)
  4. ## Step 1: Normalize and pre-process the data
  5. cds <- preprocess_cds(cds, num_dim = 100)
复制代码
2、(可选的)移除批次效应;

  1. ## Step 2: Remove batch effects with cell alignment
  2. cds <- align_cds(cds, alignment_group = "batch")
复制代码
3、细胞聚类;

  1. ## Step 3: Reduce the dimensions using UMAP
  2. cds <- reduce_dimension(cds)
  3. ## Step 4: Cluster the cells
  4. cds <- cluster_cells(cds)
复制代码
4、(可选的)细胞排序进行拟时分析

  1. ## Step 5: Learn a graph
  2. cds <- learn_graph(cds)
  3. ## Step 6: Order cells
  4. cds <- order_cells(cds)
  5. plot_cells(cds)
复制代码
5、差异表达分析
  1. # With regression:
  2. gene_fits <- fit_models(cds, model_formula_str = "~embryo.time")
  3. fit_coefs <- coefficient_table(gene_fits)
  4. emb_time_terms <- fit_coefs %>% filter(term == "embryo.time")
  5. emb_time_terms <- emb_time_terms %>% mutate(q_value = p.adjust(p_value))
  6. sig_genes <- emb_time_terms %>% filter (q_value < 0.05) %>% pull(gene_short_name)
  7. # With graph autocorrelation:
  8. pr_test_res <- graph_test(cds, neighbor_graph="principal_graph", cores=4)
  9. pr_deg_ids <- row.names(subset(pr_test_res, q_value < 0.05))
复制代码


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

您需要登录后才可以回帖 登录 | 立即注册

QQ|Archiver|手机版|小黑屋|生信人

GMT+8, 2024-5-4 20:39 , Processed in 0.048679 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表