Blastn against multiple fna files --neither makeblastdb nor for loop works
0
0
Entering edit mode
4.8 years ago
Metaxo • 0

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 • 1.9k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

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