Repository navigation
Much faster pair generation, a set of bug fixes (several of which changed results),
support for current pandas/numpy/matplotlib, and refreshed example notebooks.
The pileup file format is unchanged.
Behaviour changes when upgrading from v1.1.0
- Requires Python >= 3.10
- Pileups that use
extra_sum_funcs(e.g. per-snippet TAD scores) over several
regions, and domain score / local enrichment withrescale_flank != 1, were wrong
before and now give different (correct) values (#146, #161) - Seeded shifted controls give different, but now reproducible, values than v1.1.0;
trans shifted controls shift both anchors - With expected and
ooe=False, expected is averaged only over valid pixels - Groups/stripes from pileups of bed pairs may come out in a different row order
- All other pileup results are the same as v1.1.0 (checked to ~1e-14 for 12
configurations: bed, bedpe, local, rescaled, trans, by strand/distance, groupby,
with/without expected)
Performance
- Pairwise combinations of bed features are now generated with a vectorised search
instead of a Python loop over all offsets genome-wide. Withmaxdistthis is
10-100x faster (e.g. 182 s -> 2 s for loop anchors on the Scc1 test cooler); results
are unchanged. Pairs are produced in bounded chunks, so memory stays bounded
withoutmaxdist. Trans combinations are also vectorised. - Faster accumulation of snippets (in-place sums; stripes appended instead of copied)
Bug fixes
extra_sum_funcs(e.g. per-snippet TAD scores): summing pileups across regions
discarded all but one region's data; regions without valid snippets raised
AssertionError: ... not in dict2(#146)- Domain score / local enrichment were wrong or raised
AssertionErrorfor
rescale_flank != 1(#161). Results forrescale_flank=1are unchanged divide_pups/dividepups.py/plotpup.py --divide_pupscan now divide pileups
with multiple groups, matching rows by group, distance band or orientation,
whichever matches (e.g. ++ over -- pileups split by distance) (#163); dividing
pileups with stripes no longer crashes; fixed theclrsannotation and the
default output name- Shifted controls are now reproducible with
seedregardless ofnproc
(each region gets its own random stream). Note: seeded controls differ from v1.1.0 - Trans shifted controls now fetch the snippet at the shifted coordinates of both anchors
nproc=0/-p 0now uses all cores (it ran serially, or crashed withcoverage_norm)nproc > 1no longer crashes on macOS/Windows with multiprocessing_logging >= 0.4coverage_normworks with cooltools >= 0.6 (coverage computation crashed)- With expected and
ooe=False, expected values are only accumulated over pixels
where the observed data is valid (not bad bins or ignored diagonals) by_distanceaccepts a list of edges, as documentedCoordCreator.bedpe2bed(ends=False, how="center")crashed- Pileup files: saving is atomic, so an interrupted save no longer leaves a file that
fails withobject 'attrs' doesn't exist(#166); such files load with a warning.
Chromosome names in stored coordinates are no longer truncated to 13 characters plotpup.py --queryalways crashed;--col_order/--row_orderaccept commas;
--input_pupsis requiredplot()with default arguments raisedKeyError: 'score'; a custom score column
name is now usedcoolpup.pydetects bed/bedpe correctly for.gzand other extensions; INFO-level
logging (-l INFO) is now printed- One warning per pileup reports how many regions of interest were skipped for
extending beyond the chromosome/region boundaries (per-region counts at DEBUG level) plot_stripesno longer triggers pandas' "Calling int on a single element Series"
FutureWarning- Removed the unused top-level
__init__.py: with pytest it made the repository root
importable ascoolpuppy, so tests withnproc > 1hung on macOS/Windows (spawn)
Documentation
- The API and CLI walkthroughs show how to divide pileups with several groups
(CTCF pileups by orientation, for sites 0.1-1 Mb apart over sites >1 Mb apart)
withdivide_pups/dividepups.py. All example notebooks were rerun;
the TAD pileup inTAD_score.ipynbnow averages all 938 TADs instead of only the
238 in the first chromosome arm (#146)
Compatibility
- Requires Python >= 3.10 (CI now tests 3.10-3.12) and numpy >= 1.17. Cython is no
longer needed to install coolpuppy - Removed the dependency on the unmaintained
h5sparse(it importspkg_resources);
the file format is unchanged and files remain readable by older versions - Compatible with pandas 3 and numpy 2, and with matplotlib >= 3.9 (
cm.get_cmap
removed;plotpupalso works around cooltools <= 0.7.1 importing the removed
cm.register_cmap) and pandas Copy-on-Write (stripe plots silently ignored
assignments). Pileups with expected no longer use cooltools'ExpectedSnipper,
which fails with pandas 3. Removed the pandas/matplotlib upper pins. Distance band
labels are plain numbers with numpy 2 (notnp.int64(...))
Full changelog: v1.1.0...v1.2.0