From 6c69c8e1a663d17a405c6e7471355838deb809a8 Mon Sep 17 00:00:00 2001 From: Runpeng Luo Date: Thu, 12 Nov 2026 00:48:34 -0500 Subject: [PATCH] 0.1.1b3: cn_palette option with a cnamaste (a, b) palette - New "cnamaste" palette for (a, b) states, from cnamaste.palette.COPY_STATES: hue by minor-allele fraction, darker for more copies. The existing palette is named "hatchet" and stays the default. - cn_palette= on get_cn_cmap, get_mixcn_cmap and plot_cnv_profile (passed on to its key); the figure helpers forward it through profile_kwargs. - CN_PALETTES lists the names, for an argparse choices; an unknown name raises ValueError. - The key's overflow box is labelled from the palette: >7 under hatchet, >6 under cnamaste. - examples/plot_gallery.py takes --cn_palette {hatchet,cnamaste} and --outdir. - Version 0.1.1b3. --- CHANGELOG.md | 8 ++++ README.md | 5 +++ VERSION | 2 +- examples/plot_gallery.py | 30 ++++++++++++--- src/cnplot/__init__.py | 2 + src/cnplot/cnplot_colormap.py | 70 ++++++++++++++++++++++++++++++----- src/cnplot/cnplot_intcnp.py | 20 +++++++--- tests/test_intcnp.py | 19 +++++++++- tests/test_utils_colormap.py | 36 ++++++++++++++++++ 9 files changed, 170 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee6c9fc..5957c77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ ## Unreleased ### cnplot package +- A second (a, b) state palette, `"cnamaste"` (`cnamaste.palette.COPY_STATES`: hue by + minor-allele fraction, darker for more copies), next to the default, now named + `"hatchet"`. Picked with `cn_palette=` on `get_cn_cmap`, `get_mixcn_cmap` and + `plot_cnv_profile` (which passes it to its key); `CN_PALETTES` lists the names, for an + argparse `choices`. States a palette does not list take the default color, and the + key's trailing box is labelled from the palette: `>7` under `"hatchet"`, `>6` under + `"cnamaste"`. An unknown name raises `ValueError`. `examples/plot_gallery.py` takes + `--cn_palette {hatchet,cnamaste}` and `--outdir`. - Clone names are set in the regular weight: the clone labels beside the integer-CN profile and the `