Bio::Tree AlleleNode
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::Tree::AlleleNode - DESCRIPTION of Object
Package variables
No package variables defined.
Included modules
Bio::Tree::Node
Inherit
Bio::Tree::Node
Synopsis
Give standard usage here
Description
Describe the object here
Methods
add_allelesDescriptionCode
get_allelesDescriptionCode
get_marker_namesDescriptionCode
newDescriptionCode
purge_markersDescriptionCode
Methods description
add_allelescode    nextTop
 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
get_allelescodeprevnextTop
 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
get_marker_namescodeprevnextTop
 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
newcodeprevnextTop
 Title   : new
Usage : my $obj = new Bio::Tree::AlleleNode();
Function: Builds a new Bio::Tree::AlleleNode object
Returns : Bio::Tree::AlleleNode
Args :
purge_markerscodeprevnextTop
 Title   : purge_markers
Usage : $node->purge_markers;
Function: Reset the markers and alleles
Returns : none
Args : none
Methods code
add_allelesdescriptionprevnextTop
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} = []; # reset the array ref
foreach my $a ( sort @alleles ) { next if ! defined $a; # skip undef alleles
push @{$self->{'_data'}->{$marker}},$a; }
}
get_allelesdescriptionprevnextTop
sub get_alleles {
   my ($self,$marker) = @_;
   if( defined $self->{'_data'}->{$marker} ) { 
       return @{$self->{'_data'}->{$marker}};
   }
   return ();
}
get_marker_namesdescriptionprevnextTop
sub get_marker_names {
   my ($self) = @_;
   return keys %{$self->{'_data'}};
}
newdescriptionprevnextTop
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;
}
purge_markersdescriptionprevnextTop
sub purge_markers {
   my ($self) = @_;
   $self->{'_data'} = {};
   return;
}


1;
}
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/MailList.shtml - About the mailing lists
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
email or the web:
  bioperl-bugs@bioperl.org
http://bugzilla.bioperl.org/
AUTHOR - Jason StajichTop
Email jason@bioperl.org
Describe contact details here
CONTRIBUTORSTop
Additional contributors names and emails here
APPENDIXTop
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _