Skip to content

Commit 63efef3

Browse files
authored
Merge pull request #213 from ACCLAB/v2025.10.20
v2025.10.20 Bingka Various changes including: - whorlmaps - updated slopegraph aesthetics with added group summaries - updated mini meta delta calculation - extra custom_palette functionality
2 parents 5d83bb1 + 3b27429 commit 63efef3

File tree

332 files changed

+7420
-4159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

332 files changed

+7420
-4159
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
<!-- do not remove -->
44

5+
## v2025.10.20
6+
7+
### New Features
8+
1. **Whorlmap Visualization**: Introducing a new way to visualize effect sizes from multiple comparisons in a grid of whorled square cells. This design condenses information from full bootstrap distributions of an array of contrast objects into a compact visual representation. It optimizes visual real estate by presenting a clear impression of the whole dataset at a glance while retaining nuanced distributional information for further scrutiny. Whorlmaps are a space-efficient alternative to stacked forest plots when working with multi-dimensional DABEST objects from large scale experiments.
9+
10+
2. **Slopegraphs have a new look**: Slopegraphs for paired continuous data now show summary statistics for each group. By default, a thick trend line connects group means, with vertical bars indicating standard deviation. Users can choose the summary type via the `group_summaries` argument in .plot() — options include `'mean_sd'`, `'median_quartiles'`, or `None`. Appearance can be customized using `group_summaries_kwargs`. See the group summaries section in the Plot Aesthetics tutorial for more details.
11+
12+
3. **Fixed Mini-meta Weighted Delta Calculation**: The weighted delta in mini-meta plots has been updated to ensure accurate calculation and reporting of the weighted delta.
13+
14+
4. **Expanded custom_palette functionality**:
15+
- **Barplots (unpaired, proportional)**: The custom_palette dict can now take 0 and 1 as keys to color the filled and unfilled portions of the plots. See the custom palette section in the Plot Aesthetics tutorial for more details.
16+
17+
- **Slopegraphs (paired, non proportional)**: The custom_palette can now be used to color the contrast bars and effect-size curves. See the custom palette section in the Plot Aesthetics tutorial for more details.
18+
19+
20+
521
## v2025.03.27
622

723
### New Features

README.md

