[Bioperl-l] Genbank code from Blast results

Jason Stajich jason at bioperl.org
Mon Aug 31 19:49:08 UTC 2009


if you run blastall with -I T (show GI's in defline) you will also be  
able to get the genbank identifier out with $hit->ncbi_gi through some  
automagic parsing of the ID line

-jason
On Aug 31, 2009, at 11:12 AM, Marcelo Iwata wrote:

> done:
>
> #!/usr/bin/perl -w
> use strict;
> use Bio::SearchIO;
>
> my $in = new Bio::SearchIO(-format => 'blast',
>                           -file   => 'Rpp2Blast.txt');
> ...
> while( my $result = $in->next_result ) {
>  while( my $hit = $result->next_hit ) {
>   while( my $hsp = $hit->next_hsp ) {
>       #EXTRACT THE GENBANK CODE NUMBER FROM DESCRIPTION
>      #----------------------------------------------
>       my $accGB  =  $hit->description();
>       $accGB =~ m/(gb=.*?\s)/;
>       #----------------------------------------------
>
>
>           print    MYFILE
>          ...
>
>          $1,"\t" , #numero de acesso ao genbank
>           ...
>          $hsp->hit->end, "\t","\n";
>      ...
>
>   }
>  }
> }
>
>
>
> On Tue, Aug 18, 2009 at 3:34 PM, Marcelo Iwata <marcelo011982 at gmail.com 
> >wrote:
>
>> hi all..
>> I was doing a script that take some information of the results of  
>> blastn
>> files.
>> Everythig was ok, but i have some dificult to pic the Genbank code  
>> number
>> (the 'gb' below).
>> I tried
>>
>> $obj->each_accession_number
>> $hit->name
>>
>> And some variation of this.
>>
>>
>>
>> ------------------------------
>>> gnl|UG|Gma#S23062791 gmrtDrNS01_07-B_M13R_E11_087.s1 Water  
>>> stressed 5h
>> segment 1 gmrtDrNS01
>>              Glycine max cDNA 3', mRNA sequence /clone_end=3'
>>              /gb=CX702616 /gi=58015874 /ug=Gma.18455 /len=853
>>          Length = 853
>>
>> Score = 1336 bits (674), Expect = 0.0
>> Identities = 793/832 (95%), Gaps = 8/832 (0%)
>> Strand = Plus / Minus
>>
>>
>> Query: 294858  
>> aaattaacaatgagactccagagtatgtgaggtcctttgaatttgatagcaaattgatgt
>> 294917
>>              |||||||||||| |||||| |||||||||||||||||   
>> ||||||||||||||||||||
>> Sbjct: 853     
>> aaattaacaatgtgactcccgagtatgtgaggtccttgaaatttgatagcaaattgatgc
>> 794
>> ----------------------------------------
>>
>>
>> But, i still don't get it.
>>
>> thank you
>> with regards
>> Miwata
>>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

--
Jason Stajich
jason.stajich at gmail.com
jason at bioperl.org




More information about the Bioperl-l mailing list