Samtools reheader Numerical result out of range
1
0
Entering edit mode
3.0 years ago
Medhat 9.7k

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

samtools header bam • 1.6k views
ADD COMMENT
2
Entering edit mode
3.0 years ago
Medhat 9.7k

Found it,

The issue is the second pair of the read is aligned to one of the chromosomes that I want to remove.

But the error was not helping.

ADD COMMENT

Login before adding your answer.

Traffic: 1954 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6