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

R包安装
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("chromVAR",force = TRUE)
library(chromVAR)R包的使用
01
计算偏差
chromVAR 会先计算motif和细胞map到peak的片段数量差异以及预期的片段数量。
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或注释在感兴趣的细胞或样本中的变异性。
variability <- computeVariability(dev)
plotVariability(variability, use_plotly = FALSE)
03
聚类
我们还可以使用偏差校正偏差(bias corrected deviations)来聚类样本。函数 getSampleCorrelation 首先删除高度相关的注释和低可变性注释,然后计算剩余注释之间的相关性。
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 来查看细胞相似性
tsne_results <- deviationsTsne(dev, threshold = 1.5, perplexity = 10,
shiny = FALSE)使用 plotDeviationsTsne绘制结果
tsne_plots <- plotDeviationsTsne(dev, tsne_results, annotation = "TEAD3",
sample_column = "Cell_Type", shiny = FALSE)
tsne_plots[[1]]
tsne_plots[[2]]

05
可及性和变异性差异
差分偏差函数确定不同组之间给定注释的偏差校正偏差之间是否存在显着差异
diff_acc <- differentialDeviations(dev, "Cell_Type")
head(diff_acc)
diff_var <- differentialVariability(dev, "Cell_Type")
head(diff_var)
06
motif/kmer
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 来识别染色质可及性变异性所需的精确核苷酸。
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。
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