Question: Blastn against multiple fna files --neither makeblastdb nor for loop works
gravatar for Metaxo
15 months ago by
Metaxo0 wrote:

So I have one query sequence that needs to be blasted against over 300 subject fna files. I tried first to concatenate all files into one fna file ( I use cat *.fna > db.fna), and then use makeblastdb to make a database (makeblastdb -in db.fna -dbtype nucl). It does not work and says that BLAST options error:db.fna does not match input format type ,default input type is FASTA It seems stuck here and there's no way to create a database with a concatenated file, but it did work when I tried to use a single file to create database.

I then try to blast then one by one using loop. The code is

for f in *.fna ;
     do blastn  -query('query.fasta') -subject('${f}.fna') -outfmt ('6 delim=,') -out('${f}.csv')

It still didn't work because no file has been generated.

Could anyone point out where the problem might be in both cases?

I was using anaconda powershell but not linux. If nothing works out I will try downloading ncbi in linux then.

Many, many thanks,

blastn fna blast fasta ncbi • 506 views
ADD COMMENTlink modified 14 months ago by h.mon31k • written 15 months ago by Metaxo0

If you’re using BLAST+ it should be as simple as:

blastn -query single.fa -subject multiple.fa -out outputfile.blast

That error for makeblastdb suggests that one or more of your input files isn’t what it seems, and the FASTA format is malformed/broken in some way.

Why are you using the syntax ('....') ? That is not valid shell syntax AFAIK.

ADD REPLYlink modified 15 months ago • written 15 months ago by Joe18k

Thanks! The issue turned out to be that the length of the headers of the fasta files are too long

ADD REPLYlink written 15 months ago by Metaxo0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1734 users visited in the last hour