Bio::Tree AlleleNode
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvs
Summary
Bio::Tree::AlleleNode - A Node with Alleles attached
Package variables
No package variables defined.
Included modules
Bio::PopGen::Genotype
Bio::PopGen::Individual
Inherit
Bio::PopGen::IndividualI Bio::Tree::Node
Synopsis
  use Bio::Tree::AlleleNode;
Description
AlleleNodes are basic Bio::Tree::Nodes with the added ability to
add Genotypes alleles as defined by the Bio::PopGen::IndividualI
interface. Genotypes are defined by the Bio::PopGen::GenotypeI
interface, you will probably want to use the Bio::PopGen::Genotype
implementation.
This is implemented via containment to avoid multiple inheritance
problems. Their is a Bio::PopGen::Individual object which handles
the Bio::PopGen::IndividualI interface, and is accessible via the
Bio::Tree::AlleleNode::individual method.
Methods
BEGIN Code
newDescriptionCode
individualDescriptionCode
unique_idDescriptionCode
num_of_resultsDescriptionCode
add_GenotypeDescriptionCode
reset_GenotypesDescriptionCode
remove_GenotypeDescriptionCode
get_GenotypesDescriptionCode
has_MarkerDescriptionCode
get_marker_namesDescriptionCode
Methods description
newcode    nextTop
 Title   : new
Usage : my $obj = Bio::Tree::AlleleNode->new();
Function: Builds a new Bio::Tree::AlleleNode() object
Returns : an instance of Bio::Tree::AlleleNode
Args : -unique_id => $id,
-genotypes => \@genotypes
-left => pointer to Left descendent (optional)
-right => pointer to Right descenent (optional)
-branch_length => branch length [integer] (optional)
-bootstrap => value bootstrap value (string)
-description => description of node
-id => human readable (unique) id for node
Should NOT contain the characters
'();:'
individualcodeprevnextTop
 Title   : individual
Usage : $obj->individual($newval)
Function: Get/Set Access to the underlying individual object
Returns : Bio::PopGen::Individual object
Args : on set, new value (Bio::PopGen::Individual)
unique_idcodeprevnextTop
 Title   : unique_id
Usage : my $id = $individual->unique_id
Function: Unique Identifier
Returns : string representing unique identifier
Args : string
num_of_resultscodeprevnextTop
 Title   : num_of_results
Usage : my $count = $person->num_results;
Function: returns the count of the number of Results for a person
Returns : integer
Args : none
add_GenotypecodeprevnextTop
 Title   : add_Genotype
Usage : $individual->add_Genotype
Function: add a genotype value, only a single genotype
may be associated
Returns : count of the number of genotypes associated with this individual
Args : @genotypes - Bio::PopGen::GenotypeI object(s) containing
alleles plus a marker name
reset_GenotypescodeprevnextTop
 Title   : reset_Genotypes
Usage : $individual->reset_Genotypes;
Function: Reset the genotypes stored for this individual
Returns : none
Args : none
remove_GenotypecodeprevnextTop
 Title   : remove_Genotype
Usage : $individual->remove_Genotype(@names)
Function: Removes the genotypes for the requested markers
Returns : none
Args : Names of markers
get_GenotypescodeprevnextTop
 Title   : get_Genotypes
Usage : my @genotypes = $ind->get_Genotypes(-marker => $markername);
Function: Get the genotypes for an individual, based on a criteria
Returns : Array of genotypes
Args : either none (return all genotypes) or
-marker => name of marker to return (exact match, case matters)
has_MarkercodeprevnextTop
 Title   : has_Marker
Usage : if( $ind->has_Marker($name) ) {}
Function: Boolean test to see if an Individual has a genotype
for a specific marker
Returns : Boolean (true or false)
Args : String representing a marker name
get_marker_namescodeprevnextTop
 Title   : get_marker_names
