Biopython Bioinformatics
aiming-lab/AutoResearchClaw
Quick reference for Biopython work: sequence operations, SeqIO file parsing, BLAST searches, Entrez queries, phylogenetic trees and PDB structure analysis.
Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO.
$ npx skills add GPTomics/bioSkills --skill bio-alignment-io -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install GPTomics/bioSkills bio-alignment-io --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/alignment/alignment-io .claude/skills/bio-alignment-io && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "bio-alignment-io" agent skill from https://github.com/GPTomics/bioSkills/tree/main/alignment/alignment-io into .claude/skills/bio-alignment-io/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bio-alignment-io", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/GPTomics/bioSkills/tree/main/alignment/alignment-ioType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add GPTomics/bioSkills --skill bio-alignment-io -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install GPTomics/bioSkills bio-alignment-io --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/alignment/alignment-io .agents/skills/bio-alignment-io && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "bio-alignment-io" agent skill from https://github.com/GPTomics/bioSkills/tree/main/alignment/alignment-io into .agents/skills/bio-alignment-io/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bio-alignment-io", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add GPTomics/bioSkills --skill bio-alignment-io -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install GPTomics/bioSkills bio-alignment-io --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/alignment/alignment-io .cursor/skills/bio-alignment-io && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "bio-alignment-io" agent skill from https://github.com/GPTomics/bioSkills/tree/main/alignment/alignment-io into .cursor/skills/bio-alignment-io/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bio-alignment-io", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/GPTomics/bioSkills.git --path alignment/alignment-io--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add GPTomics/bioSkills --skill bio-alignment-io -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install GPTomics/bioSkills bio-alignment-io --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/alignment/alignment-io .gemini/skills/bio-alignment-io && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "bio-alignment-io" agent skill from https://github.com/GPTomics/bioSkills/tree/main/alignment/alignment-io into .gemini/skills/bio-alignment-io/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bio-alignment-io", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install GPTomics/bioSkills bio-alignment-ioInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add GPTomics/bioSkills --skill bio-alignment-io -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .github/skills && cp -r skills-src/alignment/alignment-io .github/skills/bio-alignment-io && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "bio-alignment-io" agent skill from https://github.com/GPTomics/bioSkills/tree/main/alignment/alignment-io into .github/skills/bio-alignment-io/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bio-alignment-io", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add GPTomics/bioSkills --skill bio-alignment-io -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install GPTomics/bioSkills bio-alignment-io --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/alignment/alignment-io .opencode/skills/bio-alignment-io && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "bio-alignment-io" agent skill from https://github.com/GPTomics/bioSkills/tree/main/alignment/alignment-io into .opencode/skills/bio-alignment-io/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bio-alignment-io", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
bio-alignment-ioRead, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO.
Bio Alignment Io is an agent skill from GPTomics/bioSkills. 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.
Its SKILL.md is about 4.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files (for example `examples/batch_convert.py`, `examples/convert_formats.py` and `examples/read_alignment.py`).
It sits in Research & Science, covering Bioinformatics. It works with Biopython. The repository describes itself as: a set of SKILLS.md for doing bioinformatics with agents like claude code. The licence is MIT.
Read from SKILL.md and the folder at commit d91ed3d. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships script files (Python), which the agent can run.
Shell commands in SKILL.md call:
pipFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Bio Alignment Io loads about 4.9k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 1,700 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from GPTomics/bioSkills at commit d91ed3d, republished under its MIT licence (© GPTomics). 1,700 words, ~4,938 tokens.
.claude/skills/bio-alignment-io/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.Reference examples tested with: BioPython 1.83+
Before using code patterns, verify installed versions match. If versions differ:
pip show <package> then help(module.function) to check signaturesIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Read, write, and convert multiple sequence alignment files in various formats.
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 SeqThree Python libraries cover the alignment-format space, with overlapping but non-identical support. Pick by what is actually required.
| Format | Bio.AlignIO | Bio.Align (modern) | pyhmmer.easel | Notes |
|---|---|---|---|---|
| Aligned FASTA | R/W | R/W | R/W | Most portable; loses annotations |
| Clustal | R/W | R/W | R | Clustal conservation marks NOT round-tripped |
| PHYLIP (interleaved/sequential/relaxed) | R/W | R/W | R | Strict 10-char names is silent footgun |
| Stockholm | R/W | R/W | R/W | Only format preserving GS/GR/GC/GF annotations |
| NEXUS | R/W | R/W | -- | MrBayes / PAUP* input |
| MAF (Multiple Alignment Format) | R/W | R/W | -- | UCSC whole-genome alignments |
| A2M / A3M | -- (use 'fasta' parser then post-process) | -- | R/W | HMMER (a2m), HHsuite/ColabFold (a3m) |
| MSF (GCG) | R | -- | -- | GCG legacy |
| EMBOSS / Mauve XMFA / FASTA-m10 | R | partial | -- | One-way: read-only |
Formats NOT in BioPython (use dedicated tools):
| Format | Tool | Why |
|---|---|---|
| HAL | progressiveCactus, halTools | HDF5-backed multi-genome alignments at TB scale |
| chain / net | UCSC Kent tools (liftOver, chainNet) | Pairwise genome alignment |
| AXT | BLASTZ / lastz native | Pairwise alignment blocks |
| PSL | UCSC Kent tools (pslPretty, blat) | BLAT alignment summary |
| GFA / rGFA | vg, odgi, pggb, gfatools | Pangenome graph |
| GAF | vg surject, vg call | Graph alignment format (read-to-graph) |
Recommend Bio.Align (modern API) over Bio.AlignIO (legacy) for new code; it returns Alignment objects with built-in .counts() and .substitutions properties. For multi-gigabyte Stockholm databases such as Pfam-A.full, pyhmmer.easel.MSAFile streams record-by-record where Bio.AlignIO.parse works but at higher per-record cost.
"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).
Approach: Use AlignIO.read() for single-alignment files or AlignIO.parse() for files containing multiple alignments.
from Bio import AlignIO
alignment = AlignIO.read('alignment.aln', 'clustal')
print(f'Alignment length: {alignment.get_alignment_length()}')
print(f'Number of sequences: {len(alignment)}')for alignment in AlignIO.parse('multi_alignment.sto', 'stockholm'):
print(f'Alignment with {len(alignment)} sequences, length {alignment.get_alignment_length()}')alignments = list(AlignIO.parse('alignments.phy', 'phylip'))
print(f'Read {len(alignments)} alignments')Goal: Save alignment data to files in standard formats for downstream tools or archival.
Approach: Use AlignIO.write() with the target format specifier, supporting single or multiple alignments and file handles.
AlignIO.write(alignment, 'output.fasta', 'fasta')alignments = [alignment1, alignment2, alignment3]
count = AlignIO.write(alignments, 'output.sto', 'stockholm')
print(f'Wrote {count} alignments')with open('output.aln', 'w') as handle:
AlignIO.write(alignment, handle, 'clustal')"Convert alignment format" -> Transform an alignment file from one format to another (e.g., Clustal to PHYLIP).
Goal: Convert alignment files between formats for compatibility with different analysis tools.
Approach: Use AlignIO.convert() for direct one-step conversion, or read-modify-write for cases requiring intermediate manipulation.
AlignIO.convert('input.aln', 'clustal', 'output.phy', 'phylip')AlignIO.convert('input.sto', 'stockholm', 'output.nex', 'nexus', molecule_type='DNA')alignment = AlignIO.read('input.aln', 'clustal')
# ... modify alignment ...
AlignIO.write(alignment, 'output.fasta', 'fasta')Goal: Navigate and extract data from alignment objects including sequences, columns, and slices.
Approach: Use iteration, indexing, and column slicing on the alignment object.
alignment = AlignIO.read('alignment.aln', 'clustal')
# Iterate over sequences
for record in alignment:
print(f'{record.id}: {record.seq}')
# Access by index
first_seq = alignment[0]
last_seq = alignment[-1]
# Slice columns
column_slice = alignment[:, 10:20] # Columns 10-19
# Get specific column
column = alignment[:, 5] # Column 5 as stringalignment = AlignIO.read('alignment.aln', 'clustal')
length = alignment.get_alignment_length()
num_seqs = len(alignment)
seq_ids = [record.id for record in alignment]# Get subset of sequences
subset = alignment[0:5] # First 5 sequences
# Get subset of columns
trimmed = alignment[:, 50:150] # Columns 50-149
# Combine slicing
region = alignment[0:5, 50:150] # 5 sequences, columns 50-149Goal: Build an alignment object from sequences defined in code rather than read from a file.
Approach: Construct SeqRecord objects with gap characters and wrap them in a MultipleSeqAlignment.
from Bio.Align import MultipleSeqAlignment
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
records = [
SeqRecord(Seq('ACTGACTGACTG'), id='seq1'),
SeqRecord(Seq('ACTGACT-ACTG'), id='seq2'),
SeqRecord(Seq('ACTG-CTGACTG'), id='seq3'),
]
alignment = MultipleSeqAlignment(records)
AlignIO.write(alignment, 'new_alignment.fasta', 'fasta')Choosing the output format depends on which downstream tool consumes the alignment:
| Downstream Tool | Required Format | BioPython Format String |
|---|---|---|
| RAxML-NG, IQ-TREE | PHYLIP (relaxed) | 'phylip-relaxed' |
| MrBayes | NEXUS | 'nexus' |
| PAUP* | NEXUS or PHYLIP | 'nexus' or 'phylip' |
| HMMER, Infernal | Stockholm | 'stockholm' |
| Pfam/Rfam databases | Stockholm | 'stockholm' |
| PAML/codeml | PHYLIP (sequential) | 'phylip-sequential' |
| Most tools | FASTA | 'fasta' |
Not all formats support annotations. Converting between formats can silently discard metadata:
| Format | Sequence Annotations | Column Annotations | Secondary Structure |
|---|---|---|---|
| Stockholm | Yes (GS/GR lines) | Yes (GC lines) | Yes (SS_cons) |
| NEXUS | Partial (SETS block) | Via CHARSET | No |
| Clustal | No (conservation marks not parsed) | No | No |
| PHYLIP | No | No | No |
| FASTA | No | No | No |
Converting Stockholm to FASTA or PHYLIP discards all annotations, secondary structure markup, and per-residue quality scores. If annotations matter, keep a Stockholm master copy.
PHYLIP has two incompatible variants (interleaved vs sequential) and two name-length modes (strict vs relaxed). Confusing these causes silent data corruption.
Strict PHYLIP truncates sequence names to exactly 10 characters. This can silently merge distinct sequences whose names share a 10-character prefix (e.g., Homo_sapiens_chr1 and Homo_sapiens_chr2 both become Homo_sapie).
# Strict PHYLIP (10-char names, interleaved) -- only for tools requiring it
alignment = AlignIO.read('file.phy', 'phylip')
# Sequential PHYLIP (10-char names, one sequence at a time) -- PAML/codeml
alignment = AlignIO.read('file.phy', 'phylip-sequential')
# Relaxed PHYLIP (no name limit) -- RAxML-NG, IQ-TREE (recommended default)
alignment = AlignIO.read('file.phy', 'phylip-relaxed')
# Always prefer phylip-relaxed for writing unless the downstream tool
# specifically requires strict format
AlignIO.write(alignment, 'output.phy', 'phylip-relaxed')Biopython's 'phylip-relaxed' writes a single space between name and sequence. RAxML-NG and IQ-TREE accept this; PhyML rejects sequence names containing colons or parentheses; PAML's codeml expects sequential format with name-truncation behaviour distinct from interleaved. Common silent failures:
| Symptom | Cause | Fix |
|---|---|---|
RAxML-NG: terminating with uncaught exception ... bad alphabet | Stop codons (*) in protein alignment | Replace * with X before writing |
IQ-TREE: not a valid PHYLIP file | Sequence name contains : (NEXUS-tree-style refs) | Sanitize names: re.sub(r'[():,]', '_', record.id) |
| PhyML: silently truncated names | Names >100 chars | PhyML truncates without warning at 100 chars in current build |
codeml: cannot read sequences | Used phylip-relaxed instead of phylip-sequential | codeml requires strict sequential |
Always verify by running the downstream tool's "validate input only" mode (e.g. iqtree2 -s file.phy --check) before committing to a long compute.
UCSC MAF (read via AlignIO.parse(file, 'maf')) returns blocks with per-row annotations:
start (0-based; converts directly to BED but is off-by-one vs GFF)size (length on src strand)strand (+ or -)srcSize (length of source chromosome)For minus-strand rows, start is measured from the END of the source contig: the corresponding plus-strand start is srcSize - start - size. Without this conversion, lifting MAF to genome coordinates places minus-strand blocks at the wrong locus. Reference: UCSC MAF spec at genome.ucsc.edu/FAQ/FAQformat.html#format5.
def maf_to_plus_strand_coords(row_anno):
if row_anno['strand'] == '-':
return row_anno['srcSize'] - row_anno['start'] - row_anno['size']
return row_anno['start']Stockholm format (used by Pfam, Rfam, HMMER) supports four annotation line types:
| Line Prefix | Scope | Description | Example |
|---|---|---|---|
#=GF | File | Alignment-level metadata (ID, accession, description) | #=GF AC PF00001 |
#=GC | Column | Per-column annotation (1 char per alignment column) | #=GC SS_cons ..(((...))).. |
#=GS | Sequence | Per-sequence free text (organism, description) | #=GS seq1 OS Homo sapiens |
#=GR | Residue | Per-residue annotation (1 char per residue) | #=GR seq1 SS ..HHH..EEE.. |
Common GC annotations: SS_cons (consensus secondary structure), RF (reference coordinates), seq_cons (consensus sequence).
WUSS notation in RNA #=GC SS_cons lines uses nested bracket pairs (<>, (), [], {}) for paired bases and characters like _, -, ,, :, ., ~ for unpaired regions; pseudoknots use upper/lower-case letter pairs (Aa, Bb). Consult the Infernal user guide for the full character table before writing or parsing custom SS_cons strings.
alignment = AlignIO.read('pfam.sto', 'stockholm')
for record in alignment:
print(record.id, record.annotations)
if 'secondary_structure' in record.letter_annotations:
print(f' SS: {record.letter_annotations["secondary_structure"]}')
ss_cons = alignment.column_annotations.get('secondary_structure')Round-trip caveat: AlignIO.write(alignment, 'out.fasta', 'fasta') discards every Stockholm annotation silently. Re-reading and re-writing as Stockholm preserves GC/GR but dropped/added sequences invalidate the per-residue annotations -- regenerate annotations after edits.
Pfam-style name/start-end identifier convention: Pfam, Rfam, and Dfam Stockholm IDs (e.g. Q9Y6Y0/45-198) encode a 1-based inclusive region. Biopython does not split this; before passing to RAxML or IQ-TREE, parse the suffix into record.annotations['start'] / ['end'] and strip from record.id, then restore it after.
A2M (HMMER) and A3M (HHsuite, ColabFold) encode match vs insert columns by case (uppercase / - = match column, lowercase / . = insert column). A2M pads inserts across rows so it loads as a rectangular MSA; A3M does not, so convert with HHsuite reformat.pl a3m a2m in.a3m out.a2m (or pyhmmer.easel.MSAFile(..., format='a2m')) before parsing as a normal alignment.
reformat.pl pitfall: HHsuite's reformat.pl a3m a2m uses the FIRST sequence in the A3M as the match-state reference. ColabFold MSAs typically place the query first, which is the desired reference; merged or sorted A3Ms can have a non-query first sequence, producing match-state assignments that mis-align the query. Either (a) verify the first sequence is the query before reformatting, or (b) renormalise with hhfilter -i in.a3m -o out.a3m -id 100 -qid 0 -cov 0 before running reformat.pl. A3M files emitted by hhblits always have the query first; A3M files concatenated from MSA databases do not.
alignment = AlignIO.read('hhsearch.a2m', 'fasta')
match_only_seqs = [
''.join(c for c in str(r.seq) if c.isupper() or c == '-')
for r in alignment
]Bio.AlignIO.read() is in-memory; for Pfam-A.full (multi-gigabyte; ~22,000 family alignments in Pfam 37) or BFD (>2 TB), use pyhmmer.easel.MSAFile for streaming Stockholm or A3M.
import pyhmmer
with pyhmmer.easel.MSAFile('Pfam-A.full', digital=True) as msa_file:
for msa in msa_file:
if msa.nseq < 50:
continue
weights = msa.compute_weights(method='pb')
print(msa.name.decode(), msa.nseq, msa.alen, f'sum_w={sum(weights):.1f}')msa.compute_weights(method='pb') computes Henikoff PB weights via the same Easel routine HMMER uses; the weights sum to the number of sequences (not Neff). For an Henikoff-style Neff estimate, see msa-parsing/examples/neff.py.
# Clustal preserves conservation symbols in file but not when parsed
alignment = AlignIO.read('clustal.aln', 'clustal')Goal: Convert a directory of alignment files from one format to another in bulk.
Approach: Glob for input files and iterate, reading each alignment and writing to the target format.
from pathlib import Path
input_dir = Path('alignments/')
output_dir = Path('converted/')
for input_file in input_dir.glob('*.aln'):
alignment = AlignIO.read(input_file, 'clustal')
output_file = output_dir / f'{input_file.stem}.fasta'
AlignIO.write(alignment, output_file, 'fasta')Goal: Use the modern Bio.Align module for alignment I/O with access to newer features like counts and substitutions.
Approach: Use Align.read(), Align.parse(), and Align.write() which return Alignment objects instead of MultipleSeqAlignment.
The newer Bio.Align module provides its own I/O functions that return Alignment objects (instead of MultipleSeqAlignment). These support additional formats and provide access to modern alignment features.
from Bio import Align
# Read single alignment (returns Alignment object)
alignment = Align.read('alignment.aln', 'clustal')
# Parse multiple alignments
for alignment in Align.parse('multi.sto', 'stockholm'):
print(f'Alignment with {len(alignment)} sequences')
# Write alignment
Align.write(alignment, 'output.fasta', 'fasta')| Use Case | Module |
|---|---|
| Legacy code, MultipleSeqAlignment needed | Bio.AlignIO |
| Modern features (counts, substitutions) | Bio.Align |
| Format conversion | Either works |
| Working with pairwise alignments | Bio.Align |
| Task | Code |
|---|---|
| Read single alignment | AlignIO.read(file, format) |
| Read multiple alignments | AlignIO.parse(file, format) |
| Write alignment(s) | AlignIO.write(align, file, format) |
| Convert format | AlignIO.convert(in_file, in_fmt, out_file, out_fmt) |
| Get length | alignment.get_alignment_length() |
| Get sequence count | len(alignment) |
| Slice columns | alignment[:, start:end] |
| Error | Cause | Solution |
|---|---|---|
ValueError: No records | Empty file | Check file path and format |
ValueError: More than one record | Multiple alignments with read() | Use parse() instead |
ValueError: Sequences different lengths | Invalid alignment | Ensure all sequences same length |
ValueError: unknown format | Unsupported format string | Check supported formats list |
result_aa.fa / result_3di.fa MSAs (FASTA-loadable; the per-column LDDT report is HTML, not BioPython-parseable)© GPTomics, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 6 other files in alignment/alignment-io of GPTomics/bioSkills.
Open the folder on GitHubat commit d91ed3d
We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 3 other GitHub owners. This page covers the copy in GPTomics/bioSkills, which our catalogue first saw on October 7, 2026.
Bio Alignment Io next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Bio Alignment Io this skillGPTomics/bioSkills | 1.2k | 3 repos | ~4.9k | Automated safety check: Pass | MIT | |
| Biopython Bioinformaticsaiming-lab/AutoResearchClaw | 15k | — | ~810 | Automated safety check: Pass | MIT | |
| Biopythondavila7/claude-code-templates | 32k | 13 repos | ~3.4k | Automated safety check: Pass | MIT | |
| Ggetdavila7/claude-code-templates | 32k | 11 repos | ~6.3k | Automated safety check: Pass | MIT | |
| Bio Alignment Pairwisemajiayu000/claude-skill-registry | 666 | 4 repos | ~1.7k | Automated safety check: Pass | MIT | |
| GgetK-Dense-AI/scientific-agent-skills | 48k | 1 repos | ~2.8k | Automated safety check: Notes | BSD-2-Clause |
aiming-lab/AutoResearchClaw
Quick reference for Biopython work: sequence operations, SeqIO file parsing, BLAST searches, Entrez queries, phylogenetic trees and PDB structure analysis.
davila7/claude-code-templates
Primary Python toolkit for molecular biology. An agent skill from davila7/claude-code-templates.
davila7/claude-code-templates
CLI/Python toolkit for rapid bioinformatics queries. An agent skill from davila7/claude-code-templates.
majiayu000/claude-skill-registry
Perform pairwise sequence alignment using Biopython Bio.Align.PairwiseAligner.
K-Dense-AI/scientific-agent-skills
Queries 20+ bioinformatics resources through CLI/Python. An agent skill from K-Dense-AI/scientific-agent-skills.
K-Dense-AI/scientific-agent-skills
Provides Biopython workflows for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez).
GPTomics/bioSkills
Installs the bioSkills collection of 425 bioinformatics skills in one step, or only chosen categories, so sequencing, RNA-seq, single-cell and variant tasks get specialized help.
GPTomics/bioSkills
Write biological sequences to files (FASTA, FASTQ, GenBank, EMBL) using Biopython Bio.SeqIO.
GPTomics/bioSkills
Soft- or hard-clips PCR primer footprints from aligned amplicon BAMs so primer bases stop masquerading as confirmed reference sequence.
GPTomics/bioSkills
Create and use BAI/CSI indices for BAM/CRAM files using samtools and pysam.
GPTomics/bioSkills
Sort alignment files by coordinate or read name using samtools and pysam.
GPTomics/bioSkills
Validate alignment quality with insert size distribution, proper pairing rates, GC bias, strand balance, and other post-alignment metrics.
Works with
Categories
Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO. Bio Alignment Io is an agent skill from GPTomics/bioSkills.AlignIO.
Bio Alignment Io fits situations like: converting alignment file formats; tasks that involve Bioinformatics.
Run `npx skills add GPTomics/bioSkills --skill bio-alignment-io -a claude-code`. Or copy the skill folder (alignment/alignment-io in GPTomics/bioSkills) into .claude/skills/bio-alignment-io in your project. Claude Code loads it when a task matches its description.
Run `npx skills add GPTomics/bioSkills --skill bio-alignment-io -a codex`. Or copy the skill folder (alignment/alignment-io in GPTomics/bioSkills) into .agents/skills/bio-alignment-io in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add GPTomics/bioSkills --skill bio-alignment-io -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bio-alignment-io, .gemini/skills/bio-alignment-io, .github/skills/bio-alignment-io and .opencode/skills/bio-alignment-io in your project.
Going by SKILL.md and its folder, Bio Alignment Io needs Python for the scripts in its folder and the command-line tools its instructions call (pip). Our summary lists: Python 3.
SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Bio Alignment Io is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.9k tokens (SKILL.md is roughly 20k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Bio Alignment Io: Biopython Bioinformatics (aiming-lab/AutoResearchClaw, 15k stars), Biopython (davila7/claude-code-templates, 32k stars), Gget (davila7/claude-code-templates, 32k stars) and Bio Alignment Pairwise (majiayu000/claude-skill-registry, 666 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
GPTomics (a GitHub organization) maintains it in GPTomics/bioSkills, which has 1,215 GitHub stars. The repository holds 552 skills in this directory. The repository was last updated on August 15, 2026.
Source: GPTomics/bioSkills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.