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 (
stroros.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 aDigitalSequenceBlockdirectly.
- Keyword Arguments:
cpus (
int) – The number of threads to run in parallel. Pass1to run everything in the main thread,0to automatically select a suitable number (usingpsutil.cpu_count), or any positive number otherwise.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 toTrue, returns aDigitalMSAinstead of aTextMSA.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 aTextMSAor aDigitalMSAdepending on the value of thedigitizeargument.
See also
The
TraceAlignerclass, which lets you inspect the intermediate tracebacks obtained for each alignment before building a MSA.Added in version 0.4.7.
Added in version 0.11.4: The
cpusargument for parallel processing with multithreading.