[Bioperl-l] Local flat file implementation of Bio::DB::Taxonomy

Brian Osborne osborne1 at optonline.net
Tue Feb 21 04:42:18 UTC 2006


Gabriel,

You had a couple of little errors in your script but once fixed it worked
fine:

#!/usr/bin/perl -w


use strict;

use lib "/Users/bosborne/bioperl-live";

use Bio::DB::Taxonomy;



my $nodesfile = "nodes.dmp";

my $namefile = "names.dmp";

my $db = new Bio::DB::Taxonomy(-source => 'flatfile',

-nodesfile => $nodesfile,

-namesfile => $namefile);


my $taxonid = $db->get_taxonid('Homo sapiens');


# Here, $taxonid is 9606. However,


my $species = $db->get_Taxonomy_Node(-taxonid => $taxonid);


print $species->common_name;


This is using bioperl-live on Mac OSX, Perl 5.8. Are you on Windows? If so
then do "-directory => C:/temp", see what happens.

Brian O.

On 2/20/06 1:51 PM, "Gabriel Valiente" <valiente at lsi.upc.edu> wrote:

> use Bio::DB::Taxonomy;
> my $nodesfile = "nodes.dmp";
> my $namesfile = "names.dmp";
> my $db = new Bio::DB::Taxonomy(-source => 'flatfile'
>                                -nodesfile => $nodesfile,
>                                -namesfile => $namefile);
> my $taxonid = $db->get_taxonid('Homo sapiens');
> 
> Here, $taxonid is 9606. However,
> 
> my $species = $db->get_Taxonomy_Node(-taxonid => $taxonid);





More information about the Bioperl-l mailing list