Fail to generate .bai index with samtools
1
0
Entering edit mode
5.6 years ago
bing.bai • 0

I am using

samtools index -b A.bam

to generate .bai indx file but I always get A.csi format index file.

Anything wrong with it?

Assembly RNA-Seq alignment • 2.3k views
ADD COMMENT
0
Entering edit mode

What's your samtools version? I went through all of samtools versions, none of them produce csi files unless asked for with the -c parameter. Maybe there's an alias interfering with your command?

Also, even if you got the csi file, it should be A.bam.csi, not A.csi. Are you sure the csi file is being produced by the samtools command you're running?

ADD REPLY
0
Entering edit mode

yes, it's A.bam.csi, Here is the version Program: samtools (Tools for alignments in the SAM format) Version: 1.7 (using htslib 1.7-2) Here is the exact command I used

samtools index -b bai_R1_trimmed20-3.bam -m 18

I got bai_R1_trimmed20-3.bam.csi

ADD REPLY
0
Entering edit mode

Are you using a very large genome for these alignments? What happens if you don't use -m 18? Setting that may be leading to .csi indexes.

ADD REPLY
0
Entering edit mode

really? I use that cause I have large dataset to process. Will try without.

ADD REPLY
0
Entering edit mode
5.6 years ago
GenoMax 147k

If you meant to use more threads (cores) then that option is -@ INT Sets the number of threads [none].

e.g. samtools index -@ 12 -b bai_R1_trimmed20-3.bam

ADD COMMENT
0
Entering edit mode

Nice, it works. indeed -m has an effect on the output format. don't know why though;). Thanks.

ADD REPLY
0
Entering edit mode

By using -m you indirectly instructed samtools to create .csi indexes, since that option only applies to those.

ADD REPLY
0
Entering edit mode

Hello bing.bai ,

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one if they work.
Upvote|Bookmark|Accept

ADD REPLY

Login before adding your answer.

Traffic: 1671 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