首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >chromVAR:预测转录因子相关的开放区域

chromVAR:预测转录因子相关的开放区域

作者头像
作图丫
发布2022-03-28 15:49:52
发布2022-03-28 15:49:52
3.1K0
举报
文章被收录于专栏:作图丫作图丫

导语

GUIDE ╲

chromVAR 是一个用于分析稀疏染色质可及性的 R 包

背景介绍

chromVAR 是一个 R 包,于2017年发表于Nature Methods上,用于分析来自单细胞或bulk ATAC 或 DNAse-seq 数据的稀疏染色质可及性数据。该软件包旨在识别与单个细胞或样品之间染色质可及性的可变性相关的基序或其他基因组注释。

R包安装

代码语言:javascript
复制
if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
BiocManager::install("chromVAR",force = TRUE)
library(chromVAR)

R包的使用

01

计算偏差

chromVAR 会先计算motif和细胞map到peak的片段数量差异以及预期的片段数量。

代码语言:javascript
复制
library(chromVAR)
library(motifmatchr)
library(SummarizedExperiment)
library(Matrix)
library(ggplot2)
library(BiocParallel)
library(BSgenome.Hsapiens.UCSC.hg19)
library(JASPAR2016)
##多核操作
register(SerialParam())
##加载数据
data(example_counts, package = "chromVAR")
set.seed(2017)
##计算GC含量
example_counts <- addGCBias(example_counts, genome = BSgenome.Hsapiens.UCSC.hg19)
##过滤peak
counts_filtered <- filterSamples(example_counts, min_depth = 1500, 
                                 min_in_peaks = 0.15, shiny = FALSE)
counts_filtered <- filterPeaks(counts_filtered)
##match motif计算
motifs <- getJasparMotifs()
motif_ix <- matchMotifs(motifs, counts_filtered, genome = BSgenome.Hsapiens.UCSC.hg19)
##计算偏差
dev <- computeDeviations(object = counts_filtered, 
                         annotations = motif_ix)

02

变异性

使用函数plotVariability计算每个motif或注释在感兴趣的细胞或样本中的变异性。

代码语言:javascript
复制
variability <- computeVariability(dev)
plotVariability(variability, use_plotly = FALSE)

03

聚类

我们还可以使用偏差校正偏差(bias corrected deviations)来聚类样本。函数 getSampleCorrelation 首先删除高度相关的注释和低可变性注释,然后计算剩余注释之间的相关性。

代码语言:javascript
复制
sample_cor <- getSampleCorrelation(dev)
library(pheatmap)
pheatmap(as.dist(sample_cor), 
         annotation_row = colData(dev), 
         clustering_distance_rows = as.dist(1-sample_cor), 
         clustering_distance_cols = as.dist(1-sample_cor))

04

细胞/样本之间相似性

我们还可以使用 tSNE 来查看细胞相似性

代码语言:javascript
复制
tsne_results <- deviationsTsne(dev, threshold = 1.5, perplexity = 10, 
                               shiny = FALSE)

使用 plotDeviationsTsne绘制结果

代码语言:javascript
复制
tsne_plots <- plotDeviationsTsne(dev, tsne_results, annotation = "TEAD3", 
                                   sample_column = "Cell_Type", shiny = FALSE)
tsne_plots[[1]]
tsne_plots[[2]]

05

可及性和变异性差异

差分偏差函数确定不同组之间给定注释的偏差校正偏差之间是否存在显着差异

代码语言:javascript
复制
diff_acc <- differentialDeviations(dev, "Cell_Type")
head(diff_acc)
代码语言:javascript
复制
diff_var <- differentialVariability(dev, "Cell_Type")
head(diff_var)

06

motif/kmer

代码语言:javascript
复制
inv_tsne_results <- deviationsTsne(dev, threshold = 1.5, perplexity = 8, 
                                    what = "annotations", shiny = FALSE)

ggplot(inv_tsne_results, aes(x = Dim1, y = Dim2)) + geom_point() + 
  chromVAR_theme()

07

kmers and sequence specificity of variation

使用 kmers 作为注释,可以使用 kmers 来识别染色质可及性变异性所需的精确核苷酸。

代码语言:javascript
复制
inv_tsne_results <- deviationsTsne(dev, threshold = 1.5, perplexity = 8, 
                                    what = "annotations", shiny = FALSE)

ggplot(inv_tsne_results, aes(x = Dim1, y = Dim2)) + geom_point() + 
  chromVAR_theme()

08

De novo kmer assembly

使用 assembleKmers 函数使用 kmer 偏差结果构建 de novo motif。

代码语言:javascript
复制
de_novos <- assembleKmers(kmer_dev, progress = FALSE) #no progress bar
de_novos
dist_to_known <- pwmDistance(de_novos, motifs)
closest_match1 <- which.min(dist_to_known$dist[1,])
dist_to_known$strand[1,closest_match1]
library(ggmotif) # Package on github at AliciaSchep/ggmotif. Can use seqLogo alternatively
library(TFBSTools)
ggmotif_plot(de_novos[[1]])

文章参考:①https://greenleaflab.github.io/chromVAR/index.html

②https://zhuanlan.zhihu.com/p/57516178

小编总结

chromVAR的输入文件包括,ATAC-seq处理后的fragments文件(过滤重复和低质量数据), DNAse-seq实验结果,以及基因组注释(例如motif位置)。R包的使用整体来说还是很简单的,大家可以自己动手开发更多功能哟

END

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2021-06-23,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作图丫 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档