This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Blastn against multiple fna files --neither makeblastdb nor for loop works

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')
done

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,

blast ncbi fna fasta blastn

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.

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

0 answers

No answers yet.

Log in to answer this question.