Bio-Tools-Phylo-PAML

 view release on metacpan or  search on metacpan

lib/Bio/Tools/Phylo/PAML/Result.pm  view on Meta::CPAN

      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 ) {

lib/Bio/Tools/Phylo/PAML/Result.pm  view on Meta::CPAN

=head2 patterns

 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
         : }

=head2 set_AAFreqs

 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

=head2 get_AAFreqs

 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

=head2 set_NTFreqs

 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

=head2 get_NTFreqs

 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

=head2 add_stat

 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

=head2 get_stat

 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

=head2 get_stat_names

 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

=head2 get_AADistMatrix

 Title   : get_AADistMatrix
 Usage   : my $mat = $obj->get_AADistMatrix()
 Function: Get AADistance Matrix
 Returns : value of AADistMatrix (Bio::Matrix::PhylipDist)
 Args    : none

=head2 set_AADistMatrix

 Title   : set_AADistMatrix
 Usage   : $obj->set_AADistMatrix($mat);
 Function: Set the AADistrance Matrix (Bio::Matrix::PhylipDist)
 Returns : none
 Args    : AADistrance Matrix (Bio::Matrix::PhylipDist)

=head2 get_AAMLDistMatrix

 Title   : get_AAMLDistMatrix
 Usage   : my $mat = $obj->get_AAMLDistMatrix()
 Function: Get AAMLDistance Matrix
 Returns : value of AAMLDistMatrix (Bio::Matrix::PhylipDist)
 Args    : none

=head2 set_AAMLDistMatrix

 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)

=head2 add_NSSite_result

 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

=head2 get_NSSite_results

 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



( run in 1.337 second using v1.01-cache-2.11-cpan-84de2e75c66 )