/clawbio:polars-biofrom clawbio
Fast genomic interval operations (overlap, nearest, merge, coverage, cluster, complement, subtract, count-overlaps), multi-format bioinformatics I/O, DataFusion SQL, and pileup on Polars DataFrames. A scalable bioframe/bedtools alternative.
Ships in clawbio. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are polars-bio, a ClawBio agent for fast genomic interval arithmetic and
bioinformatics file I/O on Polars DataFrames. You dispatch the
polars_bio_runner.py CLI; the library does the compute.
Fire this skill when the user says any of:
Do NOT fire when:
variant-annotation, vcf-annotator,
clinical-variant-reporter.fastreer, phylogenetics-builder.multiqc-reporter.nfcore-sarek-wrapper.ClawBio has variant/VCF skills and a phylogenetics tool, but no fast, DataFrame-native interval-operations engine.
Performance (attributed to the polars-bio docs/paper, not invented): 6–38× faster
than bioframe on interval benchmarks; streaming throughput ~20–28M rows/s; substantially
faster VCF parsing; ~20× less memory than vanilla Polars on GFF reads. See
references/polars_primer.md.
--describe for schema-only inspection
(VCF/VCF Zarr/BAM/CRAM/SAM).t and run SQL.One library, one cohesive surface. This skill wraps polars-bio operations and nothing else. Annotation, calling, QC, and phylogenetics live in other skills.
polars-bio extends Polars (a Rust-backed, Apache Arrow-native DataFrame library) with genomics. The stack:
Polars (LazyFrame/DataFrame) -> Apache Arrow (columnar memory)
-> Apache DataFusion (query/SQL engine) -> datafusion-bio (BED/VCF/BAM/... readers)
Genomic interval work stays inside the same DataFrame pipeline as the rest of a Python
analysis — no pandas/bedtools round-trips. Interop: .to_pandas(), pyarrow hand-off,
and output_type="polars.DataFrame" for eager results. Full primer (Polars vs pandas,
neighbors bioframe/pyranges1/pybedtools/GenomicRanges, Rust backends ruranges/
superintervals): references/polars_primer.md.
Canonical list of what this skill accepts (reader functions and parameters are
detailed in references/file_io.md).
| Format | Extension | Notes |
|---|---|---|
| BED | .bed | >=4 columns required (chrom,start,end,name); interval ops + io/sql |
| VCF | .vcf/.vcf.gz | io/sql; --describe lists INFO/FORMAT fields |
| VCF Zarr | .zarr dir | io/sql; array-native variant store |
| GFF / GTF | .gff3/.gtf | annotations; io/sql |
| FASTA / FASTQ | .fasta/.fastq | sequences; io/sql |
| BAM | .bam (+.bai) | io/sql/pileup; index required |
| CRAM | .cram | io/pileup; needs --reference FASTA |
| SAM | .sam | text alignments; io/sql |
| Pairs | .pairs | Hi-C contacts; io/sql |
| BigWig / BigBed | .bw/.bb | signal / interval tracks; io/sql |
.bai).--output <dir> (see CLI Reference).figure.png and read report.md; summarize the row counts
and schema for the user.--demo immediately ("I'll run a demo on synthetic BED data so you can see it").# Interval operations (BED in, report/json/figure/table out)
python skills/polars-bio/polars_bio_runner.py overlap --a a.bed --b b.bed --output <dir>
python skills/polars-bio/polars_bio_runner.py nearest --a a.bed --b b.bed --k 1 --output <dir>
python skills/polars-bio/polars_bio_runner.py merge --a a.bed --output <dir>
python skills/polars-bio/polars_bio_runner.py coverage --a a.bed --b b.bed --output <dir>
python skills/polars-bio/polars_bio_runner.py cluster --a a.bed --output <dir>
python skills/polars-bio/polars_bio_runner.py complement --a a.bed --output <dir>
python skills/polars-bio/polars_bio_runner.py subtract --a a.bed --b b.bed --output <dir>
python skills/polars-bio/polars_bio_runner.py count-overlaps --a a.bed --b b.bed --output <dir>
# File I/O (schema + head); --describe for schema-only inspection
python skills/polars-bio/polars_bio_runner.py io --input s.vcf --format vcf --output <dir>
python skills/polars-bio/polars_bio_runner.py io --input s.vcf --format vcf --describe --output <dir>
# DataFusion SQL (file registered as table `t`)
python skills/polars-bio/polars_bio_runner.py sql --input s.vcf --query "SELECT chrom,start FROM t" --output <dir>
# Pileup (indexed BAM)
python skills/polars-bio/polars_bio_runner.py pileup --input aln.bam --min-mapping-quality 20 --output <dir>
# Demo (synthetic BED overlap)
python skills/polars-bio/polars_bio_runner.py --demo --output /tmp/polars_bio_demo
Global flags: --one-based (output 1-based closed coords; default is 0-based
half-open, BED-native), --genome <chrom-sizes> (bound complement gaps),
--output (required). The coordinate flag sets the output representation only —
it does not change how inputs are parsed, and interval results are identical either way.
--demo runs overlap on the bundled synthetic BED sets and writes
report.md, result.json, figure.png, and result.csv.
result.json (actual):
{
"skill": "polars-bio",
"subcommand": "overlap",
"params": { "k": 1, "zero_based": true },
"polars_bio_version": "<runtime-detected>",
"output_rows": 5,
"output_schema": {
"chrom_1": "String", "start_1": "UInt32", "end_1": "UInt32", "name_1": "String",
"chrom_2": "String", "start_2": "UInt32", "end_2": "UInt32", "name_2": "String"
},
"figure": "figure.png",
"report": "report.md"
}
report.md (excerpt):
# polars-bio — overlap
**polars-bio version:** <runtime-detected>
**Output rows:** 5
## Output schema
| Column | Type |
|--------|------|
| `chrom_1` | String |
| `start_1` | UInt32 |
--one-based only changes how
output coordinates are displayed (1-based closed shifts each start +1); it does
not change which intervals overlap — pairings are identical in both modes.
The CLI defaults to 0-based half-open so BED round-trips (merge/complement/
subtract/cluster) come back BED-native. io and sql honor the same default.
The runner records the actually-installed polars-bio version in result.json
(no hardcoded version anywhere).complement needs contig bounds. Without --genome, trailing gaps span to
i64::MAX (not genomically meaningful); the runner emits a caveat in report.md
and stderr. Pass --genome <chrom-sizes> (chrom<TAB>size per line) for bounded gaps.output_type="polars.DataFrame"); if you call the library directly, remember
.collect().expand and sort_bedframe are not exposed as functions in the current
polars-bio Python API, so they are intentionally not subcommands. Use Polars
expressions for padding/sorting if needed..bai index for io/sql/pileup; the runner errors clearly if
missing (samtools index aln.bam). CRAM needs a reference_path.result.ndjson instead of result.csv automatically.ClawBio is a research and educational tool. It is not a medical device and does not
provide clinical diagnoses. Consult a healthcare professional before making any
medical decisions. Genomic data is processed locally; cloud paths use your own SDK
credentials only when an s3:///gs:///az:// URI is accessed.
The agent dispatches the subcommand, explains parameters, and interprets the report.
The skill (polars_bio_runner.py) executes the computation via polars-bio. The agent
does not invent thresholds, schemas, or benchmark numbers — those come from the library
and references/.
vcf-annotator / variant-annotation: annotate variants that interval ops select.multiqc-reporter: aggregate QC alongside coverage/pileup outputs.fastreer / phylogenetics-builder: downstream phylogenetics on selected regions.nfcore-sarek-wrapper: upstream calling that produces the VCFs/BAMs analyzed here.describe_*/register_* function.Wiewiórka M, Khamutou P, Zbysiński M, Gambin T. polars-bio — fast, scalable, and out-of-core operations on large genomic interval datasets. Bioinformatics, 2025, 41(12):btaf640. https://doi.org/10.1093/bioinformatics/btaf640
examples/demo.bam (opens in a new tab)examples/demo.bam.bai (opens in a new tab)examples/demo.bb (opens in a new tab)examples/demo.bw (opens in a new tab)examples/demo.fasta (opens in a new tab)examples/demo.fastq (opens in a new tab)examples/demo.gff3 (opens in a new tab)examples/demo.gtf (opens in a new tab)examples/demo.pairs (opens in a new tab)examples/demo.sam (opens in a new tab)examples/demo.vcf (opens in a new tab)examples/demo_a.bed (opens in a new tab)examples/demo_b.bed (opens in a new tab)examples/generate_fixtures.py (opens in a new tab)polars_bio_runner.py (opens in a new tab)references/configuration.md (opens in a new tab)references/file_io.md (opens in a new tab)references/interval_operations.md (opens in a new tab)references/pileup_operations.md (opens in a new tab)references/polars_primer.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub clawbio/clawbio --plugin clawbio112 skills in this plugin
/affinity-proteomicsUnified analysis pipeline for affinity-based proteomics platforms — Olink (PEA, NPX) and SomaLogic SomaScan (SOMAmer, RFU). Platform-aware QC, normalisation, differential abundance, volcano plots, heatmaps, and PCA./analyze-fastaAnalyze a single FASTA file (nucleotide or protein), compute sequence-level metrics (GC, ORFs, MW, pI, GRAVY, secondary-structure fractions) with Biopython, and write a Markdown report plus structured JSON for downstream chaining./ancestry-risk-profilerInfers genetic super-population ancestry from a 23andMe/AncestryDNA file and computes ancestry-stratified odds ratios with an exploratory Ancestry Elevation Score (AES) showing where ancestry-specific GWAS effect sizes diverge from European reference estimates. The bundled demo panel requires user-supplied ancestry because high-Fst AIM coverage is below the automatic-inference floor.Other plugins' skills for the same job