This is a test version of Biostars. For the public version, visit https://www.biostars.org.
samtools: Numerical result out of range

I am working with a SAM file (created with hisat2) with header:

@SQ     SN:chr1A        LN:594006513
@SQ     SN:chr1B        LN:693261537
...

When doing sorting and indexing, I get this error with samtools:

[E::hts_idx_check_range] Region 536907741..536907892 cannot be stored in a bai index. Try using a csi index with min_shift = 14, n_lvls >= 6
[E::sam_index] Read 'read_id' with ref_name='chr1A', ref_length=594006513, flags=16, pos=536907742 cannot be indexed
samtools index: failed to create index for "test.bam": Numerical result out of range

However the read falls inside the chr1A ref sequence. Any ideas why this happens? Thanks

samtools

1 answer

you cannot use a BAI index for a reference length > 512Mb in length. see samtools 1.0 'index' : CSI index vs BAI index ?

Log in to answer this question.