← Back to all sparks
V

valr

INFRA · APIS
Velocity0.0

Genome Interval Arithmetic

valr's interval verbs now read genomic files in place instead of demanding a loaded tibble.

genomicsinterval-arithmeticbioinformaticsbigwigcpp11r-packages
Current state
valr reimplements bedtools-style genome interval arithmetic as tidyverse verbs backed by C++. Its long project has been closing the behavioural gap with bedtools — the book-ended interval semantics finally match in 0.10.0, three releases after the deprecation began. The July release also ends the assumption that intervals must be in memory: bed_map(), bed_intersect(), bed_subtract(), bed_coverage() and bed_window() accept a bigWig or bigBed path or URL where an interval table used to go.
Where it's heading
Two arcs converge here. One is compatibility: min_overlap arrived with a deprecation warning in 0.9.0 and its default flipped from 0 to 1 in 0.10.0, so book-ended intervals are excluded by default as bedtools does, with the internal calculations in bed_closest() and friends deliberately left counting them. The other is the file-backed path, which grew out of the cpp11bigwig dependency adopted in 0.8.3 for read_bigwig() and re-exported in 0.9.0 — reading a file became querying one. Underneath, the C++ base keeps getting lighter: Rcpp swapped for cpp11, rlang cut to a single function, per-group memory copies removed from three verbs.
Prediction
Only five verbs take a file argument today and bed_closest(), bed_glyph() and the statistical verbs do not, so extending the file-backed path across the rest of the API is the obvious follow-up. The deprecated tibble re-exports and the now-defunct n_fields argument suggest continued removal of the compatibility layer in the next minor release.

Recent moves

  1. 1mo ago

    Interval verbs read bigWig and bigBed files directly

    ⚡ SPARK

    The release completes two things at once: the bedtools-matching overlap semantics that 0.9.0 began deprecating, and a change in what an interval argument can be. Since 0.8.3 valr could read bigwig files; now it can query them without materializing them, which is the capability the cpp11bigwig dependency was building toward.

    View source ↗
  2. 7mo ago

    bed_slop() and bed_flank() preserve input row order

    Output ordering stops being silently rewritten by chrom and start, which matters to anyone joining results back to their input. Also a suffix fix in bed_closest() and a visitor-pattern rework of bed_intersect() that cuts allocations on large datasets — the same memory-pressure thread that 0.10.0's file-backed reads extend.

    View source ↗
  3. 8mo ago

    min_overlap introduced; C++ backend moves from Rcpp to cpp11

    Where the bedtools-alignment plan is announced rather than enforced: min_overlap appears on four verbs with a deprecation warning and the legacy behaviour retained, flagging the flip that lands in 0.10.0. The Rcpp-to-cpp11 migration underneath is invisible to users but removes a dependency and precedes the memory work in later releases.

    View source ↗
  4. 1y ago

    Test updated for ggplot2 3.6.0

    A single test adjusted ahead of a ggplot2 release. No package behaviour changes.

    View source ↗
  5. 1y ago

    read_bigwig() switches to cpp11bigwig; read_gtf() deprecated

    The dependency decision the file-backed reads in 0.10.0 are built on, taken here for a defensive reason: rtracklayer's vendored UCSC C code was failing CRAN AddressSanitizer checks, so it went and cpp11bigwig came in. read_gtf() was collateral, and the minimum R version rose to 4.0.0.

    View source ↗
  6. 1y ago

    CRAN Rd link NOTE and maintainer email change

    Housekeeping for a CRAN note about documentation link targets, plus a maintainer address update.

    View source ↗