Bio::Tools::Phylo::PAML Result
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::Tools::Phylo::PAML::Result - A PAML result set object
Package variables
No package variables defined.
Included modules
Bio::AnalysisResultI
Bio::Root::Root
Inherit
Bio::AnalysisResultI Bio::Root::Root
Synopsis
Give standard usage here
Description
Describe the object here
Methods
add_seqDescriptionCode
add_treeDescriptionCode
get_MLmatrixDescriptionCode
get_NGmatrixDescriptionCode
get_codon_pos_basefreqDescriptionCode
get_seqsDescriptionCode
newDescriptionCode
next_treeDescriptionCode
reset_seqsDescriptionCode
rewind_tree_iterator
No description
Code
set_MLmatrixDescriptionCode
set_NGmatrixDescriptionCode
set_codon_pos_basefreqDescriptionCode
versionDescriptionCode
Methods description
add_seqcode    nextTop
 Title   : add_seq
Usage : $obj->add_seq($seq)
Function: Add a Bio::PrimarySeq to the Result
Returns : none
Args : Bio::PrimarySeqI
See also : Bio::PrimarySeqI
add_treecodeprevnextTop
 Title   : add_tree
Usage : $result->add_tree($tree);
Function: Adds a tree
Returns : integer which is the number of trees stored
Args : Bio::Tree::TreeI
get_MLmatrixcodeprevnextTop
 Title   : get_MLmatrix
Usage : my $mat = $result->get_MLmatrix()
Function: Get the ML matrix
Returns : 2D Array reference
Args : none
get_NGmatrixcodeprevnextTop
 Title   : get_NGmatrix
Usage : my $mat = $result->get_NGmatrix()
Function: Get the Nei & Gojobori matrix
Returns : 2D Array reference
Args : none
get_codon_pos_basefreqcodeprevnextTop
 Title   : get_codon_pos_basefreq
Usage : my @basepos = $result->get_codon_pos_basefreq;
Function: Get the codon position base frequencies
Returns : Array of length 3 (each codon position), each
slot is a hashref keyed on DNA bases, the values are
the frequency of the base at that position for all sequences
Args : none
Note : The array starts at 0 so position '1' is in position '0'
of the array
get_seqscodeprevnextTop
 Title   : get_seqs
Usage : my @otus = $result->get_seqs
Function: Get the seqs Bio::PrimarySeq (OTU = Operational Taxonomic Unit)
Returns : Array of Bio::PrimarySeq
Args : None
See also : Bio::PrimarySeq
newcodeprevnextTop
 Title   : new
Usage : my $obj = new Bio::Tools::Phylo::PAML::Result(%data);
Function: Builds a new Bio::Tools::Phylo::PAML::Result object
Returns : Bio::Tools::Phylo::PAML::Result
Args : -trees => array reference of Bio::Tree::TreeI objects
-MLmatrix => ML matrix
.... MORE ARGUMENTS LISTED HERE BY AARON AND JASON
next_treecodeprevnextTop
 Title   : next_tree
Usage : my $tree = $factory->next_tree;
Function: Get the next tree from the factory
Returns : Bio::Tree::TreeI
Args : none
reset_seqscodeprevnextTop
 Title   : reset_seqs
Usage : $result->reset_seqs
Function: Reset the OTU seqs stored
Returns : none
Args : none
set_MLmatrixcodeprevnextTop
 Title   : set_MLmatrix
Usage : $result->set_MLmatrix($mat)
Function: Set the ML Matrix
Returns : none
Args : Arrayref to MLmatrix (must be arrayref to 2D matrix whic is
lower triangle pairwise)
set_NGmatrixcodeprevnextTop
 Title   : set_NGmatrix
Usage : $result->set_NGmatrix($mat)
Function: Set the Nei & Gojobori Matrix
Returns : none
Args : Arrayref to NGmatrix (must be arrayref to 2D matrix whic is
lower triangle pairwise)
set_codon_pos_basefreqcodeprevnextTop
 Title   : set_codon_pos_basefreq
Usage : $result->set_codon_pos_basefreq(@freqs)
Function: Set the codon position base frequencies
Returns : none
Args : Array of length 3 where each slot has a hashref
keyed on DNA base
versioncodeprevnextTop
 Title   : version
