samtools 速查表
1. samtools view
# SAM 轉 BAM
samtools view -b -t example.fa.fai -o example.bam example.sam.gz
# BAM 轉 SAM
samtools view -h -o example.sam example.bam
# 查看所有比對結果(不含 header)
samtools view example.bam
# 查看所有比對結果(含 header)
samtools view -h example.bam
# 只輸出 BAM 的 header
samtools view -H example.bam
# 提取 chr1 1000000-2000000 的比對結果
samtools view example.bam 1:1000000-2000000 | head
# 根據 BED 檔指定區域提取比對
samtools view -L example.bed example.bam2. samtools flagstat
3. samtools sort
4. samtools index
5. samtools merge
Last updated