Bio::Tools::Phylo::PAML Result
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvs
Summary
Bio::Tools::Phylo::PAML::Result - A PAML result set object
Package variables
No package variables defined.
Inherit
Bio::AnalysisResultI Bio::Root::Root
Synopsis
  # see Bio::Tools::Phylo::PAML for example usage
use Bio::Tools::Phylo::PAML;
my $parser = Bio::Tools::Phylo::PAML->new
(-file => "./results/mlc", -dir => "./results/");
# get the first/next result; a Bio::Tools::Phylo::PAML::Result object, # which isa Bio::SeqAnalysisResultI object. my $result = $parser->next_result(); my @seqs = $result->get_seqs; my %input_params = $result->get_input_parameters; my @basfreq = $result->get_codon_pos_basefreq; my $MLmatrix = $result->get_MLmatrix; # get MaxLikelihood Matrix my $NGmatrix = $result->get_NGmatrix; # get Nei-Gojoburi Matrix # for AAML runs my $AAmatrix = $result->get_AADistMatrix; my $AAMLmatrix = $result->get_AAMLDistMatrix; # if -dir contains an rst file get list of # Bio::PrimarySeq ancestral state reconstructions of the sequences my @rsts = $result->get_rst_seqs; # if you want to print the changes on the tree # this will print out the # anc_aa => ANCESTRAL AMINO ACID # anc_prob => ANCESTRAL AA PROBABILITY # derived_aa => DERIVED AA # derived_prob => DERIVE AA PROBABILITY (where appropriate - NA for extant/tip taxas) # site => which codon site this in the alignment @trees = $result->get_rst_trees; for my $t ( @trees ) { for my $node ( $t->get_nodes ) { next unless $node->ancestor; # skip root node my @changes = $node->get_tag_values('changes'); my $chgstr = ''; for my $c ( @changes ) { for my $k ( sort keys %$c ) { $chgstr .= "$k => $c->{$k} "; } $chgstr .= "\n\t"; } printf "node:%s n=%s s=%s\n\t%s\n", $node->id, $node->get_tag_values('n'), $node->get_tag_values('s'), $chgstr; } } # Persite probabilities my $persite = $result->get_rst_persite; # let's score site 1 $site = $persite->[2]; # so site 2, node 2 (extant node, node 2) print $site->[2]->{'codon'}, ' ',$site->[2]->{'aa'},"\n"; # site 2, node 3 print $site->[3]->{'codon'}, ' ',$site->[3]->{'aa'}, "\n"; # ancestral node 9, codon, aa, marginal probabilities; Yang95 is listed as # (eqn. 4 in Yang et al. 1995 Genetics 141:1641-1650) in PAML rst file. print $site->[9]->{'codon'}, ' ',$site->[9]->{'aa'}, ' ', $site->[9]->{'prob'}, ' ', $site->[9]->{'Yang95_aa'},' ', $site->[9]->{'Yang95_aa_prob'},"\n";
Description
This is a container object for PAML Results.
Methods
newDescriptionCode
next_treeDescriptionCode
get_treesDescriptionCode
rewind_tree_iteratorDescriptionCode
add_treeDescriptionCode
set_MLmatrixDescriptionCode
get_MLmatrixDescriptionCode
set_NGmatrixDescriptionCode
get_NGmatrixDescriptionCode
add_seqDescriptionCode
reset_seqsDescriptionCode
get_seqsDescriptionCode
set_codon_pos_basefreqDescriptionCode
get_codon_pos_basefreqDescriptionCode
versionDescriptionCode
seqfileDescriptionCode
modelDescriptionCode
patternsDescriptionCode
set_AAFreqsDescriptionCode
get_AAFreqsDescriptionCode
set_NTFreqsDescriptionCode
get_NTFreqsDescriptionCode
add_statDescriptionCode
get_statDescriptionCode
get_stat_namesDescriptionCode
get_AADistMatrixDescriptionCode
set_AADistMatrixDescriptionCode
get_AAMLDistMatrixDescriptionCode
set_AAMLDistMatrixDescriptionCode
add_NSSite_resultDescriptionCode
get_NSSite_resultsDescriptionCode
set_CodonFreqsDescriptionCode
get_CodonFreqsDescriptionCode
get_KappaMatrixDescriptionCode
set_KappaMatrixDescriptionCode
get_AlphaMatrixDescriptionCode
set_AlphaMatrixDescriptionCode
set_input_parameterDescriptionCode
get_input_parametersDescriptionCode
reset_input_parametersDescriptionCode
add_rst_seqDescriptionCode
reset_rst_seqsDescriptionCode
get_rst_seqsDescriptionCode
add_rst_treeDescriptionCode
reset_rst_treesDescriptionCode
get_rst_treesDescriptionCode
set_rst_persiteDescriptionCode
get_rst_persiteDescriptionCode
Methods description
newcode    nextTop
 Title   : new
Usage : my $obj = Bio::Tools::Phylo::PAML::Result->new(%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
-seqs => array reference of Bio::PrimarySeqI objects
-codonpos => array reference of codon positions
-codonfreq => array reference of codon frequencies
-version => version string
-model => model string
-patterns => hashref with the fields '-patterns', '-ns', '-ls'
-stats => array ref of misc stats (optional)
-aafreq => Hashref of AA frequencies (only for AAML)
-aadistmat => Bio::Matrix::PhylipDist (only for AAML)
-aamldistmat => Bio::Matrix::PhylipDist (only for pairwise AAML)
-ntfreq => array ref of NT frequencies (only for BASEML)
-seqfile => seqfile used
-kappa_mat => Bio::Matrix::PhylipDist of kappa values (only for BASEML)
-alpha_mat => Bio::Matrix::PhylipDist of alpha values (only for BASEML)
-NSSitesresult => arrayref of PAML::ModelResult
-input_params => input params from .ctl file
-rst => array reference of Bio::PrimarySeqI objects
of ancestral state reconstruction
-rst_persite=> arrayref of persite data, this is a complicated set of AoH
-rst_trees => rst trees with changes coded on the tree
See Also: Bio::Tree::TreeI, Bio::PrimarySeqI, Bio::Matrix::PhylipDist, Bio::Tools::Phylo::PAML
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
get_treescodeprevnextTop
 Title   : get_trees
Usage : my @trees = $result->get_trees;
Function: Get all the parsed trees as an array
Returns : Array of trees
Args : none
rewind_tree_iteratorcodeprevnextTop
 Title   : rewind_tree_iterator
Usage : $result->rewind_tree_iterator()
Function: Rewinds the tree iterator so that next_tree can be
called again from the beginning
Returns : none
Args : none
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
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)
get_MLmatrixcodeprevnextTop
 Title   : get_MLmatrix
Usage : my $mat = $result->get_MLmatrix()
Function: Get the ML matrix
Returns : 2D Array reference
Args : none
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)
get_NGmatrixcodeprevnextTop
 Title   : get_NGmatrix
Usage : my $mat = $result->get_NGmatrix()
Function: Get the Nei & Gojobori matrix
Returns : 2D Array reference
Args : none
add_seqcodeprevnextTop
 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
reset_seqscodeprevnextTop
 Title   : reset_seqs
Usage : $result->reset_seqs
Function: Reset the OTU seqs stored
Returns : none
Args : none
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
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
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
versioncodeprevnextTop
 Title   : version
Usage : $obj->version($newval)
Function: Get/Set version
Returns : value of version
Args : newvalue (optional)
seqfilecodeprevnextTop
 Title   : seqfile
Usage : $obj->seqfile($newval)
Function: Get/Set seqfile
Returns : value of seqfile
Args : newvalue (optional)
modelcodeprevnextTop
 Title   : model
Usage : $obj->model($newval)
Function: Get/Set model
Returns : value of model
Args : on set, new value (a scalar or undef, optional)
patternscodeprevnextTop
 Title   : patterns
Usage : $obj->patterns($newval)
Function: Get/Set Patterns hash
Returns : Hashref of pattern data
Args : [optional] Hashref of patterns
: The hashref is typically
: { -patterns => \@arrayref
: -ns => $ns
: -ls => $ls
: }
set_AAFreqscodeprevnextTop
 Title   : set_AAFreqs
Usage : $result->set_AAFreqs(\%aafreqs);
Function: Get/Set AA freqs
Returns : none
Args : Hashref, keys are the sequence names, each points to a hashref
which in turn has keys which are the amino acids
get_AAFreqscodeprevnextTop
 Title   : get_AAFreqs
Usage : my %all_aa_freqs = $result->get_AAFreqs()
OR
my %seq_aa_freqs = $result->get_AAFreqs($seqname)
Function: Get the AA freqs, either for every sequence or just
for a specific sequence
The average aa freqs for the entire set are also available
for the sequence named 'Average'
Returns : Hashref
Args : (optional) sequence name to retrieve aa freqs for
set_NTFreqscodeprevnextTop
 Title   : set_NTFreqs
Usage : $result->set_NTFreqs(\%aafreqs);
Function: Get/Set NT freqs
Returns : none
Args : Hashref, keys are the sequence names, each points to a hashref
which in turn has keys which are the amino acids
get_NTFreqscodeprevnextTop
 Title   : get_NTFreqs
Usage : my %all_nt_freqs = $result->get_NTFreqs()
OR
my %seq_nt_freqs = $result->get_NTFreqs($seqname)
Function: Get the NT freqs, either for every sequence or just
for a specific sequence
The average nt freqs for the entire set are also available
for the sequence named 'Average'
Returns : Hashref
Args : (optional) sequence name to retrieve nt freqs for
add_statcodeprevnextTop
 Title   : add_stat
Usage : $result->add_stat($stat,$value);
Function: Add some misc stat valuess (key/value pairs)
Returns : none
Args : $stat stat name
$value stat value
get_statcodeprevnextTop
 Title   : get_stat
Usage : my $value = $result->get_stat($name);
Function: Get the value for a stat of a given name
Returns : scalar value
Args : name of the stat
get_stat_namescodeprevnextTop
 Title   : get_stat_names
Usage : my @names = $result->get_stat_names;
Function: Get the stat names stored for the result
Returns : array of names
Args : none
get_AADistMatrixcodeprevnextTop
 Title   : get_AADistMatrix
Usage : my $mat = $obj->get_AADistMatrix()
Function: Get AADistance Matrix
Returns : value of AADistMatrix (Bio::Matrix::PhylipDist)
Args : none
set_AADistMatrixcodeprevnextTop
 Title   : set_AADistMatrix
Usage : $obj->set_AADistMatrix($mat);
Function: Set the AADistrance Matrix (Bio::Matrix::PhylipDist)
Returns : none
Args : AADistrance Matrix (Bio::Matrix::PhylipDist)
get_AAMLDistMatrixcodeprevnextTop
 Title   : get_AAMLDistMatrix
Usage : my $mat = $obj->get_AAMLDistMatrix()
Function: Get AAMLDistance Matrix
Returns : value of AAMLDistMatrix (Bio::Matrix::PhylipDist)
Args : none
set_AAMLDistMatrixcodeprevnextTop
 Title   : set_AAMLDistMatrix
Usage : $obj->set_AAMLDistMatrix($mat);
Function: Set the AA ML Distrance Matrix (Bio::Matrix::PhylipDist)
Returns : none
Args : AAMLDistrance Matrix (Bio::Matrix::PhylipDist)
add_NSSite_resultcodeprevnextTop
 Title   : add_NSSite_result
