DOKK / manpages / debian 11 / psortb / Algorithm::HMM.3pm.en
Algorithm::HMM(3pm) User Contributed Perl Documentation Algorithm::HMM(3pm)

Algorithm::HMM - Perl bindings for a Hidden Markov Model library.

  use Algorithm::HMM;
  # Load a Hidden Markov Model.
  my $hmm = new Algorithm::HMM(Model => 'sample.hmm');
  # Run a sequence through the loaded model.
  my $rep = $hmm->search("AAIELKBPOWELKQJPASDLKJIGE");
  # Get all the global hits from the search.
  my @ghits = $rep->global_hits();
  # Get all the domain hits from the search.
  my @dhits = $rep->domain_hits();
  # Display information about the domain hits.
  for (@dhits) {
    print("pvalue = " . $_->pvalue . "\n");
    print("evalue = " . $_->evalue . "\n");
    print("score  = " . $_->score  . "\n");
  }
  # Save the model to a different file.
  $hmm->save("sample.hmm.0");
  # Load the saved model again.
  $hmm->load("sample.hmm.1")
2020-11-08 perl v5.32.0