[Bioperl-l] Bio::Species / Bio::Taxonomy::Node
Hilmar Lapp
hlapp at gmx.net
Sat Jan 31 14:42:34 EST 2004
Very cool Jason!!
Now we can start hooking this into bioperl-db.
And what about porting the SeqIO parsers, the target being to be able
to deprecate Bio::Species altogether? Alternatively, change the
SeqI/RichSeqI implementations to silently convert a Bio::Species
instance on set to a Bio::Taxonomy::Node instance?
-hilmar
On Friday, January 30, 2004, at 02:07 PM, Jason Stajich wrote:
> I think I've finally committed code which will allow
> Bio::Taxonomy::Node
> to act like Bio::Species while supporting the notion of being a node
> in a
> taxonomy hierarchy. Added tests in t/Species.t to this effect.
>
> For Bio::DB::Taxonomy::flatfile I've added indexing by parent Id so it
> is
> quite fast to grab all the children for a given node. So you can walk
> up
> and down the classification system now. Practically speaking
> this means to get all the taxon ids of species in the same genus with a
> few simple lines like below.
>
> Unfortunately the the NCBI taxonomy API as part of E-Utils doesn't
> quite
> provide the information we need so the whole API can't be used without
> downloading the taxonomy db locally.
>
> nodefile and namesfile are the files from ncbi taxdump see
> Bio::DB::Taxonomy::flatfile for more info.
>
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> use Bio::DB::Taxonomy;
> my $db = Bio::DB::Taxonomy->new
> (-source => 'flatfile',
> -nodesfile=> '/home/jason/taxonomy/nodes.dmp',
> -namesfile=> '/home/jason/taxonomy/names.dmp');
>
> my $node = $db->get_Taxonomy_Node(-name => 'Caenorhabditis elegans');
>
> my $parent = $node->get_Parent_Node();
> for my $n ( $parent->get_Children_Nodes() ) {
> print $n->binomial, "\t", $n->ncbi_taxid,"\n";
> }
>
> Someday I'll get around to making a HowTO unless someone else wants to
> do
> it... =)
>
> -jason
> --
> Jason Stajich
> Duke University
> jason at cgt.mc.duke.edu
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
--
-------------------------------------------------------------
Hilmar Lapp email: lapp at gnf.org
GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
-------------------------------------------------------------
More information about the Bioperl-l
mailing list