[Bioperl-l] How to use gi2taxonid

Hubert Prielinger hubert.prielinger at gmx.at
Mon Jul 10 23:53:26 UTC 2006


Hi Chris,
thanks for your response, actually I have done it with the EUtils, 
because I have only accession ids and there is no possibility to retrieve
the taxonomy directly for an accession id. Because the xml files you 
retrieve are very small, I first assign accession id to esearch, parse 
the Uid from the xml file, assign Uid to esummary, parse tax id from xml 
and finally, assign tax id to esummary again and retrieve taxonomy and 
parse it..... I know a little bit intricatley, but it works fine.....thanks

regards
Hubert


Chris Fields wrote:
> Hubert,
>
> In case you didn't get this going, there may be another option now.  I have
> started work on a new set of modules called Bio::DB::EUtilities in
> bioperl-live, intended as a back-end for NCBI database searches.  It can be
> used directly if needed though.  You can use EPost/Elink to directly
> retrieve the taxonIDs using the following script (pass a file containing the
> protein/nucleotide primary ID on command line).  The below retrieves
> taxonid's using protein GI's:
>
>
> use Bio::DB::EUtilities;
> my @ids;
>
> while (my $id = <>) {
>     chomp $id;
>     push @ids, $id;
> }
>
> my $epost = Bio::DB::EUtilities->new(
>                                        -eutil       => 'epost',
>                                        -db          => 'protein',
>                                        -id          => \@ids,
>                                       );
>
> $epost->get_response;
>
> my $elink = Bio::DB::EUtilities->new(
>                                      -eutil        => 'elink',
>                                      -cookie        => $epost->next_cookie,
>                                      -db           => 'taxonomy',
>                                      );
>
> $elink->get_response;
>
> my @tax_ids = $elink->get_db_ids;
>
>
>
> Chris
>
>   
>> hi,
>> I have downloaded the gi2taxonid file to get the taxonid for a GI  
>> number
>> taken from a report as recommended here, but I don't know how to  
>> use the
>> gi2taxonid file.
>> Jason wrote in a previous post that you have to make a DB_File out of
>> it, but I don't know how....and finally tie it to a hash....
>> Can anybody give me a hint how to use it..... my final goal is to get
>> the taxonomy.
>>
>> thanks
>> Hubert
>>     
>
> Christopher Fields
> Postdoctoral Researcher - Switzer Lab
> Dept. of Biochemistry
> University of Illinois Urbana-Champaign 
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>
>   




More information about the Bioperl-l mailing list