hmmalign
Quick Start
- Command:
hmmalign [options] <hmmfile> <seqfile> - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/hmmalign - Version: HMMER 3.4
- Full reference: See
references/help.md
When To Use This Tool
- Add sequences to an existing HMM-guided alignment.
- Produce a multiple sequence alignment constrained by match states in a profile HMM.
- Recreate an alignment in Stockholm, Pfam, A2M, or PSIBLAST-compatible formats.
- Prefer
hmmbuildwhen creating a model from an alignment instead of aligning new sequences to an existing one.
Common Patterns
# 1) Align sequences to a profile HMM and write Stockholm output
hmmalign \
-o aligned.sto \
profile.hmm \
sequences.fa
# 2) Preserve the original seed alignment columns when mapping new sequences
hmmalign \
--mapali seed_alignment.sto \
-o mapped.sto \
profile.hmm \
new_sequences.fa
# 3) Trim terminal unaligned tails and emit A2M output
hmmalign \
--trim \
--outformat A2M \
-o aligned.a2m \
profile.hmm \
sequences.fa
Recommended Workflow
- Start from a trusted HMM built from a compatible alphabet and a sequence file in FASTA or another supported format.
- Decide whether you need raw alignment output, mapped seed columns via
--mapali, or trimmed termini via--trim. - Write the alignment explicitly with
-oand set--outformatwhen downstream tools do not want Stockholm. - Review the aligned output before feeding it into phylogeny, consensus calling, or model rebuilding.
Guardrails
- Positional argument order matters: HMM first, sequence file second.
- The default output format is Stockholm written to stdout unless
-ois used. - Use
-hfor help;--helpand--versionare not accepted here. - If alphabet autodetection is ambiguous, force it with
--amino,--dna, or--rna, and use--informatwhen sequence parsing is the problem.