Utilities#

pyhmmer.hmmer.hmmpress(hmms, output)#

Press several HMMs into a database.

Calling this function will create 4 files at the given location: {output}.h3p (containing the optimized profiles), {output}.h3m (containing the binary HMMs), {output}.h3f (containing the MSV parameters), and {output}.h3i (the SSI index mapping the previous files).

Parameters:
  • hmms (iterable of HMM) – The HMMs to be pressed together in the file.

  • output (str or os.PathLike) – The path to an output location where to write the different files.

pyhmmer.hmmer.hmmalign(hmm, sequences, trim=False, digitize=False, all_consensus_cols=True)#

Align several sequences to a reference HMM, and return the MSA.

Parameters:
  • hmm (HMM) – The reference HMM to use for the alignment.

  • sequences (iterable of DigitalSequence) – The sequences to align to the HMM. If you plan on using the same sequences several times, consider storing them into a DigitalSequenceBlock directly.

  • trim (bool) – Trim off any residues that get assigned to flanking \(N\) and \(C\) states (in profile traces) or \(I_0\) and \(I_m\) (in core traces).

  • digitize (bool) – If set to True, returns a DigitalMSA instead of a TextMSA.

  • all_consensus_cols (bool) – Force a column to be created for every consensus column in the model, even if it means having all gap character in a column.

Returns:

MSA – A multiple sequence alignment containing the aligned sequences, either a TextMSA or a DigitalMSA depending on the value of the digitize argument.

See also

The TraceAligner class, which lets you inspect the intermediate tracebacks obtained for each alignment before building a MSA.

Added in version 0.4.7.