staplot 0.1.0__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. {staplot-0.1.0/staplot.egg-info → staplot-0.1.2}/PKG-INFO +34 -3
  2. staplot-0.1.2/README.md +89 -0
  3. {staplot-0.1.0 → staplot-0.1.2}/pyproject.toml +4 -2
  4. staplot-0.1.2/staplot/__init__.py +1 -0
  5. staplot-0.1.2/staplot/api.py +2547 -0
  6. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/__init__.py +2 -1
  7. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/bar.py +10 -5
  8. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/before_after.py +15 -4
  9. staplot-0.1.2/staplot/plots/box.py +236 -0
  10. staplot-0.1.2/staplot/plots/extras.py +293 -0
  11. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/grouped_bar.py +13 -9
  12. staplot-0.1.2/staplot/plots/layers.py +155 -0
  13. staplot-0.1.2/staplot/plots/lines.py +76 -0
  14. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/scatter.py +10 -6
  15. staplot-0.1.2/staplot/plots/significance.py +173 -0
  16. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/styles.py +40 -0
  17. staplot-0.1.2/staplot/stats/nested.py +85 -0
  18. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/graph_options_dialog.py +1 -1
  19. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/main_window.py +47 -35
  20. staplot-0.1.2/staplot/ui/plot_editor.py +1037 -0
  21. {staplot-0.1.0 → staplot-0.1.2/staplot.egg-info}/PKG-INFO +34 -3
  22. {staplot-0.1.0 → staplot-0.1.2}/staplot.egg-info/SOURCES.txt +17 -0
  23. {staplot-0.1.0 → staplot-0.1.2}/staplot.egg-info/entry_points.txt +1 -0
  24. {staplot-0.1.0 → staplot-0.1.2}/staplot.egg-info/requires.txt +4 -0
  25. staplot-0.1.2/tests/test_bracket_layout_20261119.py +58 -0
  26. staplot-0.1.2/tests/test_layers_y2_20261120.py +90 -0
  27. staplot-0.1.2/tests/test_missing_values.py +39 -0
  28. staplot-0.1.2/tests/test_more_kinds_20261120.py +94 -0
  29. staplot-0.1.2/tests/test_plot_code.py +94 -0
  30. staplot-0.1.2/tests/test_plot_editor.py +101 -0
  31. staplot-0.1.2/tests/test_plot_editor_layers_20261120.py +49 -0
  32. staplot-0.1.2/tests/test_plot_layout.py +399 -0
  33. staplot-0.1.2/tests/test_read_table.py +73 -0
  34. staplot-0.1.2/tests/test_stats_text_default.py +58 -0
  35. staplot-0.1.2/tests/test_subjects_20261120.py +37 -0
  36. staplot-0.1.2/tests/test_table_import.py +82 -0
  37. staplot-0.1.0/README.md +0 -61
  38. staplot-0.1.0/staplot/__init__.py +0 -1
  39. staplot-0.1.0/staplot/api.py +0 -441
  40. staplot-0.1.0/staplot/plots/box.py +0 -95
  41. staplot-0.1.0/staplot/plots/significance.py +0 -94
  42. {staplot-0.1.0 → staplot-0.1.2}/LICENSE +0 -0
  43. {staplot-0.1.0 → staplot-0.1.2}/setup.cfg +0 -0
  44. {staplot-0.1.0 → staplot-0.1.2}/staplot/main.py +0 -0
  45. {staplot-0.1.0 → staplot-0.1.2}/staplot/models/__init__.py +0 -0
  46. {staplot-0.1.0 → staplot-0.1.2}/staplot/models/project.py +0 -0
  47. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/bland_altman.py +0 -0
  48. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/distribution_plot.py +0 -0
  49. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/heatmap.py +0 -0
  50. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/histogram.py +0 -0
  51. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/qq.py +0 -0
  52. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/residuals.py +0 -0
  53. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/roc_plot.py +0 -0
  54. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/survival.py +0 -0
  55. {staplot-0.1.0 → staplot-0.1.2}/staplot/plots/volcano.py +0 -0
  56. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/__init__.py +0 -0
  57. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/anova.py +0 -0
  58. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/chi_square.py +0 -0
  59. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/correlation.py +0 -0
  60. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/curve_fit.py +0 -0
  61. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/descriptive.py +0 -0
  62. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/distribution.py +0 -0
  63. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/multiple_comparisons.py +0 -0
  64. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/normality.py +0 -0
  65. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/outliers.py +0 -0
  66. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/power.py +0 -0
  67. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/regression.py +0 -0
  68. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/repeated_measures.py +0 -0
  69. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/roc.py +0 -0
  70. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/tests.py +0 -0
  71. {staplot-0.1.0 → staplot-0.1.2}/staplot/stats/two_way_anova.py +0 -0
  72. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/__init__.py +0 -0
  73. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/analysis_dialog.py +0 -0
  74. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/axis_dialog.py +0 -0
  75. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/computed_column_dialog.py +0 -0
  76. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/contingency_table_widget.py +0 -0
  77. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/data_table_widget.py +0 -0
  78. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/distribution_inspector.py +0 -0
  79. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/figure_layout_widget.py +0 -0
  80. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/graph_gallery.py +0 -0
  81. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/grouped_table_widget.py +0 -0
  82. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/layout_dialog.py +0 -0
  83. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/multiple_comparisons_dialog.py +0 -0
  84. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/navigator.py +0 -0
  85. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/plot_canvas.py +0 -0
  86. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/power_dialog.py +0 -0
  87. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/report_dialog.py +0 -0
  88. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/reshape_dialog.py +0 -0
  89. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/results_widget.py +0 -0
  90. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/standard_curve_dialog.py +0 -0
  91. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/test_wizard.py +0 -0
  92. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/transform_dialog.py +0 -0
  93. {staplot-0.1.0 → staplot-0.1.2}/staplot/ui/undo_commands.py +0 -0
  94. {staplot-0.1.0 → staplot-0.1.2}/staplot.egg-info/dependency_links.txt +0 -0
  95. {staplot-0.1.0 → staplot-0.1.2}/staplot.egg-info/top_level.txt +0 -0
  96. {staplot-0.1.0 → staplot-0.1.2}/tests/test_chatgpt_regressions.py +0 -0
  97. {staplot-0.1.0 → staplot-0.1.2}/tests/test_review_fixes.py +0 -0
  98. {staplot-0.1.0 → staplot-0.1.2}/tests/test_styles_scoped.py +0 -0
  99. {staplot-0.1.0 → staplot-0.1.2}/tests/test_tick_labels.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: staplot
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Statistical analysis and publication-quality plotting — a GraphPad Prism replacement
5
5
  Author: Benoit Aigouy
