BLAST against multiple databases and get top hit from each one
1
0
Entering edit mode
7.7 years ago
nancydong20 ▴ 130

Hello everyone!

I have a set of sequences that I want to blast against two other databases and see what the top hit is in each database. Looking around the internet, I have not found an answer for getting the top hit from each database. Is this possible using standalone blast?

Thank you very much!

blast • 2.5k views
ADD COMMENT
0
Entering edit mode

Thank you very much for your answer.

However, what I would like to do is simultaneously blast against two databases, and generate the top hit for EACH database. So that for each query sequence, there are two target sequences, each representing the top hit in each of the two databases.

ADD REPLY
0
Entering edit mode

Please use ADD COMMENT/ADD REPLY when responding to existing posts to keep threads logically organized.

You will have to use a.zielezinski 's solution two times against the two databases to get the information you need.

Unless it is some special case where you always expect the top hits (from two databases) to surface as first two then you could merge your two databases and then select two top hits (but this seems unlikely to be the case).

ADD REPLY
0
Entering edit mode

Okay, thank you very much!

ADD REPLY
0
Entering edit mode

If the solution below is useful then go ahead and "accept" (green check mark) the answer to provide closure to this thread.

ADD REPLY
3
Entering edit mode
7.7 years ago

You can get a single top hit for each of your query sequence. In standalone BLAST+, you just need to add the -max_target_seqs 1 parameter when running BLAST. The parameter defines the maximum number of aligned sequences to keep in output.

For example:

blastp -query yourseqs.fasta -db db1.fasta -max_target_seqs 1 -outfmt 6

Alternatively, you can use --num_alignments 1 and -num_descriptions 1 (number of database sequences to show alignments for).

blastp -query yourseqs.fasta -db db1.fasta -outfmt 6 -num_descriptions 1 -num_alignments 1

UPDATE: As genomax2 suggested, you will have to run BLAST twice one after another (against the two databases).

ADD COMMENT

Login before adding your answer.

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