trevismd / statannotations

add statistical significance annotations on seaborn plots. Further development of statannot, with bugfixes, new features, and a different API.
Other
624 stars 67 forks source link

Override annotation when value is no longer significant after correction #31

Closed trevismd closed 2 years ago

trevismd commented 2 years ago

As discussed in #30, some might find useful to have the annotation "ns" plotted (instead of "* (ns)", "** (ns)"...) when a p-value is no longer to be considered significant when using a multiple comparisons correction.

This PR introduces a "correction_format" parameter for Annotator.configure(), enabling the behavior above using correction_format="replace".

It is also possible to define a custom formatting string for these cases such as correction_format="({star})", to obtain "(*)", "(**)", etc.

Note that this will not change the appearance in the printed output (obtained with verbose).

codecov[bot] commented 2 years ago

Codecov Report

Merging #31 (1d30a0d) into dev (c4704fb) will decrease coverage by 0.01%. The diff coverage is 97.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev      #31      +/-   ##
==========================================
- Coverage   96.96%   96.94%   -0.02%     
==========================================
  Files          29       29              
  Lines        1845     1867      +22     
==========================================
+ Hits         1789     1810      +21     
- Misses         56       57       +1     
Impacted Files Coverage Δ
statannotations/Annotator.py 91.60% <ø> (ø)
tests/test_pvalue_format.py 100.00% <ø> (ø)
statannotations/PValueFormat.py 96.26% <94.73%> (-0.37%) :arrow_down:
statannotations/_version.py 100.00% <100.00%> (ø)
statannotations/format_annotations.py 100.00% <100.00%> (ø)
statannotations/stats/StatResult.py 91.48% <100.00%> (+0.79%) :arrow_up:
tests/test_integrate_format_multiple.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c4704fb...1d30a0d. Read the comment docs.