$npx -y skills add GPTomics/bioSkills --skill multiple-alignmentPerform multiple sequence alignment using MAFFT, MUSCLE5, ClustalOmega, or T-Coffee. Guides tool and algorithm selection based on dataset size, sequence divergence, and downstream application. Use when aligning three or more homologous sequences for phylogenetics, conservation an
| 1 | ## Version Compatibility |
| 2 | |
| 3 | Reference examples tested with: MAFFT 7.520+, MUSCLE 5.1+, ClustalOmega 1.2.4+, T-Coffee 13+, PAL2NAL 14+, BioPython 1.83+ |
| 4 | |
| 5 | Before using code patterns, verify installed versions match. If versions differ: |
| 6 | - CLI: `mafft --version`, `muscle -version`, `clustalo --version` |
| 7 | - Python: `pip show biopython` then `help(module.function)` to check signatures |
| 8 | |
| 9 | If code throws errors, introspect the installed tool and adapt the example to match the actual CLI flags rather than retrying. |
| 10 | |
| 11 | # Multiple Sequence Alignment |
| 12 | |
| 13 | **"Align multiple sequences"** -> Compute an optimal alignment of three or more homologous sequences using progressive, iterative, or consistency-based methods. |
| 14 | - CLI: `mafft` (most versatile), `muscle` (highest accuracy), `clustalo` (scales well), `t_coffee` (consistency-based) |
| 15 | - Python: `subprocess.run()` wrapping CLI tools; BioPython `Bio.Align.Applications` was removed in BioPython 1.86 (verify with `pip show biopython`); use `subprocess` directly |
| 16 | |
| 17 | ## MSA Algorithm Taxonomy |
| 18 | |
| 19 | When a tool is failing on a dataset, switch to a tool from a different algorithmic family rather than tuning flags. The six families and their characteristic failure modes: |
| 20 | |
| 21 | | Family | Representative tools | Best at | Fails when | |
| 22 | |--------|---------------------|---------|-----------| |
| 23 | | Progressive | ClustalW, MAFFT FFT-NS-2 | Fast, large datasets, similar lengths | Early-stage gap errors propagate; no recovery | |
| 24 | | Iterative refinement | MAFFT L-INS-i, MUSCLE3, PRRN | Recovers from progressive errors at <2000 seqs | Slow on >2000; still guide-tree dependent | |
| 25 | | Consistency-based | T-Coffee, ProbCons | Highest accuracy <100 seqs; integrates evidence | O(N^2 to N^4) scaling; heavy compute | |
| 26 | | HMM-based | HMMER hmmalign, ClustalOmega (HHalign), UPP, WITCH | Adding sequences to a curated profile; fragmentary input | Needs an existing high-quality profile or backbone | |
| 27 | | Divide-and-conquer | PASTA, MAGUS, MUSCLE5 super5 | Heterogeneous large datasets (>10k seqs) | Sub-alignment merges can introduce artefacts | |
| 28 | | Structure or pLM-informed | Foldmason, PROMALS3D, vcMSA, 3D-Coffee | Dark proteome, <15% identity, dataset has structures | Requires structures or a working pLM | |
| 29 | |
| 30 | ## Tool Selection |
| 31 | |
| 32 | Pick by dataset size and divergence; the default recommendations follow the table. |
| 33 | |
| 34 | | Tool | Best For | Max Sequences | Accuracy | Speed | |
| 35 | |------|----------|---------------|----------|-------| |
| 36 | | MAFFT L-INS-i | Highest accuracy, <200 seqs | ~200 | Highest | Slow | |
| 37 | | MAFFT FFT-NS-2 | Large datasets, good balance | ~50,000 | Good | Fast | |
| 38 | | MAFFT E-INS-i | Sequences with long unalignable internal regions | ~200 | High | Slow | |
| 39 | | MUSCLE5 (PPP `-align`) | Benchmarked highest accuracy on Balifam-10000 | ~1000 | Highest | Medium | |
| 40 | | MUSCLE5 (`-super5`) | Large datasets via mBed clustering | ~100,000+ | Good | Medium | |
| 41 | | ClustalOmega | Very large datasets, HMM-based profiles | ~190,000 in published benchmark (Sievers et al 2011 Mol Syst Biol) | Good | Fast | |
| 42 | | T-Coffee (default) | Small datasets needing maximum accuracy | ~200 | Highest | Slowest | |
| 43 | |
| 44 | **Default recommendation**: MAFFT L-INS-i for <200 sequences; MAFFT FFT-NS-2 or MUSCLE5 super5 for thousands; MUSCLE5 ensemble (`-stratified`) when alignment confidence estimates are needed. |
| 45 | |
| 46 | ### Cross-Aligner Sensitivity Check |
| 47 | |
| 48 | When downstream analysis depends on a specific column (a candidate selection site, a contact-prediction position), run BOTH MAFFT L-INS-i and MUSCLE5 `-align` and verify that column is stable across the two outputs. If unstable, flag as low-confidence regardless of GUIDANCE2/TCS scores. The MUSCLE5 ensemble (`-stratified`/`-diversified`) accomplishes the same check directly within one tool and is preferred when ensemble output is acceptable downstream. |
| 49 | |
| 50 | ### Beyond MAFFT and MUSCLE: Scale and Domain |
| 51 | |
| 52 | Some workloads exceed what the four main tools handle gracefully. Use the scale-and-domain table below to escape default-tool blind spots. |
| 53 | |
| 54 | | Scenario | Recommended tool | Why | |
| 55 | |----------|------------------|-----| |
| 56 | | 100k - millions of sequences (UniRef cluster reps) | FAMSA v2 (Deorowicz et al 2016 SREP, v2 2024) | Million-scale MSA in hours with Pareto-optimal accuracy | |
| 57 | | Heterogeneous large dataset (variable length, divergence) | PASTA (Mirarab et al 2015 J Comp Biol) or MAGUS (Smirnov & Warnow 2021 Bioinf) | Divide-and-conquer plus iterative re-alignment | |
| 58 | | Fragmentary input (metagenomics, eDNA, ancient DNA) | UPP (Nguyen et al 2015 Genome Biol) or WITCH (Shen et al 2022 J Comp Biol) | HMM backbone tolerates partial sequences | |
| 59 | | Dark proteome / <15% identity | vcM |