polars-bio

Process genomic intervals with Polars DataFrames and DataFusion.

33.0k|3.2k|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills --skill polars-bio-k-dense-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: polars-bio
Source: https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/scientific-skills/polars-bio
Command: npx skills add https://github.com/K-Dense-AI/scientific-agent-skills --skill polars-bio-k-dense-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

polars-bio provides high-performance genomic interval operations and bioinformatics file I/O on Polars DataFrames, enabling scalable analysis of large genomic datasets.

Core Features & Use Cases

  • Overlap, nearest, merge, coverage, complement, and subtract for BED/VCF/BAM/GFF intervals with streaming and SQL support.
  • Read/write common bioinformatics formats (BED, VCF, BAM, CRAM, GFF/GTF, FASTA, FASTQ) with cloud storage and compression options.
  • SQL-based workflows by registering files as tables and querying with DataFusion to combine interval ops with familiar SQL patterns.

Quick Start

Install polars-bio and run a basic overlap example using two small interval DataFrames.

Frequently Asked Questions about polars-bio

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find overlapping genomic intervals in BED and VCF files?

To find overlapping genomic intervals, you can use Polars DataFrames and DataFusion to perform scalable interval arithmetic across BED and VCF files. This approach enables efficient overlap detection by applying robust functional and method-chaining API operations.

What is the best way to perform nearest neighbor queries on large genomic datasets?

The best way to perform nearest neighbor queries on large genomic datasets is by leveraging Polars DataFrames with streaming I/O and lazy evaluation. This ensures scalable interval arithmetic and efficient coordinate system metadata handling for bioinformatics formats.

Can I use SQL to query BAM and GFF intervals?

Yes, you can use SQL to query BAM and GFF intervals by registering the files as tables with DataFusion. This enables SQL-based workflows that combine genomic interval operations with familiar SQL patterns directly within your data analysis pipeline.

Does polars-bio support cloud storage for reading bioinformatics file formats?

Yes, polars-bio supports cloud-friendly read and scan operations for common bioinformatics formats like BED, VCF, BAM, CRAM, GFF/GTF, FASTA, and FASTQ. It includes streaming I/O and compression options to efficiently process genomic data directly from cloud environments.

How do I merge and cluster genomic intervals efficiently?

You can merge and cluster genomic intervals efficiently by applying interval arithmetic operations on Polars DataFrames. Utilizing lazy evaluation and streaming I/O ensures these operations scale effectively across large bioinformatics datasets.

What are the limitations of using DataFusion for genomic interval arithmetic?

A key consideration when using DataFusion for genomic interval arithmetic is ensuring proper coordinate system metadata handling. While it enables scalable SQL-based workflows and lazy evaluation, users must manage coordinate metadata correctly to avoid inaccurate interval overlap or coverage analysis.