Bio-Tools-Phylo-PAML

 view release on metacpan or  search on metacpan

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

  my $MLmatrix = $result->get_MLmatrix();

  # These matrices are length(@otu) x length(@otu) "strict lower
  # triangle" 2D-matrices, which means that the diagonal and
  # everything above it is undefined.  Each of the defined cells is a
  # hashref of estimates for "dN", "dS", "omega" (dN/dS ratio), "t",
  # "S" and "N".  If a ML matrix, "lnL" will also be defined.  Any
  # additional ML parameters estimated by the model will be in an
  # array ref under "params"; it's up to the user to know which
  # position corresponds to which parameter (since PAML doesn't label
  # them, and we can't guess very well yet (a TODO I guess).

  printf "The omega ratio for sequences %s vs %s was: %g\n",
    $otus[0]->id, $otus[1]->id, $MLmatrix->[0]->[1]->{omega};

  # with a little work, these matrices could also be passed to
  # Bio::Tools::Run::Phylip::Neighbor, or other similar tree-building
  # method that accepts a matrix of "distances" (using the LOWTRI
  # option):
  my $distmat = [ map { [ map { $$_{omega} } @$_ ] } @$MLmatrix ];



( run in 1.172 second using v1.01-cache-2.11-cpan-748bfb374f4 )