6
6
  License: BSD-2-Clause
@@ -20,6 +20,9 @@ Requires-Dist: statsmodels
20
20
  Requires-Dist: pandas
21
21
  Provides-Extra: excel
22
22
  Requires-Dist: openpyxl; extra == "excel"
23
+ Requires-Dist: xlrd; extra == "excel"
24
+ Provides-Extra: icons
25
+ Requires-Dist: qtawesome; extra == "icons"
23
26
  Dynamic: license-file
24
27
 
25
28
  # staplot
@@ -35,7 +38,7 @@ open-source alternative to GraphPad Prism, with a desktop app and a small Python
35
38
  repeated measures, Kruskal-Wallis, post-hoc tests (Tukey, Dunn, ...), chi-square,
36
39
  correlation, linear and nonlinear regression (curve fitting), normality tests,
37
40
  outliers, ROC, survival, power analysis.
38
- - **Plots:** bar, box, violin, scatter, grouped bar, before/after, histogram, QQ,
41
+ - **Plots:** bar, box, violin (whole or half: `violin_side="left"`), split violin (`kind="split_violin"`: two conditions as the two halves, each pair tested), scatter, grouped bar, before/after, histogram, QQ,
39
42
  residuals, Bland-Altman, heatmap, volcano, ROC and survival curves, with
40
43
  significance brackets added automatically.
41
44
  - A test wizard that picks the right test for your data and explains why.
@@ -43,7 +46,7 @@ open-source alternative to GraphPad Prism, with a desktop app and a small Python
43
46
  ## Install
44
47
 
45
48
  ```
46
- pip install staplot # add [excel] for .xlsx import
49
+ pip install staplot # add [excel] for .xlsx / .xls import
47
50
  ```
