This is a test version of Biostars. For the public version, visit https://www.biostars.org.
cant make index file for Wheat accepted_hits.bam file

hi i want to make index file for my accepted_hits.bam file (from tophat2) i use this:

samtools index x.bam

but i see an error that say samtools cant make x.bai index and just samtools can make x.csi index by

samtools index -c x.bam

how i can make index file x.bai (bai)

error is this:

[E::hts_idx_check_range] Region 536882696..536884035 cannot be stored in a bai index. Try using a csi index with min_shift = 14, n_lvls >= 6
[E::sam_index] Read 'A00783:167:HTLJ3DSXX:3:1427:30798:14309' with ref_name='1A', ref_length=594102056, flags=385, pos=536882697 cannot be indexed
samtools index: failed to create index for "19358.bam": Numerical result out of range
rna-seq sequencing rna-seq

1 answer

Some of your chromosomes are probably too long for the default bai index, see Error when trying to sort unmapped reads in samtools. so you have to use the suggested csi index.

thank you yes wheat has big genome and i just sort mapped reads.

how can i change bai index parameters?

Did you read my answer? Bai is not compatible with very large chromosomes, it is not possible to build a bai index. You can only use csi.

Log in to answer this question.