BioPerl
view release on metacpan or search on metacpan
Bio/Taxon.pm view on Meta::CPAN
Title : genetic_code
Usage : $taxon->genetic_code($newval)
Function: Get/set genetic code table
Returns : value of genetic_code (a scalar)
Args : on set, new value (a scalar or undef, optional)
=cut
sub genetic_code {
my $self = shift;
return $self->{'genetic_code'} = shift if @_;
return $self->{'genetic_code'};
}
=head2 mitochondrial_genetic_code
Title : mitochondrial_genetic_code
Usage : $taxon->mitochondrial_genetic_code($newval)
Function: Get/set mitochondrial genetic code table
Returns : value of mitochondrial_genetic_code (a scalar)
Args : on set, new value (a scalar or undef, optional)
=cut
sub mitochondrial_genetic_code {
my $self = shift;
return $self->{'mitochondrial_genetic_code'} = shift if @_;
return $self->{'mitochondrial_genetic_code'};
}
=head2 create_date
Title : create_date
Usage : $taxon->create_date($newval)
Function: Get/Set Date this node was created (in the database)
Returns : value of create_date (a scalar)
Args : on set, new value (a scalar or undef, optional)
=cut
sub create_date {
my $self = shift;
return $self->{'create_date'} = shift if @_;
return $self->{'create_date'};
}
=head2 update_date
Title : update_date
Usage : $taxon->update_date($newval)
Function: Get/Set Date this node was updated (in the database)
Returns : value of update_date (a scalar)
Args : on set, new value (a scalar or undef, optional)
=cut
sub update_date {
my $self = shift;
return $self->{'update_date'} = shift if @_;
return $self->{'update_date'};
}
=head2 pub_date
Title : pub_date
Usage : $taxon->pub_date($newval)
Function: Get/Set Date this node was published (in the database)
Returns : value of pub_date (a scalar)
Args : on set, new value (a scalar or undef, optional)
=cut
sub pub_date {
my $self = shift;
return $self->{'pub_date'} = shift if @_;
return $self->{'pub_date'};
}
=head2 ancestor
Title : ancestor
Usage : my $ancestor_taxon = $taxon->ancestor()
Function: Retrieve the ancestor taxon. Normally the database is asked what the
ancestor is.
If you manually set the ancestor (or you make a Bio::Tree::Tree with
this object as an argument to new()), the database (if any) will not
be used for the purposes of this method.
To restore normal database behaviour, call ancestor(undef) (which
would remove this object from the tree), or request this taxon again
as a new Taxon object from the database.
Returns : Bio::Taxon
Args : none
=cut
sub ancestor {
my $self = shift;
my $ancestor = $self->SUPER::ancestor(@_);
if ($ancestor) {
return $ancestor;
}
my $dbh = $self->db_handle;
#*** could avoid the db lookup if we knew our current id was definitely
# information from the db...
my $definitely_from_dbh = $self->_get_similar_taxon_from_db($self);
return $dbh->ancestor($definitely_from_dbh);
}
=head2 get_Parent_Node
( run in 0.874 second using v1.01-cache-2.11-cpan-39bf76dae61 )