Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
Back to list

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 & AnalyticsIntermediate33,0303,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.pb vs LazyFrame.pb, 1-based vs 0-based coordinate metadata, probe-build argument order, and enabling target_partitions parallelism.
  • 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

  1. "Count how many peaks from peaks.bed overlap each gene in genes.gff" → produces a pb.scan_gff + pb.count_overlaps pipeline.
  2. "From a VCF on S3, pull variants with qual > 30 as chrom/start/ref/alt" → uses pb.register_vcf + pb.sql, or a streaming scan_vcf().select() chain.
  3. "Compute coverage depth for aligned.bam using reads with mapping quality ≥ 20" → reminds you about the .bai index and writes pb.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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download 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.

  1. Open a terminal and make sure the skills folder exists: mkdir -p ~/.claude/skills
  2. Clone the repository: git clone https://github.com/K-Dense-AI/scientific-agent-skills.git
  3. Copy just this skill: cp -r scientific-agent-skills/skills/polars-bio ~/.claude/skills/
  4. Verify the bundled references/ markdown files came along: ls ~/.claude/skills/polars-bio
  5. 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).
  6. If you work with BAM/CRAM, install samtools and create indexes when missing: samtools index aligned.bam.
  7. Restart Claude Code, then try a prompt like "use polars-bio to overlap these two BED files" to trigger the skill.