美文网首页chip-seq
使用deeptools计算ChIP-seq样本之间的相关性

使用deeptools计算ChIP-seq样本之间的相关性

作者: 尘世中一个迷途小书僮 | 来源:发表于2021-04-20 22:07 被阅读0次

    整理ChIP-seq / CUT & Tag 分析时用到的工具。本文只对使用的工具用法进行简单介绍。

    当我们需要评估ChIP-seq类测序数据的相关性时,deeptools 是一个可行且方便的工具。它提供了一系列方便的命令对高通量测序数据进行分析。本文先集中介绍deeptools中计算ChIP-seq样本间相关性所用到的命令,其余的命令有机会再一一介绍。

    multiBamSummary / multiBigwigSummary

    multiBamSummary / multiBigwigSummary 两个命令可以分别计算 bam/bw 文件在基因组或特定区域测序覆盖度。

    下面的命令将基因组以bin size (eg: 500bp) 为单位分割,计算bam文件在基因组每个bins上的read counts,并以.npz的格式输出,供后面作图使用。另外,使用参数--outRawCounts将read counts保存到文件readCounts.tab

    multiBamSummary bins --bamfiles file1.bam file2.bam -o results.npz -bs <bin size> --outRawCounts readCounts.tab
    

    Example

    使用ENCODE ChIP-Seq 数据作为示例

    $ deepTools2.0/bin/multiBigwigSummary bins \
     -b testFiles/H3K4Me1.bigWig testFiles/H3K4Me3.bigWig testFiles/H3K27Me3.bigWig testFiles/Input.bigWig \
     --labels H3K4me1 H3K4me3 H3K27me3 input \
     -out scores_per_bin.npz --outRawCounts scores_per_bin.tab
    
    $ head scores_per_bin.tab
        #'chr'  'start' 'end'   'H3K4me1'       'H3K4me3'       'H3K27me3'      'input'
        19      0       10000   0.0     0.0     0.0     0.0
        19      10000   20000   0.0     0.0     0.0     0.0
        19      20000   30000   0.0     0.0     0.0     0.0
        19      30000   40000   0.0     0.0     0.0     0.0
        19      40000   50000   0.0     0.0     0.0     0.0
        19      50000   60000   0.0221538461538 0.0     0.00482142857143        0.0522717391304
        19      60000   70000   4.27391282051   1.625   0.634116071429  1.29124347826
        19      70000   80000   13.0891675214   24.65   1.8180625       2.80073695652
        19      80000   90000   1.74591965812   0.29    4.35576785714   0.92987826087
    

    或者对bw 文件进行计算

    multiBigwigSummary bins -b file1.bw file2.bw -o results.npz
    

    plotCorrelation

    plotCorrelation 命令根据multiBamSummary / multiBigwigSummary输出的.npz文件计算样本之间的Pearson or Spearman 相关系数,并进行热图或散点图的绘制。

    还是以上面ENCODE data为例

    $ deepTools2.0/bin/plotCorrelation \
        -in readCounts.npz \
        --corMethod spearman --skipZeros \
        --plotTitle "Spearman Correlation of Read Counts" \
        --whatToPlot heatmap --colorMap RdYlBu --plotNumbers \
        -o heatmap_SpearmanCorr_readCounts.png   \
        --outFileCorMatrix SpearmanCorr_readCounts.tab
    
    $ deepTools2.0/bin/plotCorrelation \
    -in scores_per_transcript.npz \
    --corMethod pearson --skipZeros \
    --plotTitle "Pearson Correlation of Average Scores Per Transcript" \
    --whatToPlot scatterplot \
    -o scatterplot_PearsonCorr_bigwigScores.png   \
    --outFileCorMatrix PearsonCorr_bigwigScores.tab
    

    -in :指定输入的.npz文件 (由multiBamSummary / multiBigwigSummary输出)
    --corMethod:指定相关系数,Pearson or Spearman
    --skipZeros:跳过数据中含0的行计算相关系数
    --whatToPlot:绘制的图的种类,heatmap or scatterplot
    -o:图片输出的名称
    --outFileCorMatrix:输出相关系数矩阵

    以上就是使用deeptools进行ChIP-seq样本间相关性计算的简单整理,关于计算相关系数之间的normalization和相关系数的选择在此不作展开,以后有机会再写一篇来谈吧。

    ref:
    https://deeptools.readthedocs.io/en/develop/content/tools/multiBamSummary.html
    https://deeptools.readthedocs.io/en/develop/content/tools/multiBigwigSummary.html
    https://deeptools.readthedocs.io/en/develop/content/tools/plotCorrelation.html

    完。

    相关文章

      网友评论

        本文标题:使用deeptools计算ChIP-seq样本之间的相关性

        本文链接:https://www.haomeiwen.com/subject/xmrolltx.html