Bio Alignment Io
Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO.
Install
npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-alignment-io -g -a claude-code -y- Repository
- FreedomIntelligence/OpenClaw-Medical-Skills3.1k
- Category
- Writing
- Updated
- 4mo ago
- License
- See repository
- Context cost
- Mediumabout 2,329 tokens
- Runs scripts
- Yes, review before use
What it does
Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO. Supports Clustal, PHYLIP, Stockholm, FASTA, Nexus, and other alignment formats for phylogenetics and conservation analysis. Use when reading, writing, or converting alignment file formats.
Version Compatibility
Reference examples tested with: BioPython 1.83+
Before using code patterns, verify installed versions match. If versions differ:
- Python:
pip show <package>thenhelp(module.function)to check signatures
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Alignment File I/O
Read, write, and convert multiple sequence alignment files in various formats.
Required Import
Goal: Load modules for reading, writing, and manipulating multiple sequence alignments.
Approach: Import AlignIO for file I/O and supporting classes for programmatic alignment construction.
from Bio import AlignIO
from Bio.Align import MultipleSeqAlignment
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
Supported Formats
| Format | Extension | Read | Write | Description |
|---|---|---|---|---|
clustal | .aln | Yes | Yes | Clustal W/X output |
fasta | .fasta, .fa | Yes | Yes | Aligned FASTA |
phylip | .phy | Yes | Yes | Interleaved PHYLIP |
phylip-sequential | .phy | Yes | Yes | Sequential PHYLIP |
phylip-relaxed | .phy | Yes | Yes | PHYLIP with long names |
stockholm | .sto, .stk | Yes | Yes | Pfam/Rfam annotated |
nexus | .nex | Yes | Yes | NEXUS format |
emboss | .txt | Yes | No | EMBOSS tools output |
fasta-m10 | .txt | Yes | No | FASTA -m 10 output |
maf | .maf | Yes | Yes | Multiple Alignment Format |
mauve | .xmfa | Yes | No | progressiveMauve output |
msf | .msf | Yes | No | GCG MSF format |
Reading Alignments
"Read an alignment file" → Parse an alignment file into an alignment object with sequences and metadata accessible.
Goal: Load alignment data from files in various formats (Clustal, PHYLIP, Stockholm, FASTA).
