统计位点测序深度
- 新建文件夹
mkdir depth
- 新建脚本前文件
ls *.bam > flagstat_bam
find *.bam>bam_sample
sed -i "s/.bam/ /g" bam_sample
paste flagstat_bam bam_sample >flagstatbam_list
- 新建脚本
vim depth.sh
cat flagstatbam_list |while read id
do
arr=(${id})
bam=${arr[0]}
sample=${arr[1]}
samtools depth $bam > depth/$sample.depth.txt &
done
- 激活并运行脚本
chmod a+x depth.sh
nohup ./depth.sh
- 进入结果文件夹
cd depth