Is there anyway to fetch information on neighboring GIs using BLAST? Specifically, I want to input a GI and get information (whether it be FASTA, XML, whatever) on the 3-4 GIs that are upstream and downstream of the input GI. I am able to do this via Entrez Direct commands but would like to do this with BLAST on a local database (potentially the 'blastdbcmd' command?). If there is a way to do this via BioPerl/Perl/code that would work as well.
What do you mean by "neighboring GI's"? Do you mean the genes located next to your input GI number physically on the genome or adjacent ID on your BLAST result? If it is former, I don't think you'll be able to do it as GI's # are not ordered based on physical location. If it is latter, you can simply use
grep -A <#> -B <#> "GI_number" blast_output.tab
to get after (A) or before (B) lines.i mean physically on the genome. I am able to do this using the following Entrez Direct command:
but not sure if that is translatable to BLAST
AFAIK, GI's don't hold coordinate information (especially when saved as fasta format). As you'll like use fasta formatted sequences as BLAST database, it is likely to be absent in BLAST results as well. If you really need to get that info, you might have to first get the location information for all the GI's, merge it with your blast results (or use it as a lookup file for your query) and get that information. I don't think there is an easy way to do this.