Usage : $obj->version($newval)
Function: Get/Set version
Returns : value of version
Args : newvalue (optional)
Methods code
add_seqdescriptionprevnextTop
sub add_seq {
   my ($self,$seq) = @_;
   if( $seq ) { 
       unless( $seq->isa("Bio::PrimarySeqI") ) {
	   $self->warn("Must provide a valid Bio::PrimarySeqI to add_seq");
	   return;
       }
       push @{$self->{'_seqs'}},$seq;
   }
}
add_treedescriptionprevnextTop
sub add_tree {
   my ($self,$tree) = @_;
   if( $tree && ref($tree) && $tree->isa('Bio::Tree::TreeI') ) {
       push @{$self->{'_trees'}},$tree;
   }
   return scalar @{$self->{'_trees'}};
}
get_MLmatrixdescriptionprevnextTop
sub get_MLmatrix {
   my ($self,@args) = @_;
   return $self->{'_mlmatrix'};
}
get_NGmatrixdescriptionprevnextTop
sub get_NGmatrix {
   my ($self,@args) = @_;
   return $self->{'_ngmatrix'};
}
get_codon_pos_basefreqdescriptionprevnextTop
sub get_codon_pos_basefreq {
   my ($self) = @_;
   return @{$self->{'_codonposbasefreq'}};
}
get_seqsdescriptionprevnextTop
sub get_seqs {
   my ($self) = @_;
   return @{$self->{'_seqs'}};
}
newdescriptionprevnextTop
sub new {
  my($class,@args) = @_;

  my $self = $class->SUPER::new(@args);

  my ($trees,$mlmat,$seqs,$ngmatrix,
      $codonpos,$codonfreq,$version) = $self->_rearrange([qw(TREES MLMATRIX 
						    SEQS NGMATRIX
						    CODONPOS CODONFREQ
						    VERSION)], @args);
  $self->reset_seqs;
  if( $trees ) {
      if(ref($trees) !~ /ARRAY/i ) { 
	  $self->warn("Must have provided a valid array reference to initialize trees");
      } else { 
	  foreach my $t ( @$trees ) {
	      $self->add_tree($t);
	  }
      }
  }
  $self->{'_treeiterator'} = 0;

  if( $mlmat ) {
      if( ref($mlmat) !~ /ARRAY/i ) {
	  $self->warn("Must have provided a valid array reference to initialize MLmatrix");
      } else { 
	  $self->set_MLmatrix($mlmat);
      }
  } 
  if( $seqs ) { 
      if( ref($seqs) !~ /ARRAY/i ) {
	  $self->warn("Must have provided a valid array reference to initialize seqs");
      } else {
	  foreach my $s ( @$seqs ) {
	      $self->add_seq($s);
	  }
      }
  }
  if( $ngmatrix ) {
      if( ref($ngmatrix) !~ /ARRAY/i ) {
	  $self->warn("Must have provided a valid array reference to initialize NGmatrix");
      } else { 
	  $self->set_NGmatrix($ngmatrix);
      }
  } 
  
  if( $codonfreq ) {
      
  
  }

  if( $codonpos ) {
      if( ref($codonpos) !~ /ARRAY/i ) {
	  $self->warn("Must have provided a valid array reference to initialize codonpos");
      } else { 
	  $self->set_codon_pos_basefreq(@$codonpos);
      }
  }

  $self->version($version) if defined $version;

  return $self;
}
next_treedescriptionprevnextTop
sub next_tree {
   my ($self,@args) = @_;
   return $self->{'_trees'}->[$self->{'_treeiterator'}++] || undef;
}
reset_seqsdescriptionprevnextTop
sub reset_seqs {
   my ($self) = @_;
   $self->{'_seqs'} = [];
}
rewind_tree_iteratordescriptionprevnextTop
sub rewind_tree_iterator {
    shift->{'_treeiterator'} = 0;
}
set_MLmatrixdescriptionprevnextTop
sub set_MLmatrix {
   my ($self,$mat) = @_;
   return unless ( defined $mat );
   if( ref($mat) !~ /ARRAY/i ) {
       $self->warn("Did not provide a valid 2D Array reference for set_MLmatrix");
       return;
   }
   $self->{'_mlmatrix'} = $mat;
}
set_NGmatrixdescriptionprevnextTop
sub set_NGmatrix {
   my ($self,$mat) = @_;
   return unless ( defined $mat );
   if( ref($mat) !~ /ARRAY/i ) {
       $self->warn("Did not provide a valid 2D Array reference for set_NGmatrix");
       return;
   }
   $self->{'_ngmatrix'} = $mat;
}
set_codon_pos_basefreqdescriptionprevnextTop
sub set_codon_pos_basefreq {
    my ($self,@codonpos) = @_;
    if( scalar @codonpos != 3 ) { 
	$self->warn("invalid array to set_codon_pos_basefreq, must be an array of length 3");
	return;
    }
    foreach my $pos ( @codonpos ) { 
	if( ref($pos) !~ /HASH/i ||
	    ! exists $pos->{'A'} ) { 
	    $self->warn("invalid array to set_codon_pos_basefreq, must be an array with hashreferences keyed on DNA bases, C,A,G,T");
	}
    }
    $self->{'_codonposbasefreq'} = [@codonpos];
}
versiondescriptionprevnextTop
sub version {
   my $self = shift;
   $self->{'_version'} = shift if @_;
   return $self->{'_version'};
}

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 Stajich, Aaron MackeyTop
Email jason@bioperl.org
Email amackey@virginia.edu
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 _
rewind_treeTop
 Title   : rewind_tree_iterator
Usage : $result->rewind_tree()
Function: Rewinds the tree iterator so that next_tree can be
called again from the beginning
Returns : none
Args : none