Skip to content

Commit

Permalink
[MERGE] v.0.6.0
Browse files Browse the repository at this point in the history
See changelog.md
  • Loading branch information
trevismd authored Oct 1, 2023
2 parents 2a5ebe1 + ff5ef39 commit 8f148c1
Show file tree
Hide file tree
Showing 36 changed files with 3,104 additions and 2,779 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, '3.10']
python-version: [3.6, 3.7, 3.8, 3.9, '3.10', 3.11]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ __pycache__
build
dist

statannot.egg-info/
statannot.egg-info/dependency_links.txt
statannot.egg-info/PKG-INFO
statannot.egg-info/requires.txt
statannot.egg-info/SOURCES.txt
statannot.egg-info/top_level.txt

# IDE files
.idea/
24 changes: 22 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
## v0.5
### v0.5.0
## v0.6
### v0.6.0
#### Features
- Add option to skip annotation of non-significant results
(PR [#95](https://github.com/trevismd/statannotations/pull/95) by
[sepro](https://github.com/sepro))

#### Fixes
- Fix keeping annotation with reduced ylim (
PR [#116](https://github.com/trevismd/statannotations/issues/116) by
[amkorb](https://github.com/amkorb))
- Fix pvalue legend (usually for NS range)

#### Additional testing and documentation:
- PR [#84](https://github.com/trevismd/statannotations/pull/84) by
[JasonMendoza2008 ](https://github.com/JasonMendoza2008)
- PR [#86](https://github.com/trevismd/statannotations/pull/86) by
[mbhall88](https://github.com/mbhall88)
- PR [#117](https://github.com/trevismd/statannotations/pull/117) by
[tathey1](https://github.com/tathey1)

## v0.5.0
- Add scipy's Brunner-Munzel test
- Fix applying statannotations for non-string group labels (Issue
[#65](https://github.com/trevismd/statannotations/issues/65))
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@ corresponding branch).
- Optionally, custom p-values can be given as input.
In this case, no statistical test is performed, but **corrections for
multiple testing can be applied.**
- It is also possible to hide non statistically significant annotations
- Any text can be used as annotation
- And various fixes (see
[CHANGELOG.md](https://github.com/trevismd/statannotations/blob/master/CHANGELOG.md)).

## Installation

From version 0.3.0 on, the package is distributed on PyPi.
The latest stable release (v0.5.0) can be downloaded and installed with:
The latest stable release (v0.6.0) can be downloaded and installed with:
```bash
pip install statannotations
```
Expand All @@ -90,9 +91,9 @@ pip install -r requirements.txt .

## Important note

**! Seaborn ≥ v0.12 is not officially supported, we know there are at least
some bugs. Issues can still be reported (and upvoted) in order to plan further
development to support these versions. Also see
**! Seaborn ≥ v0.12 and pandas 2 are not officially supported, we know there are
at least some bugs. Issues can still be reported (and upvoted) in order to plan
further development to support these versions. Also see
[discussion](https://github.com/trevismd/statannotations/discussions/81)**.

## Usage
Expand Down Expand Up @@ -142,7 +143,7 @@ annotator.apply_and_annotate()
+ numpy >= 1.12.1
+ seaborn >= 0.9,<0.12
+ matplotlib >= 2.2.2
+ pandas >= 0.23.0
+ pandas >= 0.23.0,<2.0.0
+ scipy >= 1.1.0
+ statsmodels (optional, for multiple testing corrections)

Expand Down Expand Up @@ -171,7 +172,7 @@ Bibtex
month = oct,
year = 2022,
publisher = {Zenodo},
version = {v0.5},
version = {v0.6},
doi = {10.5281/zenodo.7213391},
url = {https://doi.org/10.5281/zenodo.7213391}
}
Expand All @@ -181,7 +182,7 @@ Example
Florian Charlier, Marc Weber, Dariusz Izak, Emerson Harkin, Marcin Magnus,
Joseph Lalli, Louison Fresnais, Matt Chan, Nikolay Markov, Oren Amsalem,
Sebastian Proost, Agamemnon Krasoulis, getzze, & Stefan Repplinger. (2022).
Statannotations (v0.5). Zenodo. https://doi.org/10.5281/zenodo.7213391
Statannotations (v0.6). Zenodo. https://doi.org/10.5281/zenodo.7213391
```

## Contributing
Expand Down
Binary file modified docs/build/doctrees/modules.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/statannotations.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/statannotations.stats.doctree
Binary file not shown.
1 change: 1 addition & 0 deletions docs/build/html/_sources/modules.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ statannotations
:maxdepth: 4

statannotations
custom-test
2 changes: 2 additions & 0 deletions docs/build/html/_sources/statannotations.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ statannotations.Annotation module
:undoc-members:
:show-inheritance:

.. _Annotator_module:

statannotations.Annotator module
--------------------------------

Expand Down
2 changes: 2 additions & 0 deletions docs/build/html/_sources/statannotations.stats.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ statannotations.stats.StatResult module
:undoc-members:
:show-inheritance:

.. _StatTest_module:

statannotations.stats.StatTest module
-------------------------------------

Expand Down
6 changes: 6 additions & 0 deletions docs/build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ <h2 id="C">C</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="statannotations.stats.html#statannotations.stats.utils.check_alpha">check_alpha() (in module statannotations.stats.utils)</a>
</li>
<li><a href="statannotations.html#statannotations.Annotation.Annotation.check_data_stat_result">check_data_stat_result() (statannotations.Annotation.Annotation method)</a>
</li>
<li><a href="statannotations.html#statannotations.utils.check_is_in">check_is_in() (in module statannotations.utils)</a>
</li>
Expand Down Expand Up @@ -337,6 +339,10 @@ <h2 id="I">I</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="statannotations.html#statannotations.utils.InvalidParametersError">InvalidParametersError</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="statannotations.stats.html#statannotations.stats.StatResult.StatResult.is_significant">is_significant (statannotations.stats.StatResult.StatResult property)</a>
</li>
</ul></td>
</tr></table>
Expand Down
1 change: 1 addition & 0 deletions docs/build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ <h1>Welcome to statannotations’s documentation!<a class="headerlink" href="#we
<ul>
<li class="toctree-l1"><a class="reference internal" href="modules.html">statannotations</a><ul>
<li class="toctree-l2"><a class="reference internal" href="statannotations.html">statannotations package</a></li>
<li class="toctree-l2"><a class="reference internal" href="custom-test.html">Extending to other statistical functions</a></li>
</ul>
</li>
</ul>
Expand Down
2 changes: 2 additions & 0 deletions docs/build/html/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">statannotations</a><ul>
<li class="toctree-l2"><a class="reference internal" href="statannotations.html">statannotations package</a></li>
<li class="toctree-l2"><a class="reference internal" href="custom-test.html">Extending to other statistical functions</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -187,6 +188,7 @@ <h1>statannotations<a class="headerlink" href="#statannotations" title="Permalin
<li class="toctree-l2"><a class="reference internal" href="statannotations.html#module-statannotations">Module contents</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="custom-test.html">Extending to other statistical functions</a></li>
</ul>
</div>
</div>
Expand Down
Binary file modified docs/build/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/searchindex.js

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion docs/build/html/statannotations.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
<li class="toctree-l3"><a class="reference internal" href="#module-statannotations">Module contents</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="custom-test.html">Extending to other statistical functions</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -204,6 +205,11 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">statannotations.Annotation.</span></span><span class="sig-name descname"><span class="pre">Annotation</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">structs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span> </span><a class="reference internal" href="statannotations.stats.html#statannotations.stats.StatResult.StatResult" title="statannotations.stats.StatResult.StatResult"><span class="pre">statannotations.stats.StatResult.StatResult</span></a><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">formatter</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="#statannotations.PValueFormat.Formatter" title="statannotations.PValueFormat.Formatter"><span class="pre">statannotations.PValueFormat.Formatter</span></a><span class="p"><span class="pre">]</span></span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#statannotations.Annotation.Annotation" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Holds data, linked structs and an optional Formatter.</p>
<dl class="py method">
<dt class="sig sig-object py" id="statannotations.Annotation.Annotation.check_data_stat_result">
<span class="sig-name descname"><span class="pre">check_data_stat_result</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#statannotations.Annotation.Annotation.check_data_stat_result" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="statannotations.Annotation.Annotation.formatted_output">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">formatted_output</span></span><a class="headerlink" href="#statannotations.Annotation.Annotation.formatted_output" title="Permalink to this definition"></a></dt>
Expand All @@ -223,7 +229,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this

</div>
<div class="section" id="module-statannotations.Annotator">
<span id="statannotations-annotator-module"></span><h2>statannotations.Annotator module<a class="headerlink" href="#module-statannotations.Annotator" title="Permalink to this headline"></a></h2>
<span id="statannotations-annotator-module"></span><span id="annotator-module"></span><h2>statannotations.Annotator module<a class="headerlink" href="#module-statannotations.Annotator" title="Permalink to this headline"></a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="statannotations.Annotator.Annotator">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">statannotations.Annotator.</span></span><span class="sig-name descname"><span class="pre">Annotator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ax</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pairs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">plot</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'boxplot'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hue</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hue_order</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">engine</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'seaborn'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verbose</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">plot_params</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#statannotations.Annotator.Annotator" title="Permalink to this definition"></a></dt>
Expand Down Expand Up @@ -314,6 +320,11 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><cite>hide_non_significant</cite>: hide annotations for non-significant pair</dt><dd><p>comparisons</p>
</dd>
</dl>
</li>
<li><p><cite>line_height</cite>: in axes fraction coordinates</p></li>
<li><p><cite>line_offset</cite></p></li>
<li><p><cite>line_offset_to_group</cite></p></li>
Expand Down
10 changes: 9 additions & 1 deletion docs/build/html/statannotations.stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Extending to other statistical functions" href="custom-test.html" />
<link rel="prev" title="statannotations package" href="statannotations.html" />
</head>

Expand Down Expand Up @@ -103,6 +104,7 @@
<li class="toctree-l3"><a class="reference internal" href="statannotations.html#module-statannotations">Module contents</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="custom-test.html">Extending to other statistical functions</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -241,6 +243,11 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">formatted_output</span></span><a class="headerlink" href="#statannotations.stats.StatResult.StatResult.formatted_output" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="statannotations.stats.StatResult.StatResult.is_significant">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_significant</span></span><a class="headerlink" href="#statannotations.stats.StatResult.StatResult.is_significant" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="statannotations.stats.StatResult.StatResult.significance_suffix">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">significance_suffix</span></span><a class="headerlink" href="#statannotations.stats.StatResult.StatResult.significance_suffix" title="Permalink to this definition"></a></dt>
Expand All @@ -250,7 +257,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this

</div>
<div class="section" id="module-statannotations.stats.StatTest">
<span id="statannotations-stats-stattest-module"></span><h2>statannotations.stats.StatTest module<a class="headerlink" href="#module-statannotations.stats.StatTest" title="Permalink to this headline"></a></h2>
<span id="statannotations-stats-stattest-module"></span><span id="stattest-module"></span><h2>statannotations.stats.StatTest module<a class="headerlink" href="#module-statannotations.stats.StatTest" title="Permalink to this headline"></a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="statannotations.stats.StatTest.StatTest">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">statannotations.stats.StatTest.</span></span><span class="sig-name descname"><span class="pre">StatTest</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">Callable</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">test_long_name</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">test_short_name</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stat_name</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">str</span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">'Stat'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">alpha</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><span class="pre">float</span></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">0.05</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#statannotations.stats.StatTest.StatTest" title="Permalink to this definition"></a></dt>
Expand Down Expand Up @@ -357,6 +364,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="custom-test.html" class="btn btn-neutral float-right" title="Extending to other statistical functions" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="statannotations.html" class="btn btn-neutral float-left" title="statannotations package" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>

Expand Down
4 changes: 4 additions & 0 deletions docs/source/custom-test.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Extending to other statistical functions
****************************************

.. include:: ../../statannotations/stats/README.rst
1 change: 1 addition & 0 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ statannotations
:maxdepth: 4

statannotations
custom-test
2 changes: 2 additions & 0 deletions docs/source/statannotations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ statannotations.Annotation module
:undoc-members:
:show-inheritance:

.. _Annotator_module:

statannotations.Annotator module
--------------------------------

Expand Down
2 changes: 2 additions & 0 deletions docs/source/statannotations.stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ statannotations.stats.StatResult module
:undoc-members:
:show-inheritance:

.. _StatTest_module:

statannotations.stats.StatTest module
-------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
numpy>=1.12.1
seaborn>=0.9.0,<0.12
matplotlib>=2.2.2
pandas>=0.23.0
pandas>=0.23.0,<2.0.0
scipy>=1.1.0
statsmodels
packaging
packaging
8 changes: 8 additions & 0 deletions statannotations/Annotation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
from typing import Union

from statannotations.PValueFormat import Formatter
Expand Down Expand Up @@ -43,3 +44,10 @@ def print_labels_and_content(self, sep=" vs. "):
for struct in self.structs)

print(f"{labels_string}: {self.formatted_output}")

def check_data_stat_result(self):
if not isinstance(self.data, StatResult):
warnings.warn("Annotation data has incorrect class." +
"Should be StatResult. Cannot annotate current pair.")
return False
return True
Loading

0 comments on commit 8f148c1

Please sign in to comment.