Entering edit mode
3.7 years ago
Medhat
9.8k
Hi,
I am trying to change the header of a bam file to keep only one chromosome, using the following command:
samtools view -H align.virus.bam | awk '!/^@/ {print} !/^@SQ/ {print} $0 ~ /MN908947.3/' | samtools reheader - align.virus.bam > mybam.bam
The issue is that, when I try to samtools view -h mybam.bam | less
.
I get this error:
samtools view: error reading file "mybam.bam": Numerical result out of range
I am using samtools 1.12
Thanks