Fasta file is not converting properly to Indexed Fasta File
2
0
Entering edit mode
20 months 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.

enter image description here

Jbrowse2 Samtools Fasta • 1.2k views
ADD COMMENT
3
Entering edit mode
20 months 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.

ADD COMMENT
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

ADD REPLY
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?

ADD REPLY
0
Entering edit mode
7 months ago
cmdcolin ★ 3.8k

just for "extra jbrowse 2 context" after running the samtools faidx command you can then run

jbrowse add-assembly yourfile.fasta --out output_directory --load copy

this will create a config.json in a folder named "output_directory" and also copy the yourfile.fasta and yourfile.fasta.fai to the output_directory folder

ADD COMMENT

Login before adding your answer.

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