how to generate a bai ?
1
0
Entering edit mode
4.9 years ago
manubiomed20 ▴ 10

I made a complete genome assembly and then tried to generate a bai using this command (with the file path):

samtools index /home/ims.santos06/bam/SRR062634.bam/home/ims.santos06/bam/SRR062634.bam.bai

but it did not work because of this error:

[E :: hts_idx_push] Unsorted positions on sequence # 6: 68538456 followed by 68538386
samtools index: failed to create index for "/home/ims.santos06/bam/SRR062634.bam".

Was it a mistake in the assembly? How do I solve this problem?

assembly • 1.5k views
ADD COMMENT
0
Entering edit mode

A message to both manubiomed20 and darbinator :

Please use the formatting bar (especially the code option) to present your post better. You can use backticks for inline code (`text` becomes text), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.
code_formatting

ADD REPLY
0
Entering edit mode

Indexing automatically generates a file which ends in .bai and uses the name of the BAM file you used as an input for samtools index.

ADD REPLY
3
Entering edit mode
4.9 years ago
vin.darb ▴ 300

You need to sort your alignments files before to index them:

samtools sort yourfile.bam > yourfile.sorted.bam
ADD COMMENT

Login before adding your answer.

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