[Bioperl-l] Taxonomy and get_taxaid
Heikki Lehvaslaiho
heikki at ebi.ac.uk
Wed May 7 14:56:56 EDT 2003
Anthony,
The main problem in your script is that get_Taxonomy_Node() does not
take a hash as an argument but a scalar (a number).
Also, taxon 'Salmonella' is a genus, not a species, so you can not
store it in bioperl object Bio::Species. The get_Taxonomy_Node method
returns you a hash reference. Ideally there should be a bioperl taxon
object and its subclass species, one of which is returned. (Anybody want
to clean the bioperl classes to reflect this?)
This version of your script should get you going:
##################################
use Bio::DB::Taxonomy;
use Data::Dumper;
my $db=new Bio::DB::Taxonomy(-verbose=>1);
#my $taxaid=$db->get_taxaid("Salmonella typhimurium"); #try this, too
my $taxaid=$db->get_taxaid("Salmonella");
my $species=$db->get_Taxonomy_Node($taxaid);
print Dumper $species;
##################################
-Heikki
On Fri, 2003-05-02 at 18:31, anthony.underwood at hpa.org.uk wrote:
> Hi All,
>
>
> I'm getting a problem with the taxonomy module when I write this script:
>
> use Bio::DB::Taxonomy;
> my $db=new Bio::DB::Taxonomy(-source=>'entrez');
> my $taxaid=$db->get_taxaid("Salmonella");
> my $species=$db->get_Taxonomy_Node(-taxaid=>$taxaid);
> print $species->species->genus;
>
>
>
> The error I get is Can't call method "children" on an undefined value at
> /usr/lib/perl5/site_perl/5.6.1/Bio/DB/Taxonomy/entrez.pm line 167.
> I think this is when the get_taxaid routine is called
>
>
> Can anyone advise on this. Thanks in advance,
>
> Anthony
>
> Dr Anthony Underwood
> Bioinformatics Unit
> Central Public Health Laboratory
> Health Protection Agency
> 61 Colindale Avenue
> London
> NW9 5HT
> t: 0208 2004400 ext. 3618
> f: 0208 3583138
> e: anthony.underwood at hpa.org.uk
>
> **************************************************************************
> The information contained in the EMail and any attachments is
> confidential
> and intended solely and for the attention and use of the named
> addressee(s).
> It may not be disclosed to any other person without the express
> authority of
> the HPA, or the intended recipient, or both. If you are not the
> intended
> recipient, you must not disclose, copy, distribute or retain this
> message or
> any part of it.
>
> For information on how to send data to the HPA in encrypted form via
> E.Mail, visit www.HPA.org.uk.
>
> This footnote also confirms that this EMail has been swept for computer
> viruses, but please re-sweep any attachments before opening or saving.
>
> HTTP://www.HPA.org.uk
> **************************************************************************
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at bioperl.org
> http://pw600a.bioperl.org/mailman/listinfo/bioperl-l
--
______ _/ _/_____________________________________________________
_/ _/ http://www.ebi.ac.uk/mutations/
_/ _/ _/ Heikki Lehvaslaiho heikki_at_ebi ac uk
_/_/_/_/_/ EMBL Outstation, European Bioinformatics Institute
_/ _/ _/ Wellcome Trust Genome Campus, Hinxton
_/ _/ _/ Cambs. CB10 1SD, United Kingdom
_/ Phone: +44 (0)1223 494 644 FAX: +44 (0)1223 494 468
___ _/_/_/_/_/________________________________________________________
More information about the Bioperl-l
mailing list