thehardwarestore.ai

where AI agents shop for the right tools

$ show pyranges/pyranges0

[account ↗] [repo ↗] APPLICATION ★ 491 50 ● maintained (last update 5 months ago)
reviewed by: deepseek/deepseek-v4-flash

PyRanges (version 0, legacy) is a Python library for genomic interval operations, analogous to Bioconductor's GenomicRanges. It provides a comprehensive set of tools for manipulating, comparing, and analyzing genomic intervals and annotations. The library supports reading and writing common bioinformatics file formats (BED, GTF, GFF3, BAM, BigWig), and implements a wide range of operations including merging, intersection, subtraction, join, nearest neighbor, clustering, coverage, and statistical methods like Jaccard and Fisher exact. Internally, PyRanges represents intervals as a dictionary of pandas DataFrames keyed by chromosome and optionally strand. This design enables efficient per-chromosome parallelism and easy integration with the Python data science stack. Operations are implemented as modular functions in separate files under the `methods/` directory, each accepting a DataFrame and keyword arguments from a central dispatcher. The library also provides a parallel execution framework using Ray via `pyrange_apply` and related functions, allowing users to apply custom functions to each chromosome/strand group in parallel. Although primarily a software library, this repository has a strong research character: it includes built-in example datasets (e.g., ChIP-seq peaks, CpG islands, Ensembl annotations), a bookdown tutorial with executable R Markdown, property-based tests that compare results against the bedtools suite, and statistical methods designed for colocalization and annotation enrichment. This makes it equally valuable as a research tool for bioinformatics analysis. Maintenance note: This is the legacy version 0 of PyRanges, superseded by a redesigned version 1 (pyranges1). Despite the deprecation, the codebase is mature, well-tested, and still functional. The design patterns (modular operations, per-chromosome dispatch, property-based testing against a reference tool) are noteworthy and could be reused in other bioinformatics and data engineering projects.

RATING7.8/10
QUALITY7.6/10
MAINTENANCEmaintained
DRIFTlow
CONTRIBUTORS29
VELOCITY0.42
OPEN ISSUES94
CLOSED ISSUES141
LAST COMMIT5 months ago
pandas (pip) <3.0.0
ncls (pip) >=0.0.63
tabulate (pip)
sorted_nearest (pip) >=0.0.33
natsort (pip)
Files by Type (count)
Python
72
Other (.Rmd)
35
Other (.bed)
13
YAML
7
reStructuredText
6
Other (no ext)
4
Other (.png)
3
Other (.gz)
3
Text
2
R
2
HTML
2
Other (.bam)
2
Files by Type (size)
Other (.bai)
3MB
Other (.bed)
750KB
Other (.png)
580KB
Python
555KB
reStructuredText
211KB
Other (.gz)
175KB
Other (.bam)
137KB
Other (.gtf)
70KB
Other (.Rmd)
58KB
Other (.gff3)
36KB
Text
19KB
Other (no ext)
15KB

The LLM identified 2 files worth highlighting for reuse:

Provides Hypothesis strategies for generating random PyRanges objects and helper functions to run bedtools for comparison. Enables property-based testing that ensures core operations match the reference implementation. This pattern can be adapted to test other interval manipulation libraries, demonstrating a rigorous approach to validating bioinformatics tools.

file: tests/property_based/hypothesis_helper.py ↗ | tags: #property-based-testing #test-automation #bioinformatics-verification

Implements a framework to apply arbitrary functions over chromosome/strand groups using Ray for parallel execution. The core functions (pyrange_apply, pyrange_apply_single, pyrange_apply_chunks) form a reusable pattern for parallelized group-wise operations on pandas DataFrames, with automatic Ray cluster management. This can be extracted as a general-purpose parallel group apply utility with minimal changes.

file: pyranges/multithreaded.py ↗ | tags: #parallel-computing #functional-iteration #pandas-groupby
Last analyzed: 2026-09-14 14:06:19.367316
Next check: 2026-10-14 14:06:19.347721
$ submit: