2 # BioPerl module for Bio::Tools::Phylo::PAML::Result
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Jason Stajich <jason-at-bioperl.org>
8 # Copyright Jason Stajich, Aaron Mackey
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::Tools::Phylo::PAML::Result - A PAML result set object
20 # see Bio::Tools::Phylo::PAML for example usage
21 use Bio::Tools::Phylo::PAML;
22 my $parser = Bio::Tools::Phylo::PAML->new
23 (-file => "./results/mlc", -dir => "./results/");
25 # get the first/next result; a Bio::Tools::Phylo::PAML::Result object,
26 # which isa Bio::SeqAnalysisResultI object.
27 my $result = $parser->next_result();
29 my @seqs = $result->get_seqs;
30 my %input_params = $result->get_input_parameters;
31 my @basfreq = $result->get_codon_pos_basefreq;
32 my $MLmatrix = $result->get_MLmatrix; # get MaxLikelihood Matrix
33 my $NGmatrix = $result->get_NGmatrix; # get Nei-Gojoburi Matrix
37 my $AAmatrix = $result->get_AADistMatrix;
38 my $AAMLmatrix = $result->get_AAMLDistMatrix;
40 # if -dir contains an rst file get list of
41 # Bio::PrimarySeq ancestral state reconstructions of the sequences
42 my @rsts = $result->get_rst_seqs;
45 # if you want to print the changes on the tree
46 # this will print out the
47 # anc_aa => ANCESTRAL AMINO ACID
48 # anc_prob => ANCESTRAL AA PROBABILITY
49 # derived_aa => DERIVED AA
50 # derived_prob => DERIVE AA PROBABILITY (where appropriate - NA for extant/tip taxas)
51 # site => which codon site this in the alignment
52 @trees = $result->get_rst_trees;
53 for my $t ( @trees ) {
54 for my $node ( $t->get_nodes ) {
55 next unless $node->ancestor; # skip root node
56 my @changes = $node->get_tag_values('changes');
58 for my $c ( @changes ) {
59 for my $k ( sort keys %$c ) {
60 $chgstr .= "$k => $c->{$k} ";
65 printf "node:%s n=%s s=%s\n\t%s\n",
67 $node->get_tag_values('n'),
68 $node->get_tag_values('s'),
73 # Persite probabilities
74 my $persite = $result->get_rst_persite;
76 $site = $persite->[2];
77 # so site 2, node 2 (extant node, node 2)
78 print $site->[2]->{'codon'}, ' ',$site->[2]->{'aa'},"\n";
80 print $site->[3]->{'codon'}, ' ',$site->[3]->{'aa'}, "\n";
82 # ancestral node 9, codon, aa, marginal probabilities; Yang95 is listed as
83 # (eqn. 4 in Yang et al. 1995 Genetics 141:1641-1650) in PAML rst file.
84 print $site->[9]->{'codon'}, ' ',$site->[9]->{'aa'}, ' ', $site->[9]->{'prob'}, ' ',
85 $site->[9]->{'Yang95_aa'},' ', $site->[9]->{'Yang95_aa_prob'},"\n";
90 This is a container object for PAML Results.
96 User feedback is an integral part of the evolution of this and other
97 Bioperl modules. Send your comments and suggestions preferably to
98 the Bioperl mailing list. Your participation is much appreciated.
100 bioperl-l@bioperl.org - General discussion
101 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
105 Please direct usage questions or support issues to the mailing list:
107 I<bioperl-l@bioperl.org>
109 rather than to the module maintainer directly. Many experienced and
110 reponsive experts will be able look at the problem and quickly
111 address it. Please include a thorough description of the problem
112 with code and data examples if at all possible.
114 =head2 Reporting Bugs
116 Report bugs to the Bioperl bug tracking system to help us keep track
117 of the bugs and their resolution. Bug reports can be submitted via
120 https://github.com/bioperl/bioperl-live/issues
122 =head1 AUTHOR - Jason Stajich, Aaron Mackey
124 Email jason-at-bioperl-dot-org
125 Email amackey-at-virginia-dot-edu
129 Albert Vilella avilella-AT-gmail-DOT-com
133 The rest of the documentation details each of the object methods.
134 Internal methods are usually preceded with a _
139 # Let the code begin...
142 package Bio
::Tools
::Phylo
::PAML
::Result
;
146 use base
qw(Bio::Root::Root Bio::AnalysisResultI);
151 Usage : my $obj = Bio::Tools::Phylo::PAML::Result->new(%data);
152 Function: Builds a new Bio::Tools::Phylo::PAML::Result object
153 Returns : Bio::Tools::Phylo::PAML::Result
154 Args : -trees => array reference of Bio::Tree::TreeI objects
155 -MLmatrix => ML matrix
156 -seqs => array reference of Bio::PrimarySeqI objects
157 -codonpos => array reference of codon positions
158 -codonfreq => array reference of codon frequencies
159 -version => version string
160 -model => model string
161 -patterns => hashref with the fields '-patterns', '-ns', '-ls'
162 -stats => array ref of misc stats (optional)
163 -aafreq => Hashref of AA frequencies (only for AAML)
164 -aadistmat => Bio::Matrix::PhylipDist (only for AAML)
165 -aamldistmat => Bio::Matrix::PhylipDist (only for pairwise AAML)
166 -ntfreq => array ref of NT frequencies (only for BASEML)
167 -seqfile => seqfile used
168 -kappa_mat => Bio::Matrix::PhylipDist of kappa values (only for BASEML)
169 -alpha_mat => Bio::Matrix::PhylipDist of alpha values (only for BASEML)
170 -NSSitesresult => arrayref of PAML::ModelResult
171 -input_params => input params from .ctl file
172 -rst => array reference of Bio::PrimarySeqI objects
173 of ancestral state reconstruction
174 -rst_persite=> arrayref of persite data, this is a complicated set of AoH
175 -rst_trees => rst trees with changes coded on the tree
177 See Also: L<Bio::Tree::TreeI>, L<Bio::PrimarySeqI>, L<Bio::Matrix::PhylipDist>, L<Bio::Tools::Phylo::PAML>
183 my($class,@args) = @_;
185 my $self = $class->SUPER::new
(@args);
186 my ($trees,$mlmat,$seqs,$ngmatrix,
187 $codonpos,$codonfreq,$version,
188 $model,$patterns, $stats,
191 $ntfreqs, $seqfile, $kappa_mat, $alpha_mat,
192 $NSSitesresults,$input_params,$rst,$rst_persite,$rst_trees ) =
193 $self->_rearrange([qw
197 VERSION MODEL PATTERNS
198 STATS AAFREQ AADISTMAT
205 RST RST_PERSITE RST_TREES
)],
209 if(ref($trees) !~ /ARRAY/i ) {
210 $self->warn("Must provide a valid array reference to initialize trees");
212 foreach my $t ( @
$trees ) {
217 $self->{'_treeiterator'} = 0;
220 if( ref($mlmat) !~ /ARRAY/i ) {
221 $self->warn("Must provide a valid array reference to initialize MLmatrix");
223 $self->set_MLmatrix($mlmat);
227 if( ref($seqs) !~ /ARRAY/i ) {
228 $self->warn("Must provide a valid array reference to initialize seqs");
230 foreach my $s ( @
$seqs ) {
236 if( ref($ngmatrix) !~ /ARRAY/i ) {
237 $self->warn("Must provide a valid array reference to initialize NGmatrix");
239 $self->set_NGmatrix($ngmatrix);
243 if( ref($codonfreq) =~ /ARRAY/i ) {
244 $self->set_CodonFreqs($codonfreq);
246 $self->warn("Must provide a valid array reference to initialize codonfreq");
251 if( ref($codonpos) !~ /ARRAY/i ) {
252 $self->warn("Must provide a valid array reference to initialize codonpos");
254 $self->set_codon_pos_basefreq(@
$codonpos);
258 $self->version($version) if defined $version;
259 $self->seqfile($seqfile) if defined $seqfile;
260 $self->model($model) if defined $model;
261 if( defined $patterns ) {
262 if( ref($patterns) =~ /HASH/i ) {
263 $self->patterns($patterns);
265 $self->warn("Must provide a valid array reference to initialize patterns");
269 $self->{'_aafreqs'} = {};
271 if( ref($aafreq) =~ /HASH/i ) {
272 $self->set_AAFreqs($aafreq);
274 $self->warn("Must provide a valid hash reference to initialize aafreq");
278 if( ref($stats) =~ /HASH/i ) {
279 while( my ($stat,$val) = each %$stats) {
280 $self->add_stat($stat,$val);
283 $self->warn("Must provide a valid hash reference initialize stats");
286 $self->set_AADistMatrix($aadistmat) if defined $aadistmat;
287 $self->set_AAMLDistMatrix($aamldistmat) if defined $aamldistmat;
289 if( defined $NSSitesresults ) {
290 if( ref($NSSitesresults) !~ /ARRAY/i ) {
291 $self->warn("expected an arrayref for -NSSitesresults");
293 foreach my $m ( @
$NSSitesresults ) {
294 $self->add_NSSite_result($m);
299 $self->{'_ntfreqs'} = {};
301 if( ref($ntfreqs) =~ /HASH/i ) {
302 $self->set_NTFreqs($ntfreqs);
304 $self->warn("Must provide a valid hash reference to initialize ntfreq");
309 $self->set_KappaMatrix($kappa_mat);
312 $self->set_AlphaMatrix($alpha_mat);
315 if( $input_params ) {
316 if( ref($input_params) !~ /HASH/i ) {
317 $self->warn("Must provide a valid hash object for input_params\n");
319 while( my ($p,$v) = each %$input_params ) {
320 $self->set_input_parameter($p,$v);
325 $self->reset_rst_seqs;
327 if( ref($rst) =~ /ARRAY/i ) {
329 $self->add_rst_seq($_);
332 $self->warn("Need a valid array ref for -rst option\n");
335 if( defined $rst_persite ) {
336 $self->set_rst_persite($rst_persite);
338 $self->reset_rst_trees;
340 if( ref($rst_trees) =~ /ARRAY/i ) {
341 for ( @
$rst_trees ) {
342 $self->add_rst_tree($_);
345 $self->warn("Need a valid array ref for -rst_trees option\n");
355 Usage : my $tree = $factory->next_tree;
356 Function: Get the next tree from the factory
357 Returns : L<Bio::Tree::TreeI>
363 my ($self,@args) = @_;
364 return $self->{'_trees'}->[$self->{'_treeiterator'}++] || undef;
370 Usage : my @trees = $result->get_trees;
371 Function: Get all the parsed trees as an array
372 Returns : Array of trees
380 return @
{$self->{'_trees'} || []};
383 =head2 rewind_tree_iterator
385 Title : rewind_tree_iterator
386 Usage : $result->rewind_tree_iterator()
387 Function: Rewinds the tree iterator so that next_tree can be
388 called again from the beginning
394 sub rewind_tree_iterator
{
395 shift->{'_treeiterator'} = 0;
401 Usage : $result->add_tree($tree);
402 Function: Adds a tree
403 Returns : integer which is the number of trees stored
404 Args : L<Bio::Tree::TreeI>
409 my ($self,$tree) = @_;
410 if( $tree && ref($tree) && $tree->isa('Bio::Tree::TreeI') ) {
411 push @
{$self->{'_trees'}},$tree;
413 return scalar @
{$self->{'_trees'}};
420 Usage : $result->set_MLmatrix($mat)
421 Function: Set the ML Matrix
423 Args : Arrayref to MLmatrix (must be arrayref to 2D matrix whic is
424 lower triangle pairwise)
430 my ($self,$mat) = @_;
431 return unless ( defined $mat );
432 if( ref($mat) !~ /ARRAY/i ) {
433 $self->warn("Did not provide a valid 2D Array reference for set_MLmatrix");
436 $self->{'_mlmatrix'} = $mat;
442 Usage : my $mat = $result->get_MLmatrix()
443 Function: Get the ML matrix
444 Returns : 2D Array reference
451 my ($self,@args) = @_;
452 return $self->{'_mlmatrix'};
458 Usage : $result->set_NGmatrix($mat)
459 Function: Set the Nei & Gojobori Matrix
461 Args : Arrayref to NGmatrix (must be arrayref to 2D matrix whic is
462 lower triangle pairwise)
468 my ($self,$mat) = @_;
469 return unless ( defined $mat );
470 if( ref($mat) !~ /ARRAY/i ) {
471 $self->warn("Did not provide a valid 2D Array reference for set_NGmatrix");
474 $self->{'_ngmatrix'} = $mat;
480 Usage : my $mat = $result->get_NGmatrix()
481 Function: Get the Nei & Gojobori matrix
482 Returns : 2D Array reference
489 my ($self,@args) = @_;
490 return $self->{'_ngmatrix'};
497 Usage : $obj->add_seq($seq)
498 Function: Add a Bio::PrimarySeq to the Result
500 Args : Bio::PrimarySeqI
501 See also : L<Bio::PrimarySeqI>
506 my ($self,$seq) = @_;
508 unless( $seq->isa("Bio::PrimarySeqI") ) {
509 $self->warn("Must provide a valid Bio::PrimarySeqI to add_seq");
512 push @
{$self->{'_seqs'}},$seq;
520 Usage : $result->reset_seqs
521 Function: Reset the OTU seqs stored
530 $self->{'_seqs'} = [];
536 Usage : my @otus = $result->get_seqs
537 Function: Get the seqs Bio::PrimarySeq (OTU = Operational Taxonomic Unit)
538 Returns : Array of Bio::PrimarySeq
540 See also : L<Bio::PrimarySeq>
546 return @
{$self->{'_seqs'}};
549 =head2 set_codon_pos_basefreq
551 Title : set_codon_pos_basefreq
552 Usage : $result->set_codon_pos_basefreq(@freqs)
553 Function: Set the codon position base frequencies
555 Args : Array of length 3 where each slot has a hashref
561 sub set_codon_pos_basefreq
{
562 my ($self,@codonpos) = @_;
563 if( scalar @codonpos != 3 ) {
564 $self->warn("invalid array to set_codon_pos_basefreq, must be an array of length 3");
567 foreach my $pos ( @codonpos ) {
568 if( ref($pos) !~ /HASH/i ||
569 ! exists $pos->{'A'} ) {
570 $self->warn("invalid array to set_codon_pos_basefreq, must be an array with hashreferences keyed on DNA bases, C,A,G,T");
573 $self->{'_codonposbasefreq'} = [@codonpos];
576 =head2 get_codon_pos_basefreq
578 Title : get_codon_pos_basefreq
579 Usage : my @basepos = $result->get_codon_pos_basefreq;
580 Function: Get the codon position base frequencies
581 Returns : Array of length 3 (each codon position), each
582 slot is a hashref keyed on DNA bases, the values are
583 the frequency of the base at that position for all sequences
585 Note : The array starts at 0 so position '1' is in position '0'
590 sub get_codon_pos_basefreq
{
592 return @
{$self->{'_codonposbasefreq'}};
598 Usage : $obj->version($newval)
599 Function: Get/Set version
600 Returns : value of version
601 Args : newvalue (optional)
608 $self->{'_version'} = shift if @_;
609 return $self->{'_version'};
615 Usage : $obj->seqfile($newval)
616 Function: Get/Set seqfile
617 Returns : value of seqfile
618 Args : newvalue (optional)
625 $self->{'_seqfile'} = shift if @_;
626 return $self->{'_seqfile'};
632 Usage : $obj->model($newval)
633 Function: Get/Set model
634 Returns : value of model
635 Args : on set, new value (a scalar or undef, optional)
643 return $self->{'_model'} = shift if @_;
644 return $self->{'_model'};
651 Usage : $obj->patterns($newval)
652 Function: Get/Set Patterns hash
653 Returns : Hashref of pattern data
654 Args : [optional] Hashref of patterns
655 : The hashref is typically
656 : { -patterns => \@arrayref
665 return $self->{'_patterns'} = shift if @_;
666 return $self->{'_patterns'};
672 Usage : $result->set_AAFreqs(\%aafreqs);
673 Function: Get/Set AA freqs
675 Args : Hashref, keys are the sequence names, each points to a hashref
676 which in turn has keys which are the amino acids
682 my ($self,$aafreqs) = @_;
684 if( $aafreqs && ref($aafreqs) =~ /HASH/i ) {
685 foreach my $seqname ( keys %{$aafreqs} ) {
686 $self->{'_aafreqs'}->{$seqname} = $aafreqs->{$seqname};
694 Usage : my %all_aa_freqs = $result->get_AAFreqs()
696 my %seq_aa_freqs = $result->get_AAFreqs($seqname)
697 Function: Get the AA freqs, either for every sequence or just
698 for a specific sequence
699 The average aa freqs for the entire set are also available
700 for the sequence named 'Average'
702 Args : (optional) sequence name to retrieve aa freqs for
708 my ($self,$seqname) = @_;
710 return $self->{'_aafreqs'}->{$seqname} || {};
712 return $self->{'_aafreqs'};
719 Usage : $result->set_NTFreqs(\%aafreqs);
720 Function: Get/Set NT freqs
722 Args : Hashref, keys are the sequence names, each points to a hashref
723 which in turn has keys which are the amino acids
729 my ($self,$freqs) = @_;
731 if( $freqs && ref($freqs) =~ /HASH/i ) {
732 foreach my $seqname ( keys %{$freqs} ) {
733 $self->{'_ntfreqs'}->{$seqname} = $freqs->{$seqname};
741 Usage : my %all_nt_freqs = $result->get_NTFreqs()
743 my %seq_nt_freqs = $result->get_NTFreqs($seqname)
744 Function: Get the NT freqs, either for every sequence or just
745 for a specific sequence
746 The average nt freqs for the entire set are also available
747 for the sequence named 'Average'
749 Args : (optional) sequence name to retrieve nt freqs for
755 my ($self,$seqname) = @_;
757 return $self->{'_ntfreqs'}->{$seqname} || {};
759 return $self->{'_ntfreqs'};
766 Usage : $result->add_stat($stat,$value);
767 Function: Add some misc stat valuess (key/value pairs)
769 Args : $stat stat name
776 my ($self,$stat,$value) = @_;
777 return if( ! defined $stat || !defined $value );
778 $self->{'_stats'}->{$stat} = $value;
785 Usage : my $value = $result->get_stat($name);
786 Function: Get the value for a stat of a given name
787 Returns : scalar value
788 Args : name of the stat
794 my ($self,$statname) = @_;
795 return $self->{'_stats'}->{$statname};
798 =head2 get_stat_names
800 Title : get_stat_names
801 Usage : my @names = $result->get_stat_names;
802 Function: Get the stat names stored for the result
803 Returns : array of names
811 return keys %{$self->{'_stats'} || {}};
814 =head2 get_AADistMatrix
816 Title : get_AADistMatrix
817 Usage : my $mat = $obj->get_AADistMatrix()
818 Function: Get AADistance Matrix
819 Returns : value of AADistMatrix (Bio::Matrix::PhylipDist)
825 sub get_AADistMatrix
{
827 return $self->{'_AADistMatix'};
830 =head2 set_AADistMatrix
832 Title : set_AADistMatrix
833 Usage : $obj->set_AADistMatrix($mat);
834 Function: Set the AADistrance Matrix (Bio::Matrix::PhylipDist)
836 Args : AADistrance Matrix (Bio::Matrix::PhylipDist)
841 sub set_AADistMatrix
{
845 ! $d->isa('Bio::Matrix::PhylipDist') ) {
846 $self->warn("Must provide a valid Bio::Matrix::MatrixI for set_AADistMatrix");
848 $self->{'_AADistMatix'} = $d;
852 =head2 get_AAMLDistMatrix
854 Title : get_AAMLDistMatrix
855 Usage : my $mat = $obj->get_AAMLDistMatrix()
856 Function: Get AAMLDistance Matrix
857 Returns : value of AAMLDistMatrix (Bio::Matrix::PhylipDist)
863 sub get_AAMLDistMatrix
{
865 return $self->{'_AAMLDistMatix'};
868 =head2 set_AAMLDistMatrix
870 Title : set_AAMLDistMatrix
871 Usage : $obj->set_AAMLDistMatrix($mat);
872 Function: Set the AA ML Distrance Matrix (Bio::Matrix::PhylipDist)
874 Args : AAMLDistrance Matrix (Bio::Matrix::PhylipDist)
879 sub set_AAMLDistMatrix
{
883 ! $d->isa('Bio::Matrix::PhylipDist') ) {
884 $self->warn("Must provide a valid Bio::Matrix::MatrixI for set_AAMLDistMatrix");
886 $self->{'_AAMLDistMatix'} = $d;
890 =head2 add_NSSite_result
892 Title : add_NSSite_result
893 Usage : $result->add_NSSite_result($model)
894 Function: Add a NSsite result (PAML::ModelResult)
896 Args : Bio::Tools::Phylo::PAML::ModelResult
901 sub add_NSSite_result
{
902 my ($self,$model) = @_;
903 if( defined $model ) {
904 push @
{$self->{'_nssiteresult'}}, $model;
906 return scalar @
{$self->{'_nssiteresult'}};
909 =head2 get_NSSite_results
911 Title : get_NSSite_results
912 Usage : my @results = @{$self->get_NSSite_results};
913 Function: Get the reference to the array of NSSite_results
914 Returns : Array of PAML::ModelResult results
920 sub get_NSSite_results
{
922 return @
{$self->{'_nssiteresult'} || []};
925 =head2 set_CodonFreqs
927 Title : set_CodonFreqs
928 Usage : $obj->set_CodonFreqs($newval)
929 Function: Get/Set the Codon Frequence table
930 Returns : value of set_CodonFreqs (a scalar)
931 Args : on set, new value (a scalar or undef, optional)
939 return $self->{'_codonfreqs'} = shift if @_;
940 return $self->{'_codonfreqs'};
943 =head2 get_CodonFreqs
945 Title : get_CodonFreqs
946 Usage : my @codon_freqs = $result->get_CodonFreqs()
947 Function: Get the Codon freqs
956 return @
{$self->{'_codonfreqs'} || []};
960 =head2 BASEML Relevant values
964 =head2 get_KappaMatrix
966 Title : get_KappaMatrix
967 Usage : my $mat = $obj->get_KappaMatrix()
968 Function: Get KappaDistance Matrix
969 Returns : value of KappaMatrix (Bio::Matrix::PhylipDist)
977 return $self->{'_KappaMatix'};
980 =head2 set_KappaMatrix
982 Title : set_KappaMatrix
983 Usage : $obj->set_KappaMatrix($mat);
984 Function: Set the KappaDistrance Matrix (Bio::Matrix::PhylipDist)
986 Args : KappaDistrance Matrix (Bio::Matrix::PhylipDist)
995 ! $d->isa('Bio::Matrix::PhylipDist') ) {
996 $self->warn("Must provide a valid Bio::Matrix::MatrixI for set_NTDistMatrix");
998 $self->{'_KappaMatix'} = $d;
1003 =head2 get_AlphaMatrix
1005 Title : get_AlphaMatrix
1006 Usage : my $mat = $obj->get_AlphaMatrix()
1007 Function: Get AlphaDistance Matrix
1008 Returns : value of AlphaMatrix (Bio::Matrix::PhylipDist)
1014 sub get_AlphaMatrix
{
1016 return $self->{'_AlphaMatix'};
1019 =head2 set_AlphaMatrix
1021 Title : set_AlphaMatrix
1022 Usage : $obj->set_AlphaMatrix($mat);
1023 Function: Set the AlphaDistrance Matrix (Bio::Matrix::PhylipDist)
1025 Args : AlphaDistrance Matrix (Bio::Matrix::PhylipDist)
1030 sub set_AlphaMatrix
{
1034 ! $d->isa('Bio::Matrix::PhylipDist') ) {
1035 $self->warn("Must provide a valid Bio::Matrix::MatrixI for set_NTDistMatrix");
1037 $self->{'_AlphaMatix'} = $d;
1041 =head2 set_input_parameter
1043 Title : set_input_parameter
1044 Usage : $obj->set_input_parameter($p,$vl);
1045 Function: Set an Input Parameter
1047 Args : $parameter and $value
1052 sub set_input_parameter
{
1053 my ($self,$p,$v) = @_;
1054 return unless defined $p;
1055 $self->{'_input_parameters'}->{$p} = $v;
1058 =head2 get_input_parameters
1060 Title : get_input_parameters
1061 Usage : $obj->get_input_parameters;
1062 Function: Get Input Parameters
1063 Returns : Hash of key/value pairs
1069 sub get_input_parameters
{
1071 return %{$self->{'_input_parameters'} || {}};
1074 =head2 reset_input_parameters
1076 Title : reset_input_parameters
1077 Usage : $obj->reset_input_parameters;
1078 Function: Reset the Input Parameters hash
1085 sub reset_input_parameters
{
1087 $self->{'_input_parameters'} = {};
1090 =head1 Reconstructed Ancestral State relevant options
1095 Usage : $obj->add_rst_seq($seq)
1096 Function: Add a Bio::PrimarySeq to the RST Result
1098 Args : Bio::PrimarySeqI
1099 See also : L<Bio::PrimarySeqI>
1104 my ($self,$seq) = @_;
1106 unless( $seq->isa("Bio::PrimarySeqI") ) {
1107 $self->warn("Must provide a valid Bio::PrimarySeqI to add_rst_seq");
1110 push @
{$self->{'_rstseqs'}},$seq;
1115 =head2 reset_rst_seqs
1117 Title : reset_rst_seqs
1118 Usage : $result->reset_rst_seqs
1119 Function: Reset the RST seqs stored
1128 $self->{'_rstseqs'} = [];
1133 Title : get_rst_seqs
1134 Usage : my @otus = $result->get_rst_seqs
1135 Function: Get the seqs Bio::PrimarySeq
1136 Returns : Array of Bio::PrimarySeqI objects
1138 See also : L<Bio::PrimarySeq>
1144 return @
{$self->{'_rstseqs'} || []};
1150 Title : add_rst_tree
1151 Usage : $obj->add_rst_tree($tree)
1152 Function: Add a Bio::Tree::TreeI to the RST Result
1154 Args : Bio::Tree::TreeI
1155 See also : L<Bio::Tree::TreeI>
1160 my ($self,$tree) = @_;
1162 unless( $tree->isa("Bio::Tree::TreeI") ) {
1163 $self->warn("Must provide a valid Bio::Tree::TreeI to add_rst_tree not $tree");
1166 push @
{$self->{'_rsttrees'}},$tree;
1170 =head2 reset_rst_trees
1172 Title : reset_rst_trees
1173 Usage : $result->reset_rst_trees
1174 Function: Reset the RST trees stored
1181 sub reset_rst_trees
{
1183 $self->{'_rsttrees'} = [];
1186 =head2 get_rst_trees
1188 Title : get_rst_trees
1189 Usage : my @otus = $result->get_rst_trees
1190 Function: Get the trees Bio::Tree::TreeI
1191 Returns : Array of Bio::Tree::TreeI objects
1193 See also : L<Bio::Tree::TreeI>
1199 return @
{$self->{'_rsttrees'} || []};
1202 =head2 set_rst_persite
1204 Title : set_rst_persite
1205 Usage : $obj->set_rst_persite($newval)
1206 Function: Get/Set the per-site RST values
1207 Returns : value of set_rst_persite (a scalar)
1208 Args : on set, new value (a scalar or undef, optional)
1213 sub set_rst_persite
{
1216 return $self->{'_rstpersite'} = shift if @_;
1217 return $self->{'_rstpersite'};
1220 =head2 get_rst_persite
1222 Title : get_rst_persite
1223 Usage : my @rst_persite = @{$result->get_rst_persite()}
1224 Function: Get the per-site RST values
1231 sub get_rst_persite
{
1233 return $self->{'_rstpersite'} || [];