Bio::Tree
AlleleNode
Toolbar
Summary
Bio::Tree::AlleleNode - DESCRIPTION of Object
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
Give standard usage here
Description
Describe the object here
Methods
Methods description
Title : add_alleles Usage : $node->add_alleles($mkr,@alleles); Function: Adds allele(s) for $mkr, @alleles can be a single or multiple alleles. If the same marker is added more than one, the previous value will be overwritten with a warning. Returns : none Args : $marker => marker name @alleles => alleles for the marker |
Title : get_alleles Usage : my @alleles = $node->get_alleles($marker); Function: Return the alleles for a marker $marker Returns : Array of Alleles for a marker or empty array Args : $marker name |
Title : get_marker_names Usage : my @names =$node->get_marker_names(); Function: Return the names of the markers that have been added to this node Returns : List of Marker Names Args : none |
Title : new Usage : my $obj = new Bio::Tree::AlleleNode(); Function: Builds a new Bio::Tree::AlleleNode object Returns : Bio::Tree::AlleleNode Args : |
Title : purge_markers Usage : $node->purge_markers; Function: Reset the markers and alleles Returns : none Args : none |
Methods code
sub add_alleles
{ my ($self,$marker,@alleles) = @_;
if( ! defined $marker || $marker eq '' ) {
$self->warn("must specify a valid marker name for add_alleles");
return;
}
if( $self->{'_data'}->{$marker} ) {
$self->warn("Overwriting value of $marker");
}
$self->{'_data'}->{$marker} = []; foreach my $a ( sort @alleles ) {
next if ! defined $a; push @{$self->{'_data'}->{$marker}},$a;
} } |
sub get_alleles
{ my ($self,$marker) = @_;
if( defined $self->{'_data'}->{$marker} ) {
return @{$self->{'_data'}->{$marker}};
}
return (); } |
sub get_marker_names
{ my ($self) = @_;
return keys %{$self->{'_data'}}; } |
sub new
{ my($class,@args) = @_;
my $self = $class->SUPER::new(@args);
my ($alleles) = $self->_rearrange([qw(ALLELES)], @args);
$self->{'_data'} = {};
if( defined $alleles ) {
if( ref($alleles) !~ /HASH/i ) {
$self->warn("Must specify a valid HASH reference for the -alleles value...Ignoring initializing input");
} else {
foreach my $mkr ( keys %{$alleles} ) {
$self->add_alleles($mkr,@{$alleles->{$mkr}});
}
}
}
return $self; } |
sub purge_markers
{ my ($self) = @_;
$self->{'_data'} = {};
return;
}
1; } |
General documentation
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/MailList.shtml - About the mailing lists
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
email or the web:
bioperl-bugs@bioperl.org
http://bugzilla.bioperl.org/
AUTHOR - Jason Stajich | Top |
Additional contributors names and emails here
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _