Overview
HHalign takes two inputs (query and template) and produces a high-quality pairwise alignment using the HMM-HMM alignment algorithm with Maximum Accuracy (MAC) alignment.Key Features
- Pairwise HMM-HMM alignment: Align two profiles with maximum sensitivity
- Self-comparison: Find internal repeats by comparing a sequence to itself
- Flexible input: Accepts sequences, MSAs, or pre-built HMMs
- MAC algorithm: Maximum Accuracy alignment for optimal results
When to Use HHalign
Use HHalign when you need to:- Compare two specific proteins: Align two sequences or profiles precisely
- Find internal repeats: Compare a protein to itself to detect repeats
- Align protein domains: Create detailed alignments between protein domains
- Merge two MSAs: Combine two multiple sequence alignments
- Validate remote homology: Generate detailed alignment for suspicious hits
Basic Usage
Self-comparison for repeats
Omit the template to find internal repeats:This finds the best off-diagonal alignments.
Common Use Cases
Pairwise Protein Alignment
Align two proteins with their MSAs for maximum accuracy:Finding Internal Repeats
Detect repeating domains within a single protein:Domain Alignment with Position Exclusion
Align specific regions while excluding others:Generate Multiple Output Formats
Create alignment in multiple formats simultaneously:Key Parameters
Input/Output Options
Input/Output Options
-i <file>- Query alignment (A2M, A3M, FASTA) or HMM-t <file>- Template alignment or HMM (omit for self-comparison)-o <file>- Output file in HHR format (default:<infile>.hhr)-oa3m <file>- Write alignment in A3M format-aa3m <file>- Append alignment to existing A3M file-Ofas/-Oa2m/-Oa3m <file>- Pairwise alignment in FASTA/A2M/A3M
Alignment Mode
Alignment Mode
-glob- Use global alignment (align full sequences)-loc- Use local alignment (default, best local match)-mact [0,1]- MAC realignment threshold (default: 0.35)-norealign- Disable MAC realignment
Alternative Alignments
Alternative Alignments
-alt <int>- Number of alternative alignments to show (default: 1)-smin <float>- Minimum raw score for alternative alignments
Position Exclusion
Position Exclusion
-excl <range>- Exclude query positions (e.g., ‘1-33,97-168’)-template_excl <range>- Exclude template positions
Filtering Options
Filtering Options
-id [0,100]- Maximum pairwise sequence identity % (default: 90)-cov [0,100]- Minimum coverage with master sequence % (default: 0)-qid [0,100]- Minimum sequence identity with query % (default: 0)-diff [0,inf]- Filter for diversity (default: depends on mode)
Output Format
Tips and Best Practices
Advanced Options
Fine-tune Alignment Quality
Control the alignment algorithm parameters:Secondary Structure Scoring
Include secondary structure in alignment:Custom Gap Penalties
Adjust gap opening and extension penalties:Multiple Alternative Alignments
Find several alternative alignments:Self-Comparison Mode
When only-i is provided (no -t), HHalign compares the query to itself:
- Finds the best off-diagonal alignment (skips the trivial diagonal)
- Reports all non-overlapping alignments above the significance threshold
- Useful for detecting tandem repeats, domain duplications, or internal symmetry
Comparison with Other Tools
| Feature | HHalign | HHsearch | HHblits |
|---|---|---|---|
| Input | 1-2 sequences/MSAs | 1 query + database | 1 query + database |
| Output | Single alignment | Ranked list | Ranked list + MSA |
| Iteration | No | No | Yes |
| Best for | Pairwise comparison | Structure search | Deep MSA building |
| Self-comparison | Yes | No | No |
Related Tools
- hhblits - Iterative database searching
- hhsearch - Database searching without iteration
- hhmake - Convert alignments to HMM format
- hhfilter - Filter alignments