Skip to content

v0.12.0

Choose a tag to compare

@nvictus nvictus released this 28 Oct 13:38
· 11 commits to master since this release

This release fixes a large backlog of bugs found in a review of the whole codebase. It also makes balancing faster, and more correct in the trans-only case. It also removes features that didn't work well, and drops several dependencies.

Fixes

  • cooler cload assigned a position at the end of a chromosome to the next chromosome's first bin, turning a cis contact into a trans one. Such positions are now rejected.
  • cooler cp/mv/ln -w` could empty the destination file when the operation failed.
  • cooler zoomify destroyed its input when the default output name was the input file, and --base-uri kept only one base cooler.
  • Custom field aggregators: cload pairs --field ...:agg=max (or min) combined chunks by summing them, and fields given out of column order swapped their values.
  • Aggregating multiple value columns: coarsen and zoomify dropped every value column except count.
  • Extra long chromosomes: chromosomes longer than 2^31 bp overflowed, and pixel values too large for their column were clipped. Long chromosomes are now stored correctly, and values that don't fit raise an error.
  • Guarding against unsorted input: Unsorted input could produce coolers with a corrupt index or duplicate pixels.
  • A failed write no longer leaves a partial cooler behind or destroys an existing one.

Balancing

  • Trans-only balancing balances to exact targets and filters bins based on trans data only. Trans-only weights change, mostly by a few percent.
  • Cis-only balancing is now as fast as genome-wide balancing on assemblies with many contigs: 4.6 s instead of 316 s on 2,010 contigs.
  • --force keeps the existing weights until new ones are stored, and storing weights works on assemblies with many thousands of contigs (#226).
  • New options: cooler balance --rescale-marginals/--no-rescale-marginals (#448) and balance_cooler(..., ignore_dist=...). --ignore-dist works with variable-size bins (#464).

New features

  • cload pairs --field ...:agg=sum_squares. With a sum and a count, it can be used to give a column's mean and variance, and all three stay exact when coarsening and merging.
  • Range queries are faster: matrix queries on HDF5 files take about two thirds of the time.
  • 2D range queries can return several value columns at once.
  • cooler.log_to_stderr() shows cooler's log messages in scripts and notebooks. Importing cooler no longer configures logging.

Removed

  • cooler csort is gone. cooler cload pairs can ingest unsorted pairs directly. To sort and index pairs files, use pairtools sort instead.
  • mean and other field aggregations that depend on how pixels are grouped. To get a mean, store a sum and a count, which combine exactly.
  • cooler.sandbox, cooler zoomify --legacy, and the deprecated append argument of cooler.create.create.

Dependencies

  • cooler no longer depends on cytoolz, multiprocess or dill. Parallel commands use Python's multiprocessing, which made parallel balancing about 2.2x faster. Functions passed to a process pool must now be picklable, so lambdas no longer work.
  • pyfaidx is optional and included in cooler[all].
  • Tested on Python 3.9 to 3.14, NumPy 1.26 and 2.x, and pandas 1.5 to 3.x.

Full Changelog: v0.11.0...v0.12.0