美文网首页
Bam to bw and metaplot

Bam to bw and metaplot

作者: 余绕 | 来源:发表于2022-03-31 15:10 被阅读0次

1. index bam files

for file in ~/chipseq/results/bowtie2/*aln.bam
do
samtools index $file
done

2. Bam to be files

a. Direct conversion (no input)
bamCoverage -b bowtie2/H1hesc_Nanog_Rep2_aln.bam \
-o visualization/bigWig/H1hesc_Nanog_Rep2.bw \
--binSize 20 \
--normalizeUsing BPM \
--smoothLength 60 \
--extendReads 150 \
--centerReads \
-p 6 2> ../logs/Nanog_rep2_bamCoverage.log
b. Normalization with input
bamCompare -b1 bowtie2/H1hesc_Pou5f1_Rep1_aln.bam \
-b2 bowtie2/H1hesc_Input_Rep1_chr12_aln.bam \
-o visualization/bigWig/H1hesc_Pou5f1_Rep1_bgNorm.bw \
--binSize 20 \
--normalizeUsing BPM \
--smoothLength 60 \
--extendReads 150 \
--centerReads \
-p 6 2> ../logs/Pou5f1_rep1_bamCompare.log

3. Profile plots and heatmaps

a: Creat intermediate .gz files

computeMatrix reference-point --referencePoint TSS \
-b 1000 -a 1000 \
-R ~/chipseq/results/visualization/chr12_genes.bed \
-S /n/groups/hbctraining/chip-seq/full-dataset/bigWig/Encode_Nanog*.bw \
--skipZeros \
-o ~/chipseq/results/visualization/matrixNanog_TSS_chr12.gz \
-p 6 \
--outFileSortedRegions ~/chipseq/results/visualization/regions_TSS_chr12.bed

b. Plot the metablots---Reference point

plotProfile -m visualization/matrixNanog_TSS_chr12.gz \
-out visualization/figures/TSS_Nanog_profile.png \
--perGroup \
--colors green purple \
--plotTitle "" --samplesLabel "Rep1" "Rep2" \
--refPointLabel "TSS" \
-T "Nanog read density" \
-z ""
image.png
Alternatively, we could use a heatmap to evaluate the same matrix of information:
 plotHeatmap -m visualization/matrixNanog_TSS_chr12.gz \
-out visualization/figures/TSS_Nanog_heatmap.png \
--colorMap RdBu \
--whatToShow 'heatmap and colorbar' \
--zMin -4 --zMax 4  
image.png
If we wanted both images in one single plot, we can do that with plotHeatmap and just removing the --whatToShow parameter.
plotHeatmap -m visualization/matrixPou5f1_TSS_chr12.gz \
-out visualization/figures/TSS_Pou5f1_profile-heatmap.png \
--colorMap RdBu \
--zMin -2 --zMax 2  
image.png

c. Plot the metablots---Scaled region

 computeMatrix scale-regions \
-R ~/chipseq/results/visualization/Nanog_enriched.bed \
-S /n/groups/hbctraining/chip-seq/full-dataset/bigWig/Encode_Pou5f1*.bw /n/groups/hbctraining/chip-seq/full-dataset/bigWig/Encode_Nanog*.bw \
--skipZeros \
-p 6 \
--regionBodyLength 2000 \
-a 500 -b 500 \
-o ~/chipseq/results/visualization/matrixAll_Nanog_binding_sites.gz


 plotProfile -m visualization/matrixAll_Nanog_binding_sites.gz \
-out visualization/figures/Allsamples_NanogSites_profile.png \
--perGroup  --plotTitle "" \
--samplesLabel "Pou5f1-Rep1" "Pou5f1-Rep2" "Nanog-Rep1" "Nanog-Rep2" \
-T "Nanog only binding sites"  -z "" \
--startLabel "" \
--endLabel "" \
--colors red red darkblue darkblue
Note: Here enriched region were selected. We can also use the bed files of all genes to get a genome wide metaplot
image.png

Ref to:https://hbctraining.github.io/Intro-to-ChIPseq/lessons/10_data_visualization.html

相关文章

  • Bam to bw and metaplot

    1. index bam files 2. Bam to be files a. Direct conversio...

  • bam2bw

    ref:bam2bw,上传ucsc可视化 - 简书 deeptools Installation conda in...

  • day25 ChIP-seq IGV可视化

    一、用deeptools从bam转换为bw(接续day23) 1. 安装 pip install deeptool...

  • IGV做基因峰图

    IGV打开整个bw或者bam文件特别大,从服务器下到本地再拖进去IGV会比较麻烦 使用samtools裁剪该基因制...

  • Deeptools使用

    安装 计算覆盖度,生成npz文件 相关性散点图 相关性热图 PCA图 指纹图 把bam文件转化为bw文件,标准化产...

  • windows IGV下载和常见的打开报错原因

    IGV bam、bw等文件的可视化用IGV或者在线基因组浏览器所以IGV的作用就是:可视化,类似基因组浏览器! 软...

  • Metaplot绘制

    1. Make the Binned Bed file. The bed file should be don...

  • matlab 霍夫检测

    %霍夫检测 BW=imread('lexp_1_2.bmp'); BW=rgb2gray(BW); thresh=...

  • bam2bw,上传ucsc可视化

    首先用tophat,hisat等比对软件生成BAM文件然后用deeptoos转化 deeptools Instal...

  • 使用deeptools将bam文件转换为bw文件

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

网友评论

      本文标题:Bam to bw and metaplot

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