Usage : my @names = $individual->get_marker_names;
Function: Returns the list of known marker names
Returns : List of strings
Args : none
Methods code
BEGINTop
BEGIN {
 $UIDCOUNTER = 1
}
newdescriptionprevnextTop
sub new {
     my($class,@args) = @_;

    my $self = $class->SUPER::new(@args);
    $self->individual( Bio::PopGen::Individual->new(@args));
    return $self;
}
individualdescriptionprevnextTop
sub individual {
    my ($self,$newval) = @_;
    if( defined $newval || ! defined $self->{'individual'} ) {
	$newval = Bio::PopGen::Individual->new() unless defined $newval;
	$self->{'individual'} = $newval;
    }
    return $self->{'individual'};
}
unique_iddescriptionprevnextTop
sub unique_id {
    my $self = shift;
    $self->individual->unique_id(@_);
}
num_of_resultsdescriptionprevnextTop
sub num_of_results {
    my $self = shift;
    $self->individual->num_of_results(@_);
}
add_GenotypedescriptionprevnextTop
sub add_Genotype {
    my $self = shift;
    $self->individual->add_Genotype(@_);
}
reset_GenotypesdescriptionprevnextTop
sub reset_Genotypes {
    my $self = shift;
    $self->individual->reset_Genotypes(@_);
}
remove_GenotypedescriptionprevnextTop
sub remove_Genotype {
    my $self = shift;
    $self->individual->remove_Genotype(@_);
}
get_GenotypesdescriptionprevnextTop
sub get_Genotypes {
    my $self = shift;
    $self->individual->get_Genotypes(@_);
}
has_MarkerdescriptionprevnextTop
sub has_Marker {
    my $self = shift;
    $self->individual->has_Marker(@_);
}
get_marker_namesdescriptionprevnextTop
sub get_marker_names {
   my $self = shift;
   $self->individual->get_marker_names(@_);
}
General documentation
FEEDBACKTop
Mailing ListsTop
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to
the Bioperl mailing list. Your participation is much appreciated.
  bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support Top
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. Many experienced and
reponsive experts will be able look at the problem and quickly
address it. Please include a thorough description of the problem
with code and data examples if at all possible.
Reporting BugsTop
Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via the
web:
  https://redmine.open-bio.org/projects/bioperl/
AUTHOR - Jason StajichTop
Email jason-at-bioperl-dot-org
APPENDIXTop
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _
HISTORYTop
This module was re-written to be a combination of
Bio::PopGen::Individual and Bio::Tree::Node primarily for use in
Bio::PopGen::Simulation::Coalescent simulations.
Bio::PopGen::Individual methodsTop
Methods required by Bio::PopGen::IndividualI.
Bio::Tree::Node methodsTop
Methods inherited from Bio::Tree::Node.
add_DescendentTop
 Title   : add_Descendent
Usage : $node->add_Descendent($node);
Function: Adds a descendent to a node
Returns : number of current descendents for this node
Args : Bio::Node::NodeI
boolean flag, true if you want to ignore the fact that you are
adding a second node with the same unique id (typically memory
location reference in this implementation). default is false and
will throw an error if you try and overwrite an existing node.
each_DescendentTop
 Title   : each_Descendent($sortby)
Usage : my @nodes = $node->each_Descendent;
Function: all the descendents for this Node (but not their descendents
i.e. not a recursive fetchall)
Returns : Array of Bio::Tree::NodeI objects
Args : $sortby [optional] "height", "creation" or coderef to be used
to sort the order of children nodes.
remove_DescendentTop
 Title   : remove_Descendent
Usage : $node->remove_Descedent($node_foo);
Function: Removes a specific node from being a Descendent of this node
Returns : nothing
Args : An array of Bio::Node::NodeI objects which have be previously
passed to the add_Descendent call of this object.
remove_all_DescendentsTop
 Title   : remove_all_Descendents
