--- id: pyranges version: "0.1.4" license: MIT license_treatment: permissive maintenance: active --- # pyranges — GenomicRanges for Python. License: permissive · Maintenance: active · Downloads: 88.2K/mo ## What it is and what it does PyRanges is a Python library for working with genomic intervals—discrete regions of DNA sequences like genes, regulatory features, or sequencing reads. It wraps pandas DataFrames to provide a genomics-specific interface optimized for fast querying and manipulation of these intervals, making it easier to perform common bioinformatics tasks like overlap detection, merging, and filtering without writing low-level code. The library is built on top of pandas and integrates with the broader Python data science ecosystem, so you can chain operations with a terse syntax and leverage existing pandas and NumPy tools on the results. It depends on ncls for interval indexing, sorted_nearest for nearest-neighbor queries, tabulate for display, and natsort for natural sorting of genomic coordinates. Use it for: - Find overlapping genomic features (e.g., which genes overlap with a set of ChIP-seq peaks) - Merge or subtract genomic intervals to build consensus annotations or mask regions - Query and filter large genomic datasets by chromosome, position, or feature type - Perform nearest-neighbor searches to find the closest gene to a variant position ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyRanges provides efficient querying and manipulation of genomic intervals (genes, features, reads) using a pandas-backed interface optimized for genomics workflows. Yes. PyRanges is actively maintained, has no known vulnerabilities, installs with low friction, and is widely used in bioinformatics. The MIT license poses no restrictions. Install it if you work with genomic intervals or annotations in Python. ## Install pip install pyranges uv add pyranges poetry add pyranges ## Installing pyranges Before you install: Low install friction with a pure Python wheel distribution. Active maintenance with recent commits (last commit 2026-04-23) and steady releases; 493 repository stars indicate established use in the bioinformatics community. License in practice: MIT license is permissive, allowing use in commercial and proprietary projects with minimal restrictions beyond attribution. Quickstart: import pyranges as pr import pandas as pd # Create a PyRanges object from a DataFrame df = pd.DataFrame({'Chromosome': ['chr1'], 'Start': [0], 'End': [1]}) gr = pr.PyRanges(df) print(gr) Verify before relying: - Whether the package requires specific versions of pandas, ncls, or other runtime dependencies beyond what pip resolves automatically - Performance characteristics and scalability limits for very large genomic datasets ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 88.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags genomic intervals manipulation, genomics data querying, genomic ranges python, bioinformatics interval operations, genomic annotations library, bioinformatics, genomics, interval-queries [View on SkillFed](https://skillfed.io/packages/pyranges) · [View on PyPI](https://pypi.org/project/pyranges/)