[Bioperl-l] extract taxonomy from Bio::Tree::NodeI objects...
Chris Fields
cjfields at illinois.edu
Tue Jul 13 12:58:41 UTC 2010
Change to the following:
{ print $nodelet->scientific_name() . "\t" ; }
chris
On Jul 13, 2010, at 5:47 AM, mark alston (TGAC) wrote:
> Hi,
> BioPerl newbie question coming up...
> I want to feed my BioPerl program the name of a bug and extract taxonomic information. Simples.
> Here's my script after days of effort (I joke not):
> #########################################################################
> use Bio::DB::Taxonomy ;
> my $entrez_dbh = new Bio::DB::Taxonomy (-source => 'entrez');
>
> my $entrezBug = $entrez_dbh->get_taxon(-name => 'Cronobacter sakazakii ATCC BAA-894') ;
> my $bugTree = Bio::Tree::Tree->new(-node => $entrezBug) ;
>
> my @taxa = $bugTree->get_nodes ; ### returns an array of Bio::Tree:NodeI objects
>
> foreach my $nodelet (@taxa)
> { print $nodelet->to_string() . "\t" ; }
> #########################################################################
>
> This outputs:
> 131567 2 1224 1236 91347 543 413496 28141 290339
>
> If I feed these to the NCBI taxonomy browser as 'taxonomy id' they make sense because
> 2 corresponds to: bacteria (superkingdom)
> 1224 corresponds to: proteobacteria (phylum)
> etc etc
> 290339 corresponds to: Cronobacter sakazakii ATCC BAA-894 (species)
>
>
> But how can I get the things I've underlined out via BioPerl?
> Many thanks,
> Mark
>
> ################################################
> Dr Mark Alston,
> Computer Biologist,
> The Genome Analysis Centre,
> Norwich Research Park,
> Colney Lane, Norwich, NR4 7UH, UK.
>
> tel +44 (0)1603 450910
> e-mail mark.alston at bbsrc.ac.uk<mailto:mark.alston at bbsrc.ac.uk>
> web http://www.tgac.bbsrc.ac.uk<http://www.tgac.bbsrc.ac.uk/>
> ################################################
>
>
> _______________________________________________
> 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