Usage : $node->remove_All_Descendents()
Function: Cleanup the node's reference to descendents and reset
their ancestor pointers to undef, if you don't have a reference
to these objects after this call they will be cleaned up - so
a get_nodes from the Tree object would be a safe thing to do first
Returns : nothing
Args : none
get_all_DescendentsTop
 Title   : get_all_Descendents
Usage : my @nodes = $node->get_all_Descendents;
Function: Recursively fetch all the nodes and their descendents
*NOTE* This is different from each_Descendent
Returns : Array or Bio::Tree::NodeI objects
Args : none
ancestorTop
 Title   : ancestor
Usage : $obj->ancestor($newval)
Function: Set the Ancestor
Returns : value of ancestor
Args : newvalue (optional)
branch_lengthTop
 Title   : branch_length
Usage : $obj->branch_length()
Function: Get/Set the branch length
Returns : value of branch_length
Args : newvalue (optional)
bootstrapTop
 Title   : bootstrap
Usage : $obj->bootstrap($newval)
Function: Get/Set the bootstrap value
Returns : value of bootstrap
Args : newvalue (optional)
descriptionTop
 Title   : description
Usage : $obj->description($newval)
Function: Get/Set the description string
Returns : value of description
Args : newvalue (optional)
idTop
 Title   : id
Usage : $obj->id($newval)
Function: The human readable identifier for the node
Returns : value of human readable id
Args : newvalue (optional)
Note : id cannot contain the chracters '();:'
"A name can be any string of printable characters except blanks,
colons, semicolons, parentheses, and square brackets. Because you may
want to include a blank in a name, it is assumed that an underscore
character ("_") stands for a blank; any of these in a name will be
converted to a blank when it is read in."
from http://evolution.genetics.washington.edu/phylip/newicktree.html
internal_idTop
 Title   : internal_id
Usage : my $internalid = $node->internal_id
Function: Returns the internal unique id for this Node
(a monotonically increasing number for this in-memory implementation
but could be a database determined unique id in other
implementations)
Returns : unique id
Args : none
Bio::Node::NodeI decorated interface implementedTop
The following methods are implemented by Bio::Node::NodeI decorated
interface.
is_LeafTop
 Title   : is_Leaf
Usage : if( $node->is_Leaf )
Function: Get Leaf status
Returns : boolean
Args : none
to_stringTop
 Title   : to_string
Usage : my $str = $node->to_string()
Function: For debugging, provide a node as a string
Returns : string
Args : none
heightTop
 Title   : height
Usage : my $len = $node->height
Function: Returns the height of the tree starting at this
node. Height is the maximum branchlength.
Returns : The longest length (weighting branches with branch_length) to a leaf
Args : none
invalidate_heightTop
 Title   : invalidate_height
Usage : private helper method
Function: Invalidate our cached value of the node's height in the tree
Returns : nothing
Args : none
add_tag_valueTop
 Title   : add_tag_value
Usage : $node->add_tag_value($tag,$value)
Function: Adds a tag value to a node
Returns : number of values stored for this tag
Args : $tag - tag name
$value - value to store for the tag
remove_tagTop
 Title   : remove_tag
Usage : $node->remove_tag($tag)
Function: Remove the tag and all values for this tag
Returns : boolean representing success (0 if tag does not exist)
Args : $tag - tagname to remove
remove_all_tagsTop
 Title   : remove_all_tags
Usage : $node->remove_all_tags()
Function: Removes all tags
Returns : None
Args : None
get_all_tagsTop
 Title   : get_all_tags
Usage : my @tags = $node->get_all_tags()
Function: Gets all the tag names for this Node
Returns : Array of tagnames
Args : None
get_tag_valuesTop
 Title   : get_tag_values
Usage : my @values = $node->get_tag_value($tag)
Function: Gets the values for given tag ($tag)
Returns : Array of values or empty list if tag does not exist
Args : $tag - tag name
has_tagTop
 Title   : has_tag
Usage : $node->has_tag($tag)
Function: Boolean test if tag exists in the Node
Returns : Boolean
Args : $tag - tagname