This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error while doing indexing of fasta file using SAMTOOL faidx

I am trying to do indexing of a CDS fasta file, I am geeting error:

[root@psgl BWA]# /home/yog/software/samtools-1.3.1/samtools faidx Radish_cds.fasta
[fai_build_core] different line length in sequence 'Rs276960'.
Could not build fai index Radish_cds.fasta.fai

Please suggest how I can resolve it.

Yogesh

rna-seq

Did you take a look at that sequence in question? It may be just a case of a broken fasta record.

2 answers

The error looks pretty clear - Your sequences may be of unequal length in different lines. Why an indexer does not auto-normalize (or at least provide an option for it), I do not know.

Try using NormalizeFasta on the file before indexing it.

SeqKit

seqkit seq -w 70 s.fa > s2.fa

Log in to answer this question.