Fasta file is not converting properly to Indexed Fasta File
1
0
Entering edit mode
5 weeks ago
Maliha ▴ 20

I am trying to set up an assembly in Jbrowse2. For that, I need an indexed Fasta file. I am using the following command line to convert my Fasta file to an indexed Fasta file.

samtools faidx /home/maliha/Downloads/jbrowse2/sequence.fasta


However, I got an indexed Fasta file containing just one line. I have attached the picture of that line to this post. Please do help me to figure out the problem.

Fasta IndexedFasta Samtools Jbrowse2 • 309 views
2
Entering edit mode
5 weeks ago

How many contigs do you have in your fasta file?

Samtools faidx doesn't convert a fasta file into an indexed fasta, it produced an index file to be used alongside your fasta file. For a one contig fasta file, your index looks as expected.

0
Entering edit mode

Seconding this, you can also read a bit more about this here. You can check which contigs are in your file by looking for lines starting with ">". In your example above we'd expect to find just one line, starting with "> U00096.3"

You can do that on the command line using grep, e.g. grep "^>" fasta.file More details on grep here

0
Entering edit mode

U00096 appears to be E. coli so one entry in the index file is ok. @Maliha: well behaved tools give an error message if something goes wrong - I suppose you didn't get any from samtools faidx?