https://blog.csdn.net/liangbilin/article/details/108977163
samtools view -H test.bam | sed -e ‘s/SN:([0-9XY])/SN:chr\1/’ -e ‘s/SN:MT/SN:chrM/’ | samtools reheader - test.bam > test.CHR.bam
报错
采用 转sam 删除
samtools view *.bam -O SAM > *.sam
sed
再转bam
报错
when I use the command 'samtools view -bS GSM653001_BMM_KO_aligned.SAM > GSM653001_BMM_KO_aligned.bam'
I got an error as follows:
[E::sam_parse1] missing SAM header
[W::sam_read1] Parse error at line 3
[main_samview] truncated file.
https://github.com/samtools/samtools/issues/993
加-t??
samtools view -@ 16 -b -S .sam -t ref.len -o .bam