Agent skill

Bio Format Conversion

by GPTomics in GPTomics/bioSkills

Convert between sequence file formats (FASTA, FASTQ, GenBank, EMBL, Stockholm) and re-encode FASTQ quality offsets using Biopython Bio.SeqIO.

MITAuto-check passedResearch & Science

Install Bio Format Conversion

skills CLI
$ npx skills add GPTomics/bioSkills --skill bio-format-conversion -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install GPTomics/bioSkills bio-format-conversion --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/sequence-io/format-conversion .claude/skills/bio-format-conversion && rm -rf skills-src

Use ~/.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/

Facts

Skill name
bio-format-conversion
GitHub stars
1.2k
Used in
1 other repo
Token cost
~2.9k tokens
SKILL.md length
1,281 words
Files
3
Skills in repo
552
Repo updated
First seen
Licence
MIT

At a glance

Convert between sequence file formats (FASTA, FASTQ, GenBank, EMBL, Stockholm) and re-encode FASTQ quality offsets using Biopython Bio.SeqIO.

  • Changing a file format for a downstream tool
  • SKILL.md covers Version Compatibility, The Governing Principle, The Canonical Trap:… and Lossy Conversion Decision Table, plus 8 more sections
  • Runs Python scripts from its folder; calls pip
  • Fixing FASTQ quality encoding (Phred+33 vs Phred+64 vs Solexa)

What it does

Bio Format Conversion is an agent skill from GPTomics/bioSkills. Convert between sequence file formats (FASTA, FASTQ, GenBank, EMBL, Stockholm) and re-encode FASTQ quality offsets using Biopython Bio.SeqIO. Use when changing a file format for a downstream tool, fixing FASTQ quality encoding (Phred+33 vs Phred+64 vs Solexa), or when a conversion risks silently dropping annotations or quality scores.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `examples/convert_format.py` and `usage-guide.md`).

It sits in Research & Science, covering Bioinformatics. It works with NCBI and Biopython. The repository describes itself as: a set of SKILLS.md for doing bioinformatics with agents like claude code. The licence is MIT.

When your agent uses it

  • Changing a file format for a downstream tool
  • Fixing FASTQ quality encoding (Phred+33 vs Phred+64 vs Solexa)
  • A conversion risks silently dropping annotations

Example prompts

  • “/bio-format-conversion”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit d91ed3d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    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.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bio Format Conversion loads about 2.9k tokens when it runs. Until then it costs about 90 tokens; SKILL.md has 1,281 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~90
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from GPTomics/bioSkills at commit d91ed3d, republished under its MIT licence (© GPTomics). 1,281 words, ~2,908 tokens.

Download SKILL.mdSave it as .claude/skills/bio-format-conversion/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
bio-format-conversion
description
Convert between sequence file formats (FASTA, FASTQ, GenBank, EMBL, Stockholm) and re-encode FASTQ quality offsets using Biopython Bio.SeqIO. Use when changing a file format for a downstream tool, fixing FASTQ quality encoding (Phred+33 vs Phred+64 vs Solexa), or when a conversion risks silently dropping annotations or quality scores.
tool_type
python
primary_tool
Bio.SeqIO

Version Compatibility

