deeptols 畫圖工具 使用方法與代碼

deeptols 畫圖工具 使用方法與代碼

deeptools 使用

安裝:conda install -y deeptools

使用:

1、將bam文件轉為bw格式的文件

(1)先給bam文件排序:

samtools sort SRRxxx.bam -o SRRxxx_sorted.bam

(2)給排序之后的bam文件建索引

samtools index SRRxxx_sorted.bam


(3)將排序之后的bam文件轉換為bw格式

bamCoverage --normalizeUsing CPM -b SRRxxx_sorted.bam -o SRRxxx.bw


多個文件:

ls *sorted.bam | cut -d"_"? -f 1 | while read id ;do bamCoverage --normalizeUsing CPM -b ${id}_sorted.bam -o ./bw/${id}.bw; done

1

2、使用macs2將bam文件轉換生成bed文件

安裝:conda install -c bioconda macs2

使用:

單個文件:

macs2 callpeak -t ./SRRxxx_sorted.bam -f BAM -g 1.87e9 -n SRRxxx -B -q 0.01 --nomodel --extsize 147

1

出現這個錯誤時,在命令行里面加上 –nomodel 和 –extsize 147 (數字為固定的)兩個參數即可


多個文件:

ls *sorted.bam | cut -d"_"? -f 1 | while read id ;do macs2 callpeak -t ./${id}_sorted.bam -f BAM -g 1.87e9 -n ./bed/${id} -B -q 0.01 --nomodel --extsize 147; done

3、作圖

單個文件:

熱圖:

computeMatrix reference-point -S SRR.bw -R ./Macs2/SRR_summits.bed --referencePoint TSS -a 2000 -b 2000 -out SRR_TSS.gz


plotHeatmap -m SRR_TSS.gz -out SRR_TSS.png --heatmapHeight 15 --refPointLabel enh.center --regionsLabel enhancers --plotTitle '圖片名稱'


多個文件:

computeMatrix reference-point -S ./bw/H3K4Me1-Input.bw? ./bw/H3K4Me3-Input.bw? ./bw/H3K27Me3-input.bw? -R ./bed/genes19.bed? ./bed/genex.bed --referencePoint TSS -a 3000 -b 3000 -out TSS.gz


熱圖:

plotHeatmap -m TSS.gz -out ExampleHeatmap1.png

plotHeatmap -m TSS.gz -out hm_DNase_ESC.png --heatmapHeight 10 --refPointLabel enh.center --regionsLabel enhancers --plotTitle 'DNase signal'


根據bam文件畫圖

plotProfile -m TSS.gz -out ExampleProfile1.png? --numPlotsPerRow 2 --plotTitle "Test data profile"


根據基因畫圖

plotProfile -m TSS.gz -out ExampleProfile2.png --plotType=fill? --perGroup --colors red yellow blue --plotTitle "Test data profile"


聚類畫圖:

plotProfile -m TSS.gz? --perGroup --kmeans 2? -out ExampleProfile3.png


熱圖:

plotProfile -m TSS.gz? --perGroup --kmeans 2? --plotType heatmap -out ExampleProfile4.png


PCA圖等:

multiBamSummary bins --bamfiles ./sort/*_sorted.bam --minMappingQuality 30 --region 19 --labels H3K27me3 H3K4me1 H3K4me3 input -out readCounts.npz --outRawCounts readCounts.tab


利用上面輸出的結果作圖:

1、

plotCorrelation -in ./mul/readCounts.npz? --corMethod spearman --skipZeros --plotTitle "Spearman Correlation of Read Counts" --whatToPlot heatmap --colorMap RdYlBu --plotNumbers -o heatmap_readCounts.png? --outFileCorMatrix SpearmanCorr_readCounts.tab



plotPCA -in ./mul/readCounts.npz -o PCA_readCounts.png -T "PCA of read counts"


3、

plotFingerprint -b ./*_sorted.bam --labels H3K27me3 H3K4me1 H3K4me3 input --minMappingQuality 30 --skipZeros --region 19 --numberOfSamples 50000 -T "Fingerprints of different samples"? --plotFile fingerprints.png --outRawCounts fingerprints.tab


?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容