Usage : $result->add_NSSite_result($model)
Function: Add a NSsite result (PAML::ModelResult)
Returns : none
Args : Bio::Tools::Phylo::PAML::ModelResult
get_NSSite_resultscodeprevnextTop
 Title   : get_NSSite_results
Usage : my @results = @{$self->get_NSSite_results};
Function: Get the reference to the array of NSSite_results
Returns : Array of PAML::ModelResult results
Args : none
set_CodonFreqscodeprevnextTop
 Title   : set_CodonFreqs
Usage : $obj->set_CodonFreqs($newval)
Function: Get/Set the Codon Frequence table
Returns : value of set_CodonFreqs (a scalar)
Args : on set, new value (a scalar or undef, optional)
get_CodonFreqscodeprevnextTop
 Title   : get_CodonFreqs
Usage : my @codon_freqs = $result->get_CodonFreqs()
Function: Get the Codon freqs
Returns : Array
Args : none
get_KappaMatrixcodeprevnextTop
 Title   : get_KappaMatrix
Usage : my $mat = $obj->get_KappaMatrix()
Function: Get KappaDistance Matrix
Returns : value of KappaMatrix (Bio::Matrix::PhylipDist)
Args : none
set_KappaMatrixcodeprevnextTop
 Title   : set_KappaMatrix
Usage : $obj->set_KappaMatrix($mat);
Function: Set the KappaDistrance Matrix (Bio::Matrix::PhylipDist)
Returns : none
Args : KappaDistrance Matrix (Bio::Matrix::PhylipDist)
get_AlphaMatrixcodeprevnextTop
 Title   : get_AlphaMatrix
Usage : my $mat = $obj->get_AlphaMatrix()
Function: Get AlphaDistance Matrix
Returns : value of AlphaMatrix (Bio::Matrix::PhylipDist)
Args : none
set_AlphaMatrixcodeprevnextTop
 Title   : set_AlphaMatrix
Usage : $obj->set_AlphaMatrix($mat);
Function: Set the AlphaDistrance Matrix (Bio::Matrix::PhylipDist)
Returns : none
Args : AlphaDistrance Matrix (Bio::Matrix::PhylipDist)
set_input_parametercodeprevnextTop
 Title   : set_input_parameter
Usage : $obj->set_input_parameter($p,$vl);
Function: Set an Input Parameter
Returns : none
Args : $parameter and $value
get_input_parameterscodeprevnextTop
 Title   : get_input_parameters
Usage : $obj->get_input_parameters;
Function: Get Input Parameters
Returns : Hash of key/value pairs
Args : none
reset_input_parameterscodeprevnextTop
 Title   : reset_input_parameters
Usage : $obj->reset_input_parameters;
Function: Reset the Input Parameters hash
Returns : none
Args : none
add_rst_seqcodeprevnextTop
 Title   : add_rst_seq
Usage : $obj->add_rst_seq($seq)
Function: Add a Bio::PrimarySeq to the RST Result
Returns : none
Args : Bio::PrimarySeqI
See also : Bio::PrimarySeqI
reset_rst_seqscodeprevnextTop
 Title   : reset_rst_seqs
Usage : $result->reset_rst_seqs
Function: Reset the RST seqs stored
Returns : none
Args : none
get_rst_seqscodeprevnextTop
 Title   : get_rst_seqs
Usage : my @otus = $result->get_rst_seqs
Function: Get the seqs Bio::PrimarySeq
Returns : Array of Bio::PrimarySeqI objects
Args : None
See also : Bio::PrimarySeq
add_rst_treecodeprevnextTop
 Title   : add_rst_tree
Usage : $obj->add_rst_tree($tree)
Function: Add a Bio::Tree::TreeI to the RST Result
Returns : none
Args : Bio::Tree::TreeI
See also : Bio::Tree::TreeI
reset_rst_treescodeprevnextTop
 Title   : reset_rst_trees
