Searching blast+ local database
1
0
Entering edit mode
7.2 years ago
jeevansai502 ▴ 10

I am creating a local blast database using blast+ command line tool ,is there any command so that i can search for a sequence in my database using accession id or name.

blast blast+ • 2.6k views
ADD COMMENT
1
Entering edit mode
7.2 years ago
GenoMax 147k

Use blastdbcmd with your local database. Adjust outfmt. Use %a if you just need to see accession number.

blastdbcmd -db your_database_name -entry your_accession_of_interest -outfmt "%f"
ADD COMMENT
0
Entering edit mode

You can also search for / retrieve particular entries with -entry or -entry_batch:

 -entry <String>
   Comma-delimited search string(s) of sequence identifiers:
    e.g.: 555, AC147927, 'gnl|dbname|tag', or 'all' to select all
    sequences in the database
    * Incompatible with:  entry_batch, pig, info, list, recursive,
   remove_redundant_dbs, list_outfmt, show_blastdb_search_path
 -entry_batch <File_In>
   Input file for batch processing (Format: one entry per line, seq id 
   followed by optional space-delimited specifier(s)
   [range|strand|mask_algo_id]
    * Incompatible with:  entry, range, strand, mask_sequence_with, pig, info,
   list, recursive, remove_redundant_dbs, list_outfmt,
   show_blastdb_search_path
ADD REPLY
0
Entering edit mode

But it allows me to search by accession number is there any way where i can search by name or length of sequence.

ADD REPLY
0
Entering edit mode

It may be possible to search the sequence by "name" (though you will need to define what you mean by that, I assume some word in the fasta header). You can't search by length (unless you had that information in your fasta headers).

blastdbcmd -db your_database_name -entry all -outfmt "%f" | grep "word_in_title"
ADD REPLY
0
Entering edit mode

But that will give me only the line containing that word not the sequence.Is there any command for that in blast+ tool.

ADD REPLY

Login before adding your answer.

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