The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Bio::Phylo::Taxa::Taxon - The operational taxonomic unit.

SYNOPSIS

 use Bio::Phylo::IO;
 use Bio::Phylo::Taxa;
 use Bio::Phylo::Taxa::Taxon;
 
 my @taxa = qw(Homo_sapiens Pan_paniscus Pan_troglodytes Gorilla_gorilla);
 my $str = '(((Pan_paniscus,Pan_troglodytes),Homo_sapiens),Gorilla_gorilla);';
 
 # create tree object
 my $tree = Bio::Phylo::IO->parse(
    -format => 'newick',
    -string => $str
 )->first;

 # instantiate taxa object
 my $taxa = Bio::Phylo::Taxa->new;

 # instantiate taxon objects, insert in taxa object
 foreach( @taxa ) {
    my $taxon = Bio::Phylo::Taxa::Taxon->new( -name => $_ );
    $taxa->insert($taxon);
 }
 
 # crossreference tree and taxa
 $tree->crossreference($taxa);
 
 foreach my $node ( @{ $tree->get_entities } ) {
    if ( $node->get_taxon ) {
        print "match: ", $node->get_name, "\n";  #prints crossreferenced tips
    }
 }

DESCRIPTION

The taxon object models a single operational taxonomic unit. It is useful for cross-referencing datum objects and tree nodes.

METHODS

CONSTRUCTOR

new()
 Type    : Constructor
 Title   : new
 Usage   : my $taxon = Bio::Phylo::Taxa::Taxon->new;
 Function: Initializes a Bio::Phylo::Taxa::Taxon object.
 Returns : A Bio::Phylo::Taxa::Taxon object.
 Args    : none.

MUTATORS

set_data()
 Type    : Mutator
 Title   : set_data
 Usage   : $taxon->set_data($datum);
 Function: Associates data with the current taxon.
 Returns : Modified object.
 Args    : Must be an object of type Bio::Phylo::Matrices::Datum
set_nodes()
 Type    : Mutator
 Title   : set_nodes
 Usage   : $taxon->set_nodes($node);
 Function: Associates tree nodes with the current taxon.
 Returns : Modified object.
 Args    : A Bio::Phylo::Trees::Node object

ACCESSORS

get_data()
 Type    : Accessor
 Title   : get_data
 Usage   : @data = @{ $taxon->get_data };
 Function: Retrieves data associated with the current taxon.
 Returns : An ARRAY reference of Bio::Phylo::Matrices::Datum objects.
 Args    :
get_nodes()
 Type    : Accessor
 Title   : get_nodes
 Usage   : @nodes = @{ $taxon->get_nodes };
 Function: Retrieves tree nodes associated with the current taxon.
 Returns : An ARRAY reference of Bio::Phylo::Trees::Node objects
 Args    :

SEE ALSO

Bio::Phylo

The taxon objects inherits from the Bio::Phylo object. The methods defined there are also applicable to the taxon object.

Bio::Phylo::Manual

Also see the manual: Bio::Phylo::Manual.

FORUM

CPAN hosts a discussion forum for Bio::Phylo. If you have trouble using this module the discussion forum is a good place to start posting questions (NOT bug reports, see below): http://www.cpanforum.com/dist/Bio-Phylo

BUGS

Please report any bugs or feature requests to bug-bio-phylo@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Bio-Phylo. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. Be sure to include the following in your request or comment, so that I know what version you're using:

$Id: Taxon.pm,v 1.20 2005/09/29 20:31:18 rvosa Exp $

AUTHOR

Rutger A. Vos,

email: rvosa@sfu.ca
web page: http://www.sfu.ca/~rvosa/

ACKNOWLEDGEMENTS

The author would like to thank Jason Stajich for many ideas borrowed from BioPerl http://www.bioperl.org, and CIPRES http://www.phylo.org and FAB* http://www.sfu.ca/~fabstar for comments and requests.

COPYRIGHT & LICENSE

Copyright 2005 Rutger A. Vos, All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.