polars-bio Genomic Intervals
Guides Claude to perform fast genomic interval operations and bioinformatics file I/O (BED/VCF/BAM/GFF) on Polars DataFrames with polars-bio.
Data & AnalyticsIntermediate★ 33,030⑂ 3,248AI score 9/10Last updated: Aug 9, 2026
What it does
- Generates correct polars-bio code for eight interval operations: overlap, count_overlaps, nearest, merge, cluster, coverage, complement, subtract.
- Documents
read_*/scan_*/write_*/sink_*usage and per-format column schemas for BED, VCF, VCF-Zarr, BAM, CRAM, GFF/GTF, FASTA, FASTQ, SAM, and Hi-C pairs. - Shows how to register genomic files as DataFusion SQL tables and how to compute per-base read depth (pileup) from BAM/CRAM.
- Pre-empts common mistakes: forgetting
.collect()on LazyFrame results,DataFrame.pbvsLazyFrame.pb, 1-based vs 0-based coordinate metadata, probe-build argument order, and enablingtarget_partitionsparallelism. - Covers cloud-native I/O with
s3://,gs://,az://URIs plus streaming/out-of-core execution for datasets larger than RAM.
Who it's for
- Bioinformaticians and data engineers migrating from bioframe/pandas to a faster Polars pipeline.
- Anyone processing large VCF/BAM files that don't fit in memory.
- Teams keeping genomics data in object storage who want to query it in place.
- Claude Code users who repeatedly write genomic analysis scripts and want fewer API mistakes.
Example uses
- "Count how many peaks from peaks.bed overlap each gene in genes.gff" → produces a
pb.scan_gff+pb.count_overlapspipeline. - "From a VCF on S3, pull variants with qual > 30 as chrom/start/ref/alt" → uses
pb.register_vcf+pb.sql, or a streamingscan_vcf().select()chain. - "Compute coverage depth for aligned.bam using reads with mapping quality ≥ 20" → reminds you about the
.baiindex and writespb.depth(..., min_mapping_quality=20).
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/HEAD/skills/polars-bio/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/polars-bio folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/polars-bio/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git && mkdir -p ~/.claude/skills && cp -r scientific-agent-skills/skills/polars-bio ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and make sure the skills folder exists:
mkdir -p ~/.claude/skills - Clone the repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Copy just this skill:
cp -r scientific-agent-skills/skills/polars-bio ~/.claude/skills/ - Verify the bundled
references/markdown files came along:ls ~/.claude/skills/polars-bio - Install the library in a Python 3.11–3.14 environment:
uv pip install "polars-bio==0.31.0"(add the[pandas]extra if you need pandas interop). - If you work with BAM/CRAM, install
samtoolsand create indexes when missing:samtools index aligned.bam. - Restart Claude Code, then try a prompt like "use polars-bio to overlap these two BED files" to trigger the skill.
View source on GitHub ↗License: MIT