polars-bio Genomic Intervals
Teaches Claude to run fast genomic interval arithmetic and bioinformatics file I/O on Polars DataFrames with polars-bio.
Data & AnalyticsIntermediate★ 33,030⑂ 3,248AI score 8/10Last updated: Aug 9, 2026
What it does
A reference skill that lets Claude write correct, idiomatic polars-bio code (Polars + Arrow + DataFusion).
- 8 interval operations:
overlap,count_overlaps,nearest,merge,cluster,coverage,complement,subtract - Bioinformatics I/O: BED, VCF (and VCF Zarr), BAM, CRAM, SAM, GFF/GTF, FASTA, FASTQ, Hi-C pairs via
read_*/scan_*/write_*/sink_* - SQL layer: register files as tables and query them with DataFusion SQL
- Pileup/depth: CIGAR-aware per-base read depth from BAM/CRAM
- Streaming & cloud: out-of-core processing plus direct s3://, gs://, az:// reads
It also encodes the tricky parts — 1-based vs 0-based coordinate metadata, .pb only exposing interval ops on LazyFrame, probe-build argument order, INT32 coordinate limits — which sharply reduces hallucinated API calls.
Who it's for
- Genomics analysts hitting performance walls with bioframe or pybedtools
- Researchers processing large VCF/BAM files on memory-limited machines
- Data engineers wiring interval arithmetic into Polars pipelines
- Teams keeping sequencing data in cloud buckets who want query-in-place
Example uses
- Peak-to-gene annotation: "Annotate my ATAC-seq peaks with the nearest GENCODE gene" →
pb.read_bed+pb.read_gff+pb.nearest. - Coverage report: "Compute mean depth of aligned.bam across my target panel BED" →
pb.depth(min_mapping_quality=20)joined back to intervals. - Cloud variant filtering: "Pull QUAL>30 variants from s3://bucket/cohort.vcf.gz and write Parquet" →
pb.register_vcf+pb.sql+ streaming collect.
· · · Install guide · · ·
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 /tmp/sas && cp -r /tmp/sas/skills/polars-bio ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and create the skills folder if needed:
mkdir -p ~/.claude/skills - Clone the repository into a temp directory:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/sas - Copy just this skill:
cp -r /tmp/sas/skills/polars-bio ~/.claude/skills/ - Install the library in a Python 3.11–3.14 environment:
uv pip install "polars-bio==0.31.0"(use"polars-bio[pandas]==0.31.0"for pandas interop) - If you plan to read BAM files, build an index:
samtools index aligned.bam - For cloud paths, export the usual SDK credentials (
AWS_ACCESS_KEY_ID,GOOGLE_APPLICATION_CREDENTIALS, Azure defaults) - Restart Claude Code and test with: "Use polars-bio to overlap these two BED files."
View source on GitHub ↗License: MIT