Lines changed: 60 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -14,139 +14,66 @@ citation](https://zenodo.org/badge/DOI/10.1038/s41592-019-0470-3.svg)](https://r
1414

1515
## Recent Version Update
1616

17-
We are proud to announce **DABEST Version Dadar (v2025.03.27)** This new
18-
version of the DABEST Python library includes several new features and
19-
performance improvements. It’s a big one!
20-
21-
1. **Python 3.13 Support**: DABEST now supports Python 3.10—3.13.
22-
23-
2. **Horizontal Plots**: Users can now create horizontal layout plots,
24-
providing compact data visualization. This can be achieved by
25-
setting `horizontal=True` in the `.plot()` method. See the
26-
[Horizontal Plots
27-
tutorial](https://acclab.github.io/DABEST-python/tutorials/08-horizontal_plot.html)
28-
for more details.
29-
30-
3. **Forest Plots**: Forest plots provide a simple and intuitive way to
31-
visualize many delta-delta (or delta *g*), mini-meta, or regular
32-
delta effect sizes at once from multiple different dabest objects
33-
without presenting the raw data. See the [Forest Plots
34-
tutorial](https://acclab.github.io/DABEST-python/tutorials/07-forest_plot.html)
35-
for more details.
36-
37-
4. **Gridkey**: Users can now represent experimental labels in a
38-
‘gridkey’ table. This can be accessed with the `gridkey` parameter
39-
in the `.plot()` method. See the gridkey section in the [Plot
40-
Aesthetics
41-
tutorial](https://acclab.github.io/DABEST-python/tutorials/09-plot_aesthetics.html)
42-
for more details.
43-
44-
5. **Other Visualization Improvements**:
45-
46-
- **Comparing means and effect sizes**: The estimation plots now
47-
include three types of customizable visual features to enhance
48-
contextualization and comparison of means and effect sizes:
49-
50-
- **Bars for the mean of the observed values (`raw_bars`)**:
51-
Colored rectangles that extend from the zero line to the mean of
52-
each group’s raw data. These bars visually highlight the central
53-
tendency of the raw data.
54-
55-
- **Bars for effect size/s (`contrast_bars`)**: Similar to raw
56-
bars, these highlight the effect-size difference between two
57-
groups (typically test and control) in the contrast axis. They
58-
provide a visual representation of the differences between
59-
groups.
60-
61-
- **Summary bands (`reference_band`)**: An optional band or ribbon
62-
that can be added to emphasize a specific effect size’s
63-
confidence interval that is used as a reference range across the
64-
entire contrast axis. Unlike raw and contrast bars, these span
65-
horizontally (or vertically if `horizontal=True`) and are not
66-
displayed by default.
67-
68-
Raw and contrast bars are shown by default. Users can customize
69-
these bars and add summary bands as needed. For detailed
70-
customization instructions, please refer to the [Plot Aesthetics
71-
tutorial](https://acclab.github.io/DABEST-python/tutorials/09-plot_aesthetics.html).
72-
73-
- **Tighter spacing in delta-delta and mini-meta plots**: We have
74-
adjusted the spacing of delta-delta and mini-meta plots to reduce
75-
whitespace. The new format brings the overall effect size closer
76-
to the two-groups effect sizes. In addition, delta-delta plots now
77-
have a gap in the zero line to separate the delta-delta from the ∆
78-
effect sizes.
79-
80-
- **Delta-delta effect sizes for proportion plots**: In addition to
81-
continuous data, delta-delta plots now support binary data
82-
(proportions). This means that 2-way designs for binary outcomes
83-
can be analyzed with DABEST.
84-
85-
- **Proportion plots sample sizes**: The sample size of each binary
86-
option for each group can now be displayed. These can be toggled
87-
on/off via the `prop_sample_counts` parameter.
88-
89-
- **Effect size lines for paired plots**: Along with lines
90-
connecting paired observed values, the paired plots now also
91-
display lines linking the effect sizes within a group in the
92-
contrast axes. These lines can be toggled on/off via the
93-
`contrast_paired_lines` parameter.
94-
95-
- **Baseline error curves**: To represent the baseline/control group
96-
in the contrast axes, it is now possible to plot the baseline dot
97-
and the baseline error curve. The dot is shown by default, while
98-
the curve can be toggled on/off via the `show_baseline_ec`
99-
parameter. This dot helps make it clear where the baseline comes
100-
from i.e. the control minus itself. The baseline error curve can
101-
be used to show that the baseline itself is an estimate inferred
102-
from the observed values of the control data.
103-
104-
- **Delta text**: Effect-size deltas (e.g. mean differences) are now
105-
displayed as numerals next to their respective effect size. This
106-
can be toggled on/off via the `delta_text` parameter.
107-
108-
- **Empty circle color palette**: A new swarmplot color palette
109-
modification is available for unpaired plots via the
110-
`empty_circle` parameter in the `.plot()` method. This option
111-
modifies the two-group swarmplots to have empty circles for the
112-
control group and filled circles for the experimental group.
113-
114-
6. **Miscellaneous Improvements & Adjustments**
115-
116-
- **Numba for speed improvements**: We have added
117-
[Numba](https://numba.pydata.org/) to speed up the various
118-
calculations in DABEST. Precalculations will be performed during
119-
import, which will help speed up the subsequent loading and
120-
plotting of data.
121-
122-
- **Terminology/naming updates**: During the refactoring of the
123-
code, we have made several updates to the documentation and
124-
terminology to improve clarity and consistency. For example:
125-
126-
- Plot arguments have been adjusted to bring more clarity and
127-
consistency in naming. Arguments relating to the rawdata plot
128-
axis will now be typically referred to with `raw` while
129-
arguments relating to the contrast axis will be referred to with
130-
`contrast`. For example, `raw_label` replaces `swarm_label` and
131-
`bar_label`. The various kwargs relating to each different type
132-
of plot (e.g., `swarmplot_kwargs`) remain unchanged.
133-
134-
- The method to utilise the Delta *g* effect size is now via the
135-
.hedges_g.plot() method rather than creating a whole new Delta_g
136-
object as before. The functionality remains the same, it plots
137-
hedges_g effect sizes and then the Delta *g* effect size
138-
alongside these (if a delta-delta experiment was loaded
139-
correctly).
140-
141-
- **Updated tutorial pages**: We have updated the tutorial pages to
142-
reflect the new features and changes. The tutorial pages are now
143-
more comprehensive and (hopefully!) more intuitive!
144-
145-
- **Results dataframe for delta-delta and mini-meta plots**: A
146-
results dataframe can now be extracted for both the delta-delta
147-
and mini-meta effect size data (similar to the results dataframe
148-
for the regular effect sizes). These can be found via the
149-
`.results` attribute of the `.delta_delta` or `.mini_meta` object.
17+
**✨ DABEST “Bingka” v2025.10.20 for Python is now released! ✨**
18+
19+
Dear DABEST users, The latest version of the DABEST Python library
20+
brings new visualizations, refined plots, and improved accuracy.
21+
22+
1. **Whorlmap 🌀: Compact visualization for multi-dimensional effects**
23+
24+
Introducing **Whorlmap**, a new way to visualize effect sizes from
25+
multiple comparisons in a compact, grid-based format.
26+
27+
Whorlmaps condense information from the full bootstrap distributions
28+
of many contrast objects into a **2D heatmap-style grid of “whorled”
29+
cells**. This provides an overview of the entire dataset while
30+
preserving the underlying distributional detail.
31+
32+
They are especially useful for large-scale or multi-condition
33+
experiments, serving as a **space-efficient alternative to stacked
34+
forest plots**.
35+
36+
You can generate a Whorlmap directly from multi-dimensional DABEST
37+
objects using the `.whorlmap()` method. See the [Whorlmap
38+
tutorial](10-whorlmap.html) for more details.
39+
40+
2. **Slopegraphs 📈: Enhanced summaries for paired data**
41+
42+
Slopegraphs for paired continuous data now display **group summary
43+
statistics**.
44+
45+
- By default, a thick trend line connects group means, with vertical
46+
bars showing standard deviation.
47+
48+
- Choose the summary type via the group_summaries argument in
49+
`.plot()` — options include `'mean_sd'`, `'median_quartiles'`, or
50+
`None`.
51+
52+
- Customize appearance with `group_summaries_kwargs`.
53+
54+
See the Group Summaries section in the [Plot Aesthetics
55+
tutorial](08-plot_aesthetics.html) for more details.
56+
57+
3. **Mini-meta Weighted Delta Fix 🧮**
58+
59+
The weighted delta calculation in mini-meta plots has been updated
60+
for **greater accuracy and consistency**.
61+
62+
4. **Expanded custom_palette functionality 🎨**
63+
64+
- **Barplots (unpaired, proportional):** `custom_palette` can now
65+
take `1` and `0` as dictionary keys to color the filled and
66+
unfilled portions of the plot.
67+
68+
- **Slopegraphs (paired, non-proportional):** `custom_palette` can
69+
now color contrast bars and effect-size curves.
70+
71+
See the Custom Palette section in the [Plot Aesthetics
72+
tutorial](08-plot_aesthetics.html) for examples.
73+
74+
Thank you for your continued support!
75+
76+
*The DABEST Development Team*
15077

15178
## Contents
15279

dabest/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
if not _NUMBA_COMPILED:
1313
precompile_all()
1414

15-
__version__ = "2025.03.27"
15+
__version__ = "2025.10.20"

dabest/_delta_objects.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,17 +435,19 @@ def __init__(self, effectsizedataframe, permutation_count,
435435
self.__control_N,
436436
self.__test_var,
437437
self.__test_N)
438+
439+
self.__bootstraps_variance = ci2g.calculate_bootstraps_var(self.__bootstraps)
438440

439441
# Compute the weighted average mean differences of the bootstrap data
440442
# using the pooled group variances of the raw data as the inverse of
441443
# weights
442444
self.__bootstraps_weighted_delta = ci2g.calculate_weighted_delta(
443-
self.__group_var,
445+
self.__bootstraps_variance,
444446
self.__bootstraps)
445447

446448
# Compute the weighted average mean difference based on the raw data
447449
self.__difference = es.weighted_delta(np.array(self.__effsizedf["difference"]),
448-
self.__group_var)
450+
self.__bootstraps_variance)
449451

450452
sorted_weighted_deltas = npsort(self.__bootstraps_weighted_delta)
451453

@@ -753,6 +755,14 @@ def group_var(self):
753755
in order.
754756
'''
755757
return self.__group_var
758+
759+
@property
760+
def bootstraps_var(self):
761+
'''
762+
Return the variances of each bootstrapped mean difference distribution
763+
in order.
764+
'''
765+
return self.__bootstraps_variance
756766

757767

758768
@property

dabest/_effsize_objects.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ def plot(
11431143
face_color=None,
11441144

11451145
raw_desat=0.5, # swarm_desat=0.5, OLD # bar_desat=0.5, OLD
1146-
contrast_desat=1, # halfviolin_desat=1, OLD
1146+
contrast_desat=1.0, # halfviolin_desat=1, OLD
11471147

11481148
raw_alpha=None, # NEW
11491149
contrast_alpha=0.8, # halfviolin_alpha=0.8, OLD
@@ -1478,7 +1478,8 @@ def plot(
14781478

14791479
if raw_alpha is None:
14801480
raw_alpha = (0.4 if self.is_proportional and self.is_paired
1481-
else 0.5 if self.is_paired
1481+
else 0.5 if self.is_paired and (color_col is not None or self.__delta2)
1482+
else 0.2 if self.is_paired and color_col is None
14821483
else 1.0
14831484
)
14841485

dabest/_modidx.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
'dabest/_stats_tools/confint_2group_diff.py'),
2828
'dabest._stats_tools.confint_2group_diff.bootstrap_indices': ( 'API/confint_2group_diff.html#bootstrap_indices',
2929
'dabest/_stats_tools/confint_2group_diff.py'),
30+
'dabest._stats_tools.confint_2group_diff.calculate_bootstraps_var': ( 'API/confint_2group_diff.html#calculate_bootstraps_var',
31+
'dabest/_stats_tools/confint_2group_diff.py'),
3032
'dabest._stats_tools.confint_2group_diff.calculate_group_var': ( 'API/confint_2group_diff.html#calculate_group_var',
3133
'dabest/_stats_tools/confint_2group_diff.py'),
3234
'dabest._stats_tools.confint_2group_diff.calculate_weighted_delta': ( 'API/confint_2group_diff.html#calculate_weighted_delta',
@@ -107,6 +109,36 @@
107109
'dabest/misc_tools.py'),
108110
'dabest.misc_tools.show_legend': ('API/misc_tools.html#show_legend', 'dabest/misc_tools.py'),
109111
'dabest.misc_tools.unpack_and_add': ('API/misc_tools.html#unpack_and_add', 'dabest/misc_tools.py')},
112+
'dabest.multi': { 'dabest.multi.MultiContrast': ('API/multi.html#multicontrast', 'dabest/multi.py'),
113+
'dabest.multi.MultiContrast.__init__': ('API/multi.html#multicontrast.__init__', 'dabest/multi.py'),
114+
'dabest.multi.MultiContrast.__repr__': ('API/multi.html#multicontrast.__repr__', 'dabest/multi.py'),
115+
'dabest.multi.MultiContrast._extract_data': ('API/multi.html#multicontrast._extract_data', 'dabest/multi.py'),
116+
'dabest.multi.MultiContrast._extract_single_contrast': ( 'API/multi.html#multicontrast._extract_single_contrast',
117+
'dabest/multi.py'),
118+
'dabest.multi.MultiContrast._validate_and_parse_structure': ( 'API/multi.html#multicontrast._validate_and_parse_structure',
119+
'dabest/multi.py'),
120+
'dabest.multi.MultiContrast._validate_ci_type': ( 'API/multi.html#multicontrast._validate_ci_type',
121+
'dabest/multi.py'),
122+
'dabest.multi.MultiContrast._validate_contrast_consistency': ( 'API/multi.html#multicontrast._validate_contrast_consistency',
123+
'dabest/multi.py'),
124+
'dabest.multi.MultiContrast._validate_effect_size': ( 'API/multi.html#multicontrast._validate_effect_size',
125+
'dabest/multi.py'),
126+
'dabest.multi.MultiContrast._validate_effect_size_compatibility': ( 'API/multi.html#multicontrast._validate_effect_size_compatibility',
127+
'dabest/multi.py'),
128+
'dabest.multi.MultiContrast._validate_individual_dabest_obj': ( 'API/multi.html#multicontrast._validate_individual_dabest_obj',
129+
'dabest/multi.py'),
130+
'dabest.multi.MultiContrast.bootstraps': ('API/multi.html#multicontrast.bootstraps', 'dabest/multi.py'),
131+
'dabest.multi.MultiContrast.confidence_intervals': ( 'API/multi.html#multicontrast.confidence_intervals',
132+
'dabest/multi.py'),
133+
'dabest.multi.MultiContrast.effect_sizes': ('API/multi.html#multicontrast.effect_sizes', 'dabest/multi.py'),
134+
'dabest.multi.MultiContrast.forest_plot': ('API/multi.html#multicontrast.forest_plot', 'dabest/multi.py'),
135+
'dabest.multi.MultiContrast.get_bootstrap_by_position': ( 'API/multi.html#multicontrast.get_bootstrap_by_position',
136+
'dabest/multi.py'),
137+
'dabest.multi.MultiContrast.whorlmap': ('API/multi.html#multicontrast.whorlmap', 'dabest/multi.py'),
138+
'dabest.multi._sample_bootstrap': ('API/multi.html#_sample_bootstrap', 'dabest/multi.py'),
139+
'dabest.multi._spiralize': ('API/multi.html#_spiralize', 'dabest/multi.py'),
140+
'dabest.multi.combine': ('API/multi.html#combine', 'dabest/multi.py'),
141+
'dabest.multi.whorlmap': ('API/multi.html#whorlmap', 'dabest/multi.py')},
110142
'dabest.plot_tools': { 'dabest.plot_tools.SwarmPlot': ('API/plot_tools.html#swarmplot', 'dabest/plot_tools.py'),
111143
'dabest.plot_tools.SwarmPlot.__init__': ( 'API/plot_tools.html#swarmplot.__init__',
112144
'dabest/plot_tools.py'),

0 commit comments

Comments
 (0)