[Bioperl-guts-l] bioperl-live/Bio/Tools/Phylo/PAML Result.pm, 1.15, 1.16

Jason Stajich jason at pub.open-bio.org
Fri Mar 11 17:31:28 EST 2005


Update of /home/repository/bioperl/bioperl-live/Bio/Tools/Phylo/PAML
In directory pub.open-bio.org:/tmp/cvs-serv13854/PAML

Modified Files:
	Result.pm 
Log Message:
parse input params


Index: Result.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Tools/Phylo/PAML/Result.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Result.pm	8 Dec 2004 10:48:05 -0000	1.15
--- Result.pm	11 Mar 2005 22:31:26 -0000	1.16
***************
*** 26,33 ****
    my $result = $parser->next_result();
  
!   my @seqs       = $result->get_seqs;
!   my $MLmatrix   = $result->get_MLmatrix; # get MaxLikelihood Matrix
!   my $NGmatrix   = $result->get_NGmatrix; # get Nei-Gojoburi Matrix
!   my @basfreq    = $result->get_codon_pos_basefreq;
  
  
--- 26,34 ----
    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
  
  
***************
*** 112,115 ****
--- 113,117 ----
             -alpha_mat => Bio::Matrix::PhylipDist of alpha values (only for BASEML)
             -NSSitesresult => arrayref of PAML::ModelResult 
+            -input_params  => input params from .ctl file 
  
  =cut
***************
*** 125,139 ****
        $aamldistmat,
        $ntfreqs, $kappa_mat,$alpha_mat,
!       $NSSitesresults ) = $self->_rearrange([qw(TREES MLMATRIX 
! 						SEQS NGMATRIX
! 						CODONPOS CODONFREQ
! 						VERSION MODEL PATTERNS
! 						STATS AAFREQ AADISTMAT
! 						AAMLDISTMAT 
! 						NTFREQ
! 						KAPPA_DISTMAT
! 						ALPHA_DISTMAT
! 						NSSITESRESULTS)], 
! 				       @args);
    $self->reset_seqs;
    if( $trees ) {
--- 127,144 ----
        $aamldistmat,
        $ntfreqs, $kappa_mat,$alpha_mat,
!       $NSSitesresults,$input_params ) = 
! 	  $self->_rearrange([qw
! 			     (TREES MLMATRIX 
! 			      SEQS NGMATRIX
! 			      CODONPOS CODONFREQ
! 			      VERSION MODEL PATTERNS
! 			      STATS AAFREQ AADISTMAT
! 			      AAMLDISTMAT 
! 			      NTFREQ
! 			      KAPPA_DISTMAT
! 			      ALPHA_DISTMAT
! 			      NSSITESRESULTS
! 			      INPUT_PARAMS)], 
! 			    @args);
    $self->reset_seqs;
    if( $trees ) {
***************
*** 242,245 ****
--- 247,261 ----
        $self->set_AlphaMatrix($alpha_mat);
    }
+ 
+   if( $input_params ) {
+       if(  ref($input_params) !~ /HASH/i ) {
+ 	  warn("need a valid HASH object for input_params\n");
+       } else {
+ 	  while( my ($p,$v) = each %$input_params ) {
+ 	      $self->set_input_parameter($p,$v);
+ 	  }
+       }
+       
+   }
    return $self;
  }
***************
*** 916,919 ****
--- 932,985 ----
     return undef;
  }
+ 
+ =head2 set_input_parameter
+ 
+  Title   : set_input_parameter
+  Usage   : $obj->set_input_parameter($p,$vl);
+  Function: Set an Input Parameter 
+  Returns : none
+  Args    : $parameter and $value
+ 
+ 
+ =cut
+ 
+ sub set_input_parameter{
+    my ($self,$p,$v) = @_;
+    return unless defined $p;
+    $self->{'_input_parameters'}->{$p} = $v;
+ }
+ 
+ =head2 get_input_parameters
+ 
+  Title   : get_input_parameters
+  Usage   : $obj->get_input_parameters;
+  Function: Get Input Parameters 
+  Returns : Hash of key/value pairs
+  Args    : none
+ 
+ 
+ =cut
+ 
+ sub get_input_parameters{
+    my ($self) = @_;
+    return %{$self->{'_input_parameters'} || {}};
+ }
+ 
+ =head2 reset_input_parameters
+ 
+  Title   : reset_input_parameters
+  Usage   : $obj->reset_input_parameters;
+  Function: Reset the Input Parameters hash 
+  Returns : none
+  Args    : none
+ 
+ 
+ =cut
+ 
+ sub reset_input_parameters{
+    my ($self) = @_;
+    $self->{'_input_parameters'} = {};
+ }
+ 
  
  1;



More information about the Bioperl-guts-l mailing list