48
51
 
49
52
  Python 3.10 or newer.
@@ -56,6 +59,28 @@ Desktop app:
56
59
  staplot
57
60
  ```
58
61
 
62
+ Plot editor: a table beside its plot; click any part of the plot (a group, the
63
+ points, the brackets, a title, an axis label, the tick labels, the legend, the plot
64
+ area) to change its colour, text, size or font; edit the table's cells and the plot
65
+ follows. Toolbar *Edit a plot* in the app, or:
66
+
67
+ ```
68
+ python -m staplot.ui.plot_editor counts.csv box
69
+ ```
70
+
71
+ From Python: `staplot.ui.plot_editor.PlotEditor(path, kind, kwargs)`; after OK,
72
+ `kwargs()` / `changed_kwargs()` are `api.plot`'s arguments and `text_parts()` the size
73
+ and font per part of the text. PyFigures opens it on a double-click on a data plot.
74
+ Icons come from `qtawesome` when it is installed (optional).
75
+
76
+ Beyond the basic kinds, `api.plot` takes `layers` (mean / median lines, mean ± error over
77
+ the groups), `y2` (a measure on a right-hand axis), `invert_y` / `invert_x`, `ybreak`
78
+ (a broken y axis), `y_step` / `y_format` / `log_base`, `error_side="up"`, and the kinds
79
+ `stacked` (`percent`), `dose_response` (4-parameter logistic fit, EC50), `histogram`,
80
+ `heatmap`. `api.table_from_csv(path, columns=[group, value], subject="animal")` makes the
81
+ animals the replicates (tests on their means, a SuperPlot, plus a mixed model).
82
+ `api.image_plot(path, pixel_size=0.2, unit="µm")` draws an image with its coordinate axes.
83
+
59
84
  From Python (no GUI needed, safe to run headless):
60
85
 
61
86
  ```python
@@ -67,6 +92,12 @@ fig, record = api.plot(table, kind="box") # matplotlib Figure with brackets
67
92
  fig.savefig("counts.pdf")
