This skill handles reading, writing, and converting multiple sequence alignment (MSA) files. It uses Biopython's AlignIO module which provides a consistent interface for many alignment formats used in phylogenetics and sequence analysis.
pip install biopython
# Optional for Pfam-scale streaming and A2M/A3M handling:
pip install pyhmmer
Tell your AI agent what you want to do: - "Read this Clustal alignment file and show me the sequences" - "Convert my PHYLIP alignment to FASTA format" - "Parse the Stockholm file and extract sequence IDs"
"Load the alignment from alignment.aln and tell me how many sequences it has"
"Parse all alignments from this Stockholm file"
"Read the PHYLIP file and show me the first 50 columns"
"Save this alignment as a FASTA file"
"Write the alignment to Nexus format for MrBayes"
"Export to PHYLIP-relaxed format to preserve long sequence names"
"Convert my Clustal alignment to PHYLIP format"
"Convert all .aln files in this directory to FASTA"
"Change the alignment from Stockholm to Nexus"
"Extract sequences 1-10 from the alignment"
"Trim the alignment to columns 50-150"
"Get all sequence IDs from the alignment"
| Downstream Tool | Format | BioPython String |
|---|---|---|
| RAxML-NG, IQ-TREE | PHYLIP relaxed | 'phylip-relaxed' |
| MrBayes | NEXUS | 'nexus' |
| HMMER, Infernal | Stockholm | 'stockholm' |
| PAML/codeml | PHYLIP sequential | 'phylip-sequential' |
| Most tools | FASTA | 'fasta' |
phylip-relaxed over phylip unless the downstream tool explicitly requires strict format. Strict PHYLIP truncates names to 10 characters, which can silently merge distinct sequences with shared prefixesphylip-sequential for PAMLparse() is more memory efficient than read()