Usage : $result->reset_rst_trees
Function: Reset the RST trees stored
Returns : none
Args : none
get_rst_treescodeprevnextTop
 Title   : get_rst_trees
Usage : my @otus = $result->get_rst_trees
Function: Get the trees Bio::Tree::TreeI
Returns : Array of Bio::Tree::TreeI objects
Args : None
See also : Bio::Tree::TreeI
set_rst_persitecodeprevnextTop
 Title   : set_rst_persite
Usage : $obj->set_rst_persite($newval)
Function: Get/Set the per-site RST values
Returns : value of set_rst_persite (a scalar)
Args : on set, new value (a scalar or undef, optional)
get_rst_persitecodeprevnextTop
 Title   : get_rst_persite
Usage : my @rst_persite = @{$result->get_rst_persite()}
Function: Get the per-site RST values
Returns : Array
Args : none
Methods code
newdescriptionprevnextTop
sub new {
  my($class,@args) = @_;

  my $self = $class->SUPER::new(@args);
  my ($trees,$mlmat,$seqs,$ngmatrix,
      $codonpos,$codonfreq,$version,
      $model,$patterns, $stats,
      $aafreq, $aadistmat, 
      $aamldistmat,
      $ntfreqs, $seqfile, $kappa_mat, $alpha_mat,
      $NSSitesresults,$input_params,$rst,$rst_persite,$rst_trees ) = 
	  $self->_rearrange([qw
			     (TREES MLMATRIX 
			      SEQS NGMATRIX
			      CODONPOS CODONFREQ
			      VERSION MODEL PATTERNS
			      STATS AAFREQ AADISTMAT
			      AAMLDISTMAT 
			      NTFREQ SEQFILE
			      KAPPA_DISTMAT
			      ALPHA_DISTMAT
			      NSSITESRESULTS
			      INPUT_PARAMS
			      RST RST_PERSITE RST_TREES)], 
			    @args);
  $self->reset_seqs;
  if( $trees ) {
      if(ref($trees) !~ /ARRAY/i ) { 
	  $self->warn("Must provide 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 provide a valid array reference to initialize MLmatrix");
      } else { 
	  $self->set_MLmatrix($mlmat);
      }
  } 
  if( $seqs ) { 
      if( ref($seqs) !~ /ARRAY/i ) {
	  $self->warn("Must provide 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 provide a valid array reference to initialize NGmatrix");
      } else { 
	  $self->set_NGmatrix($ngmatrix);
      }
  } 
  if( $codonfreq ) {
      if( ref($codonfreq) =~ /ARRAY/i ) {
	  $self->set_CodonFreqs($codonfreq);
      } else { 
	  $self->warn("Must provide a valid array reference to initialize codonfreq");
      }
  }

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

  $self->version($version)   if defined $version;
  $self->seqfile($seqfile)   if defined $seqfile;
  $self->model($model)       if defined $model;
  if( defined $patterns ) {
      if( ref($patterns) =~ /HASH/i ) {
	  $self->patterns($patterns);
      } else {
	  $self->warn("Must provide a valid array reference to initialize patterns");
      }
  }

  $self->{'_aafreqs'} = {};
  if( $aafreq ) {
      if( ref($aafreq) =~ /HASH/i ) {
	  $self->set_AAFreqs($aafreq);
      } else { 
	  $self->warn("Must provide a valid hash reference to initialize aafreq");
      }
  }
  if( $stats ) {
      if( ref($stats) =~ /HASH/i ) {
	  while( my ($stat,$val) = each %$stats) {
	      $self->add_stat($stat,$val);
	  }
      } else { 
	  $self->warn("Must provide a valid hash reference initialize stats");
      }
  }
  $self->set_AADistMatrix($aadistmat) if defined $aadistmat;
  $self->set_AAMLDistMatrix($aamldistmat) if defined $aamldistmat;

  if( defined $NSSitesresults ) {
      if( ref($NSSitesresults) !~ /ARRAY/i ) {
	  $self->warn("expected an arrayref for -NSSitesresults");
      } else { 
	  foreach my $m ( @$NSSitesresults ) {
	      $self->add_NSSite_result($m);
	  }
      }
  }

  $self->{'_ntfreqs'} = {};
  if( $ntfreqs ) {
      if( ref($ntfreqs) =~ /HASH/i ) {
	  $self->set_NTFreqs($ntfreqs);
      } else { 
	  $self->warn("Must provide a valid hash reference to initialize ntfreq");
      }
  }

  if( $kappa_mat ) {
      $self->set_KappaMatrix($kappa_mat);
  } 
  if( $alpha_mat ) {
      $self->set_AlphaMatrix($alpha_mat);
  }

  if( $input_params ) {
      if(  ref($input_params) !~ /HASH/i ) {
	  $self->warn("Must provide a valid hash object for input_params\n");
      } else {
	  while( my ($p,$v) = each %$input_params ) {
	      $self->set_input_parameter($p,$v);
	  }
      }
      
  }
  $self->reset_rst_seqs;
  if( $rst ) {
      if( ref($rst) =~ /ARRAY/i ) {	  
	  for ( @$rst ) {
	      $self->add_rst_seq($_);
	  }
      } else {
	  $self->warn("Need a valid array ref for -rst option\n");
      }
  }
  if( defined $rst_persite ) {
      $self->set_rst_persite($rst_persite);
  }
  $self->reset_rst_trees;
  if( $rst_trees ) {
      if( ref($rst_trees) =~ /ARRAY/i ) {	  
	  for ( @$rst_trees ) {
	      $self->add_rst_tree($_);
	  }
      } else {
	  $self->warn("Need a valid array ref for -rst_trees option\n");
      }
  }

  return $self;
}
next_treedescriptionprevnextTop
sub next_tree {
   my ($self,@args) = @_;
   return $self->{'_trees'}->[$self->{'_treeiterator'}++] || undef;
}
get_treesdescriptionprevnextTop
sub get_trees {
   my ($self) = @_;
   return @{$self->{'_trees'} || []};
}
rewind_tree_iteratordescriptionprevnextTop
sub rewind_tree_iterator {
    shift->{'_treeiterator'} = 0;
}
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'}};
}
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;
}
get_MLmatrixdescriptionprevnextTop
sub get_MLmatrix {
   my ($self,@args) = @_;
   return $self->{'_mlmatrix'};
}
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;
}
get_NGmatrixdescriptionprevnextTop
sub get_NGmatrix {
   my ($self,@args) = @_;
   return $self->{'_ngmatrix'};
}
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;
   }
}
reset_seqsdescriptionprevnextTop
sub reset_seqs {
   my ($self) = @_;
   $self->{'_seqs'} = [];
}
get_seqsdescriptionprevnextTop
sub get_seqs {
   my ($self) = @_;
   return @{$self->{'_seqs'}};
}
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];
}
get_codon_pos_basefreqdescriptionprevnextTop
sub get_codon_pos_basefreq {
   my ($self) = @_;
   return @{$self->{'_codonposbasefreq'}};
}
versiondescriptionprevnextTop
sub version {
   my $self = shift;
   $self->{'_version'} = shift if @_;
   return $self->{'_version'};
}
seqfiledescriptionprevnextTop
sub seqfile {
   my $self = shift;
   $self->{'_seqfile'} = shift if @_;
   return $self->{'_seqfile'};
}
modeldescriptionprevnextTop
sub model {
    my $self = shift;

    return $self->{'_model'} = shift if @_;
    return $self->{'_model'};
}
patternsdescriptionprevnextTop
sub patterns {
    my $self = shift;
    return $self->{'_patterns'} = shift if @_;
    return $self->{'_patterns'};
}
set_AAFreqsdescriptionprevnextTop
sub set_AAFreqs {
   my ($self,$aafreqs) = @_;
   
   if( $aafreqs && ref($aafreqs) =~ /HASH/i ) {
       foreach my $seqname ( keys %{$aafreqs} ) {
	   $self->{'_aafreqs'}->{$seqname} = $aafreqs->{$seqname};
       }
   }
}
get_AAFreqsdescriptionprevnextTop
sub get_AAFreqs {
   my ($self,$seqname) = @_;
   if( $seqname ) {
       return $self->{'_aafreqs'}->{$seqname} || {};
   } else { 
       return $self->{'_aafreqs'};
   }
}
set_NTFreqsdescriptionprevnextTop
sub set_NTFreqs {
   my ($self,$freqs) = @_;
   
   if( $freqs && ref($freqs) =~ /HASH/i ) {
       foreach my $seqname ( keys %{$freqs} ) {
	   $self->{'_ntfreqs'}->{$seqname} = $freqs->{$seqname};
       }
   }
}
get_NTFreqsdescriptionprevnextTop
sub get_NTFreqs {
   my ($self,$seqname) = @_;
   if( $seqname ) {
       return $self->{'_ntfreqs'}->{$seqname} || {};
   } else { 
       return $self->{'_ntfreqs'};
   }
}
add_statdescriptionprevnextTop
sub add_stat {
   my ($self,$stat,$value) = @_;
   return if( ! defined $stat || !defined $value );
   $self->{'_stats'}->{$stat} = $value;
   return;
}
get_statdescriptionprevnextTop
sub get_stat {
   my ($self,$statname) = @_;
   return $self->{'_stats'}->{$statname};
}
get_stat_namesdescriptionprevnextTop
sub get_stat_names {
   my ($self) = @_;
   return keys %{$self->{'_stats'} || {}};
}
get_AADistMatrixdescriptionprevnextTop
sub get_AADistMatrix {
    my $self = shift;
    return $self->{'_AADistMatix'};
}
set_AADistMatrixdescriptionprevnextTop
sub set_AADistMatrix {
   my ($self,$d) = @_;
   if( ! $d || 
       ! ref($d) ||
       ! $d->isa('Bio::Matrix::PhylipDist') ) {
       $self->warn("Must provide a valid Bio::Matrix::MatrixI for set_AADistMatrix");
   }
   $self->{'_AADistMatix'} = $d;
   return;
}
get_AAMLDistMatrixdescriptionprevnextTop
sub get_AAMLDistMatrix {
    my $self = shift;
    return $self->{'_AAMLDistMatix'};
}
set_AAMLDistMatrixdescriptionprevnextTop
sub set_AAMLDistMatrix {
   my ($self,$d) = @_;
   if( ! $d || 
       ! ref($d) ||
       ! $d->isa('Bio::Matrix::PhylipDist') ) {
       $self->warn("Must provide a valid Bio::Matrix::MatrixI for set_AAMLDistMatrix");
   }
   $self->{'_AAMLDistMatix'} = $d;
   return;
}
add_NSSite_resultdescriptionprevnextTop
sub add_NSSite_result {
   my ($self,$model) = @_;
   if( defined $model ) {
       push @{$self->{'_nssiteresult'}}, $model;
   }
   return scalar @{$self->{'_nssiteresult'}};
}
get_NSSite_resultsdescriptionprevnextTop
sub get_NSSite_results {
   my ($self) = @_;
   return @{$self->{'_nssiteresult'} || []};
}
set_CodonFreqsdescriptionprevnextTop
sub set_CodonFreqs {
    my $self = shift;

    return $self->{'_codonfreqs'} = shift if @_;
    return $self->{'_codonfreqs'};
}
get_CodonFreqsdescriptionprevnextTop
sub get_CodonFreqs {
   my ($self) = @_;
   return @{$self->{'_codonfreqs'} || []};
}
get_KappaMatrixdescriptionprevnextTop
sub get_KappaMatrix {
    my $self = shift;
    return $self->{'_KappaMatix'};
}
set_KappaMatrixdescriptionprevnextTop
sub set_KappaMatrix {
   my ($self,$d) = @_;
   if( ! $d || 
       ! ref($d) ||
       ! $d->isa('Bio::Matrix::PhylipDist') ) {
       $self->warn("Must provide a valid Bio::Matrix::MatrixI for set_NTDistMatrix");
   }
   $self->{'_KappaMatix'} = $d;
   return;
}
get_AlphaMatrixdescriptionprevnextTop
sub get_AlphaMatrix {
    my $self = shift;
    return $self->{'_AlphaMatix'};
}
set_AlphaMatrixdescriptionprevnextTop
sub set_AlphaMatrix {
   my ($self,$d) = @_;
   if( ! $d || 
       ! ref($d) ||
       ! $d->isa('Bio::Matrix::PhylipDist') ) {
       $self->warn("Must provide a valid Bio::Matrix::MatrixI for set_NTDistMatrix");
   }
   $self->{'_AlphaMatix'} = $d;
   return;
}
set_input_parameterdescriptionprevnextTop
sub set_input_parameter {
   my ($self,$p,$v) = @_;
   return unless defined $p;
   $self->{'_input_parameters'}->{$p} = $v;
}
get_input_parametersdescriptionprevnextTop
sub get_input_parameters {
   my ($self) = @_;
   return %{$self->{'_input_parameters'} || {}};
}
reset_input_parametersdescriptionprevnextTop
sub reset_input_parameters {
   my ($self) = @_;
   $self->{'_input_parameters'} = {};
}
add_rst_seqdescriptionprevnextTop
sub add_rst_seq {
   my ($self,$seq) = @_;
   if( $seq ) { 
       unless( $seq->isa("Bio::PrimarySeqI") ) {
	   $self->warn("Must provide a valid Bio::PrimarySeqI to add_rst_seq");
	   return;
       }
       push @{$self->{'_rstseqs'}},$seq;
   }
}
reset_rst_seqsdescriptionprevnextTop
sub reset_rst_seqs {
   my ($self) = @_;
   $self->{'_rstseqs'} = [];
}
get_rst_seqsdescriptionprevnextTop
sub get_rst_seqs {
   my ($self) = @_;
   return @{$self->{'_rstseqs'} || []};
}
add_rst_treedescriptionprevnextTop
sub add_rst_tree {
   my ($self,$tree) = @_;
   if( $tree ) { 
       unless( $tree->isa("Bio::Tree::TreeI") ) {
	   $self->warn("Must provide a valid Bio::Tree::TreeI to add_rst_tree not $tree");
	   return;
       }
       push @{$self->{'_rsttrees'}},$tree;
   }
}
reset_rst_treesdescriptionprevnextTop
sub reset_rst_trees {
   my ($self) = @_;
   $self->{'_rsttrees'} = [];
}
get_rst_treesdescriptionprevnextTop
sub get_rst_trees {
   my ($self) = @_;
   return @{$self->{'_rsttrees'} || []};
}
set_rst_persitedescriptionprevnextTop
sub set_rst_persite {
    my $self = shift;

    return $self->{'_rstpersite'} = shift if @_;
    return $self->{'_rstpersite'};
}
get_rst_persitedescriptionprevnextTop
sub get_rst_persite {
   my ($self) = @_;
   return $self->{'_rstpersite'} || [];
}



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/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
email or the web:
  https://redmine.open-bio.org/projects/bioperl/
AUTHOR - Jason Stajich, Aaron MackeyTop
 Email jason-at-bioperl-dot-org
Email amackey-at-virginia-dot-edu
CONTRIBUTORSTop
Albert Vilella avilella-AT-gmail-DOT-com
APPENDIXTop
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _
BASEML Relavent valuesTop
Reconstructed Ancestral State relevant options Top