68
93
  ```
69
94
 
95
+ Tables can be CSV / TSV / TXT (separator and decimal comma detected) or Excel
96
+ sheets: `api.table_from_csv("book.xlsx::counts")` reads the sheet *counts* (by name
97
+ or number from 1; the first sheet without `::`). `api.read_table(path)` gives the
98
+ DataFrame, `api.list_sheets(path)` the sheet names, and
99
+ `api.csv_cleaning_report(path)` what was left out (empty cells, NA, typos).
100
+
70
101
  `auto_test` checks normality per group (Shapiro-Wilk) and chooses Welch's t-test or
71
102
  Mann-Whitney for two groups, and one-way ANOVA + Tukey or Kruskal-Wallis + Dunn for
72
103
  more.
@@ -0,0 +1,89 @@
1
+ # staplot
2
+
3
+ Statistical analysis and publication-quality plots for biologists: a free,
4
+ open-source alternative to GraphPad Prism, with a desktop app and a small Python API.
5
+
6
+ ## Features
7
+
8
+ - **Data tables** Prism-style (one column per group) or long format; CSV and Excel
9
+ import (semicolon / decimal-comma CSVs included).
10
+ - **Tests:** t-tests (Welch, paired), Mann-Whitney, Wilcoxon, one- and two-way ANOVA,
11
+ repeated measures, Kruskal-Wallis, post-hoc tests (Tukey, Dunn, ...), chi-square,
12
+ correlation, linear and nonlinear regression (curve fitting), normality tests,
13
+ outliers, ROC, survival, power analysis.
14
+ - **Plots:** bar, box, violin (whole or half: `violin_side="left"`), split violin (`kind="split_violin"`: two conditions as the two halves, each pair tested), scatter, grouped bar, before/after, histogram, QQ,
15
+ residuals, Bland-Altman, heatmap, volcano, ROC and survival curves, with
16
+ significance brackets added automatically.
17
+ - A test wizard that picks the right test for your data and explains why.
18
+
19
+ ## Install
20
+
21
+ ```
22
+ pip install staplot # add [excel] for .xlsx / .xls import
23
+ ```
24
+
25
+ Python 3.10 or newer.
26
+
27
+ ## Use
28
+
29
+ Desktop app:
30
+
31
+ ```
32
+ staplot
33
+ ```
34
+
35
+ Plot editor: a table beside its plot; click any part of the plot (a group, the
36
+ points, the brackets, a title, an axis label, the tick labels, the legend, the plot
37
+ area) to change its colour, text, size or font; edit the table's cells and the plot
38
+ follows. Toolbar *Edit a plot* in the app, or:
39
+
40
+ ```
41
+ python -m staplot.ui.plot_editor counts.csv box
42
+ ```
43
+
44
+ From Python: `staplot.ui.plot_editor.PlotEditor(path, kind, kwargs)`; after OK,
45
+ `kwargs()` / `changed_kwargs()` are `api.plot`'s arguments and `text_parts()` the size
46
+ and font per part of the text. PyFigures opens it on a double-click on a data plot.
47
+ Icons come from `qtawesome` when it is installed (optional).
48
+
49
+ Beyond the basic kinds, `api.plot` takes `layers` (mean / median lines, mean ± error over
50
+ the groups), `y2` (a measure on a right-hand axis), `invert_y` / `invert_x`, `ybreak`
51
+ (a broken y axis), `y_step` / `y_format` / `log_base`, `error_side="up"`, and the kinds
52
+ `stacked` (`percent`), `dose_response` (4-parameter logistic fit, EC50), `histogram`,
53
+ `heatmap`. `api.table_from_csv(path, columns=[group, value], subject="animal")` makes the
54
+ animals the replicates (tests on their means, a SuperPlot, plus a mixed model).
55
+ `api.image_plot(path, pixel_size=0.2, unit="µm")` draws an image with its coordinate axes.
56
+
57
+ From Python (no GUI needed, safe to run headless):
58
+
59
+ ```python
60
+ from staplot import api
61
+
62
+ table = api.table_from_csv("counts.csv") # one column per group
63
+ stats = api.auto_test(table) # picks the test, returns p-values
64
+ fig, record = api.plot(table, kind="box") # matplotlib Figure with brackets
65
+ fig.savefig("counts.pdf")
66
+ ```
67
+
68
+ Tables can be CSV / TSV / TXT (separator and decimal comma detected) or Excel
69
+ sheets: `api.table_from_csv("book.xlsx::counts")` reads the sheet *counts* (by name
70
+ or number from 1; the first sheet without `::`). `api.read_table(path)` gives the
71
+ DataFrame, `api.list_sheets(path)` the sheet names, and
72
+ `api.csv_cleaning_report(path)` what was left out (empty cells, NA, typos).
73
+
74
+ `auto_test` checks normality per group (Shapiro-Wilk) and chooses Welch's t-test or
75
+ Mann-Whitney for two groups, and one-way ANOVA + Tukey or Kruskal-Wallis + Dunn for
76
+ more.
77
+
78
+ staplot draws the plot panels of [PyFigures](https://github.com/baigouy/PyFigures).
79
+
80
+ ## Tests
81
+
82
+ ```
83
+ pip install pytest pytest-qt
84
+ python -m pytest tests
85
+ ```
86
+
87
+ ## License
88
+
89
+ BSD 2-Clause, see [LICENSE](LICENSE).
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "staplot"
7
- version = "0.1.0"
7
+ version = "0.1.2"
8
8
  description = "Statistical analysis and publication-quality plotting — a GraphPad Prism replacement"
9
9
  readme = "README.md"
10
10
  license = {text = "BSD-2-Clause"}
@@ -27,13 +27,15 @@ dependencies = [
27
27
  ]
28
28
 
29
29
  [project.optional-dependencies]
30
- excel = ["openpyxl"]
30
+ excel = ["openpyxl", "xlrd"]
31
+ icons = ["qtawesome"]
31
32
 
32
33
  [project.urls]
33
34
  Homepage = "https://github.com/baigouy/staplot"
34
35
 
35
36
  [project.scripts]
36
37
  staplot = "staplot.main:main"
38
+ staplot-editor = "staplot.ui.plot_editor:main"
37
39
 
38
40
  [tool.setuptools.packages.find]
39
41
  where = ["."]
@@ -0,0 +1 @@
1
+ __version__ = "0.1.2"