2
$\begingroup$

I want to merge/concatenate BLAST databases as suggested here.

This is my example script that explains what I'm trying to achieve better than words can:

#!/bin/bash

for file in FAM1079.ffn FAM3228.ffn FAM6161.ffn FAM19036.ffn
do
    echo "## Make DB for $file"
	makeblastdb -in $file -dbtype nucl &>/dev/null
    blastn -db $file  -query query_single_nucl.fasta -outfmt 6
    echo
done

echo "## Create testdb.nal..."
blastdb_aliastool -dblist "FAM1079.ffn FAM3228.ffn FAM6161.ffn FAM19036.ffn" -dbtype nucl -title test -out testdb

echo
echo "## Test testdb.nal..."
blastn -db testdb.nal -query query_single_nucl.fasta -outfmt 6

This is the output:

## Make DB for FAM1079.ffn
test_query  FAM1079_00001   100.000 1266    0   0   1   1266    1   1266    0.0 2338

## Make DB for FAM3228.ffn
test_query  FAM3228_000001  100.000 1266    0   0   1   1266    1   1266    0.0 2338

## Make DB for FAM6161.ffn
test_query  FAM6161_000001  100.000 1266    0   0   1   1266    1   1266    0.0 2338

## Make DB for FAM19036.ffn
test_query  FAM19036p_000001    100.000 1266    0   0   1   1266    1   1266    0.0 2338

## Create testdb.nal...
Created nucleotide BLAST (alias) database testdb with 12692 sequences

## Test testdb.nal...
BLAST Database error: No alias or index file found for nucleotide database [testdb.nal] in search path [/path/to/files::]

While the individual databases work, the concatenated databases don't.

$\endgroup$

1 Answer 1

2
$\begingroup$

The problem was that the database must be specified without suffix, i.e. blastn -db testdb as opposed to blastn -db testdb.nal.

By the way, it produces exactly the same output as

blastn -db "FAM1079.ffn FAM3228.ffn FAM6161.ffn FAM19036.ffn" -query query_single_nucl.fasta -outfmt 6

and the performance is not better.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.