Reference examples tested with: BioPython 1.83+

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show <package> then help(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.

Format Conversion

"Convert this file to a different format" -> Read records in one format, optionally add or drop annotations, and write in the target format.

  • Python: SeqIO.convert() for a streaming one-shot conversion, or SeqIO.parse() + SeqIO.write() when records need modification (BioPython)
  • CLI: seqkit seq (SeqKit) for FASTA/FASTQ; samtools view for SAM/BAM/CRAM

The Governing Principle

A conversion is lossy whenever the target format cannot represent the source's information. The conversion still succeeds with no error and no warning. FASTA stores only id + description + sequence, so it is the most lossy common target: converting GenBank, EMBL, or FASTQ to FASTA silently discards everything the richer format carried. Before converting, decide whether the destination can hold what the source contains. If it cannot, treat the conversion as a deliberate downgrade, not a neutral reformat.

The Canonical Trap: GenBank/EMBL -> FASTA Silently Drops Everything

SeqIO.convert('in.gb', 'genbank', 'out.fasta', 'fasta') discards all features, annotations, qualifiers, and dbxrefs. The genes, CDS coordinates, /product and /gene qualifiers, organism, taxonomy, references, and molecule_type are all gone. There is no error, no warning, and the record count is unchanged, so the loss is invisible unless the output is inspected. FASTA encodes only record.id, record.description, and record.seq; everything in record.features, record.annotations, and record.dbxrefs has nowhere to go.

If the features matter, do not convert to FASTA. Extract feature sequences first (see sequence-manipulation/sequence-slicing) or keep the GenBank file as the source of record and use the FASTA only as a sequence-only derivative for tools that demand FASTA.

Lossy Conversion Decision Table

FromToWhat is lost (silently)
GenBank / EMBLFASTAAll features, qualifiers, annotations, dbxrefs; keeps id + description + seq
GenBankEMBL (or reverse)Usually lossless; both hold features and annotations
FASTQFASTAPer-base quality scores (phred_quality)
FASTQ Phred+64FASTQ Phred+33Nothing if offsets handled correctly; corruption if the wrong parser is used
FASTQ PhredFASTQ SolexaPrecision at low quality (round-trip lossy below ~Q10); warns when max Solexa exceeded
StockholmFASTAAlignment columns (gaps), consensus, per-column annotation; keeps ungapped seqs
Any rich formatFASTAEverything except id + description + seq

The general pattern: rich -> flat loses the richness. The conversion succeeds regardless.

Preferred Path: SeqIO.convert() Is a Streaming One-Shot

For a plain conversion with no record modification, use SeqIO.convert(). It streams one record at a time from input to output (memory-efficient, never loads the whole file) and is preferred over parse() + write(), which is only needed when records must be changed en route.

python
from Bio import SeqIO

count = SeqIO.convert('input.gb', 'genbank', 'output.fasta', 'fasta')
print(f'Converted {count} records')

Parameters: in_file, in_format, out_file, out_format (filenames or handles; format strings are lowercase). Returns the number of records written. Reach for parse() + write() only when injecting annotations, transforming sequences, or filtering during the conversion.

FASTQ Quality Encoding Conversion

FASTQ quality is one ASCII character per base, but the offset and score type differ across instrument generations. Re-encoding between them is a conversion, not a copy: the bytes in the quality line change.

Format stringForOffsetScore type
fastq (alias of fastq-sanger)Sanger and modern Illumina 1.8+33Phred 0-93
fastq-sangersame as above33Phred 0-93
fastq-illuminaIllumina 1.3-1.764Phred 0-62
fastq-solexapre-1.3 Solexa64Solexa odds -5..62

Re-encode old Illumina 1.3+ (Phred+64) to modern Sanger (Phred+33) by naming both variants. SeqIO.convert() reads with the input offset and writes with the output offset:

python
from Bio import SeqIO

SeqIO.convert('illumina13.fastq', 'fastq-illumina', 'sanger.fastq', 'fastq-sanger')

Never re-encode without a verified source encoding. Quality encoding cannot be auto-detected in general: ASCII >= 64 is legal in every variant, so a high-quality Sanger file and a low-quality Illumina-1.3 file can be byte-identical in their quality lines. Two failure modes follow from guessing wrong:

  • Loud and safe: a character outside the chosen parser's range raises ValueError noting the quality string is not in the correct range for the chosen QualityIO parser.
  • Silent and dangerous: if every quality char falls in the overlap valid for both encodings, no error fires and every score comes out off by exactly 31 (the 64 - 33 offset gap). QC is then silently garbage.

Confirm the encoding from the sequencing pipeline (or FastQC's inferred encoding) before re-encoding; do not let the agent guess the offset.

Solexa is doubly lossy. Solexa uses an odds score, Q = -10 log10(P/(1-P)), not Phred's Q = -10 log10(P), which is why Solexa scores go negative. Phred <-> Solexa conversions round a float to one ASCII char per base, so the round trip is many-to-one and lossy below ~Q10 (for example Solexa 9 and 10 both map to Phred 10). Writing fastq-solexa from a Phred-only record forces an on-the-fly lossy conversion and emits a BiopythonWarning when max(qualities) >= 62.5. There is no clean Phred -> Solexa path that avoids the loss; only re-encode toward Solexa when a legacy tool truly requires it.

Show full SKILL.md (471 more words)Show less

Conversions That Require Adding Data

FASTA has no molecule_type and no quality, so converting FASTA up to a richer format means supplying what FASTA lacked. Stream records through a generator that injects the missing field.

FASTA to GenBank (requires molecule_type)

Goal: Convert FASTA to GenBank, which the writer refuses to produce without molecule_type.

Approach: Stream records through a generator that sets record.annotations['molecule_type'], then write as GenBank.

Reference (BioPython 1.83+):

python
from Bio import SeqIO

def add_molecule_type(records, mol_type='DNA'):
    for record in records:
        record.annotations['molecule_type'] = mol_type
        yield record

records = SeqIO.parse('input.fasta', 'fasta')
SeqIO.write(add_molecule_type(records), 'output.gb', 'genbank')
FASTA to FASTQ (requires quality scores)

Goal: Convert FASTA to FASTQ by assigning placeholder per-base quality.

Approach: Stream records through a generator that adds a phred_quality list of the right length, then write as FASTQ.

Reference (BioPython 1.83+):

python
from Bio import SeqIO

def add_quality(records, quality=40):
    for record in records:
        record.letter_annotations['phred_quality'] = [quality] * len(record.seq)
        yield record

records = SeqIO.parse('input.fasta', 'fasta')
SeqIO.write(add_quality(records), 'output.fastq', 'fastq')

Placeholder quality is fabricated, not measured: downstream QC and variant callers will treat it as real. Use it only to satisfy a tool's format requirement, never to imply the bases were measured at that quality. letter_annotations is length-locked to the sequence, so the list length must equal len(record.seq).

Batch Convert a Directory

Goal: Convert every file of one format in a directory to another format.

Approach: Glob the input files, apply SeqIO.convert() to each, and report per-file counts.

Reference (BioPython 1.83+):

python
from pathlib import Path
from Bio import SeqIO

for gb_file in Path('.').glob('*.gb'):
    fasta_file = gb_file.with_suffix('.fasta')
    count = SeqIO.convert(str(gb_file), 'genbank', str(fasta_file), 'fasta')
    print(f'{gb_file.name}: {count} records')

Convert With Sequence Modification

When the conversion must also transform sequences, parse and write explicitly rather than using convert().

python
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord

def uppercase_record(rec):
    return SeqRecord(rec.seq.upper(), id=rec.id, description=rec.description)

records = SeqIO.parse('input.fasta', 'fasta')
SeqIO.write((uppercase_record(rec) for rec in records), 'output.fasta', 'fasta')

Seq is case-preserving, so lowercase soft-masking survives a plain conversion; call .upper() explicitly only when the destination tool requires uppercase.

Alignment Format Conversion

Sequence formats drop gaps and alignment columns. To convert between alignment formats (Stockholm, PHYLIP, Clustal, FASTA-alignment) keeping the columns, use AlignIO, not SeqIO.

python
from Bio import AlignIO

AlignIO.convert('alignment.sto', 'stockholm', 'alignment.phy', 'phylip')

Common Errors

SymptomCauseFix
GenBank features missing after conversionTarget was FASTA, which cannot hold featuresExpected and silent; keep the GenBank as source, or extract features before converting
ValueError about missing molecule_typeWriting GenBank/EMBL from records that lack it (e.g. from FASTA)Set record.annotations['molecule_type'] before writing
ValueError about quality scoresWriting FASTQ from records with no phred_qualityAdd phred_quality to letter_annotations (length must equal the sequence)
ValueError mentioning the QualityIO parserA quality char is outside the named parser's range (wrong FASTQ variant)Use the correct variant: fastq-sanger, fastq-illumina, or fastq-solexa
FASTQ scores all off by 31 with no errorRead Phred+33 as fastq-illumina or Phred+64 as fastq-sanger (overlap region)Confirm the true encoding from the pipeline; re-read with the right variant
BiopythonWarning "Data loss - max Solexa quality"Writing fastq-solexa from Phred scores above ~62Expected lossy conversion; only write Solexa when a legacy tool requires it
Alignment columns/gaps lostUsed SeqIO on an alignmentUse AlignIO.convert() to preserve columns
  • read-sequences - Parse sequences and choose parse vs index for the input
  • write-sequences - Write converted sequences with modifications
  • fastq-quality - Phred/Solexa/Illumina encoding details and quality handling
  • batch-processing - Convert many files across a directory
  • compressed-files - Handle gzip/BGZF input and output during conversion
  • sequence-manipulation/sequence-slicing - Extract feature sequences before downgrading to FASTA
  • alignment-files/sam-bam-basics - For SAM/BAM/CRAM conversion, use samtools view

© GPTomics, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in sequence-io/format-conversion of GPTomics/bioSkills.

  • SKILL.md
  • examples/convert_format.py
  • usage-guide.md

Open the folder on GitHubat commit d91ed3d

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in GPTomics/bioSkills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Bio Format Conversion 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.

Bio Format Conversion compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bio Format Conversion this skillGPTomics/bioSkills1.2k1 repos~2.9kAutomated safety check: PassMIT
Biopython Bioinformaticsaiming-lab/AutoResearchClaw15k—~810Automated safety check: PassMIT
Biopythondavila7/claude-code-templates32k13 repos~3.4kAutomated safety check: PassMIT
BiopythonK-Dense-AI/scientific-agent-skills48k1 repos~4.3kAutomated safety check: NotesMIT
Biopythonlamm-mit/scienceclaw244—~3.9kAutomated safety check: PassApache-2.0
Tooluniverse Phylogeneticswu-yc/LabClaw1.1k2 repos~4.2kAutomated safety check: PassNone

Similar skills

  • 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.

    15k GitHub stars~810 tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Biopython

    davila7/claude-code-templates

    Primary Python toolkit for molecular biology. An agent skill from davila7/claude-code-templates.

    32k GitHub starsUsed in 13 repos~3.4k tokens
    Research & ScienceAuto-check passed
  • Biopython

    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).

    48k GitHub starsUsed in 1 repo~4.3k tokens
    Research & ScienceAuto-check: notes
  • Biopython

    lamm-mit/scienceclaw

    Computational molecular biology library (sequence I/O, alignment, phylogenetics).

    244 GitHub stars~3.9k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Production-ready phylogenetics and sequence analysis skill for alignment processing, tree analysis, and evolutionary metrics.

    1.1k GitHub starsUsed in 2 repos~4.2k tokens
    Research & ScienceAuto-check passed
  • Bio Format Conversion

    FreedomIntelligence/OpenClaw-Medical-Skills

    Convert between sequence file formats (FASTA, FASTQ, GenBank, EMBL) using Biopython Bio.SeqIO.

    3.1k GitHub starsUsed in 1 repo~1.5k tokens
    Research & ScienceAuto-check passed

More from GPTomics/bioSkills

All 552 skills in this repo
  • Bio Alignment Io

    GPTomics/bioSkills

    Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO.

    1.2k GitHub starsUsed in 3 repos~4.9k tokens
    Auto-check passed
  • bioSkills Installer

    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.

    1.2k GitHub starsUsed in 1 repo~789 tokens
    Auto-check passed
  • Bio Write Sequences

    GPTomics/bioSkills

    Write biological sequences to files (FASTA, FASTQ, GenBank, EMBL) using Biopython Bio.SeqIO.

    1.2k GitHub starsUsed in 3 repos~2.1k tokens
    Auto-check passed
  • Amplicon Primer Clipping

    GPTomics/bioSkills

    Soft- or hard-clips PCR primer footprints from aligned amplicon BAMs so primer bases stop masquerading as confirmed reference sequence.

    1.2k GitHub starsUsed in 2 repos~2.2k tokens
    Auto-check passed
  • Bio Alignment Indexing

    GPTomics/bioSkills

    Create and use BAI/CSI indices for BAM/CRAM files using samtools and pysam.

    1.2k GitHub starsUsed in 2 repos~2.4k tokens
    Auto-check passed
  • Bio Alignment Sorting

    GPTomics/bioSkills

    Sort alignment files by coordinate or read name using samtools and pysam.

    1.2k GitHub starsUsed in 2 repos~2.6k tokens
    Auto-check passed

Works with

Questions about Bio Format Conversion

What does Bio Format Conversion do?

Convert between sequence file formats (FASTA, FASTQ, GenBank, EMBL, Stockholm) and re-encode FASTQ quality offsets using Biopython Bio.SeqIO. Bio Format Conversion is an agent skill from GPTomics/bioSkills.SeqIO.

When should I use Bio Format Conversion?

Bio Format Conversion fits situations like: changing a file format for a downstream tool; fixing FASTQ quality encoding (Phred+33 vs Phred+64 vs Solexa); A conversion risks silently dropping annotations.

How do I install Bio Format Conversion in Claude Code?

Run `npx skills add GPTomics/bioSkills --skill bio-format-conversion -a claude-code`. Or copy the skill folder (sequence-io/format-conversion in GPTomics/bioSkills) into .claude/skills/bio-format-conversion in your project. Claude Code loads it when a task matches its description.

How do I install Bio Format Conversion in Codex?

Run `npx skills add GPTomics/bioSkills --skill bio-format-conversion -a codex`. Or copy the skill folder (sequence-io/format-conversion in GPTomics/bioSkills) into .agents/skills/bio-format-conversion in your project. Codex loads it when a task matches its description.

Can I use Bio Format Conversion in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add GPTomics/bioSkills --skill bio-format-conversion -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-format-conversion, .gemini/skills/bio-format-conversion, .github/skills/bio-format-conversion and .opencode/skills/bio-format-conversion in your project.

What does Bio Format Conversion need to run?

Going by SKILL.md and its folder, Bio Format Conversion needs Python for the scripts in its folder and the command-line tools its instructions call (pip). Our summary lists: Python 3.

Does Bio Format Conversion access the network?

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.

Is Bio Format Conversion safe to install?

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.

What licence does Bio Format Conversion use?

Bio Format Conversion is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bio Format Conversion use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bio Format Conversion?

Skills that share tags, products or a category with Bio Format Conversion: Biopython Bioinformatics (aiming-lab/AutoResearchClaw, 15k stars), Biopython (davila7/claude-code-templates, 32k stars), Biopython (K-Dense-AI/scientific-agent-skills, 48k stars) and Biopython (lamm-mit/scienceclaw, 244 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bio Format Conversion?

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.