prsmfile 0.1.0__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.
- prsmfile-0.1.0/CHANGELOG.md +22 -0
- prsmfile-0.1.0/CITATION.cff +17 -0
- prsmfile-0.1.0/LICENSE +21 -0
- prsmfile-0.1.0/MANIFEST.in +10 -0
- prsmfile-0.1.0/PKG-INFO +217 -0
- prsmfile-0.1.0/README.md +193 -0
- prsmfile-0.1.0/SECURITY.md +5 -0
- prsmfile-0.1.0/docs/format.md +625 -0
- prsmfile-0.1.0/docs/readers.md +43 -0
- prsmfile-0.1.0/examples/README.md +34 -0
- prsmfile-0.1.0/examples/example.prism +0 -0
- prsmfile-0.1.0/pyproject.toml +47 -0
- prsmfile-0.1.0/scripts/fetch_corpus.py +68 -0
- prsmfile-0.1.0/scripts/make_example.py +487 -0
- prsmfile-0.1.0/setup.cfg +4 -0
- prsmfile-0.1.0/src/prsmfile/__init__.py +15 -0
- prsmfile-0.1.0/src/prsmfile/__main__.py +5 -0
- prsmfile-0.1.0/src/prsmfile/archive.py +341 -0
- prsmfile-0.1.0/src/prsmfile/cli.py +146 -0
- prsmfile-0.1.0/src/prsmfile/errors.py +5 -0
- prsmfile-0.1.0/src/prsmfile/py.typed +0 -0
- prsmfile-0.1.0/src/prsmfile/readers/__init__.py +101 -0
- prsmfile-0.1.0/src/prsmfile/readers/auc.py +55 -0
- prsmfile-0.1.0/src/prsmfile/readers/common.py +236 -0
- prsmfile-0.1.0/src/prsmfile/readers/generic.py +78 -0
- prsmfile-0.1.0/src/prsmfile/readers/nonlinear.py +129 -0
- prsmfile-0.1.0/src/prsmfile/readers/oneway.py +128 -0
- prsmfile-0.1.0/src/prsmfile/readers/ttest.py +295 -0
- prsmfile-0.1.0/src/prsmfile/readers/twoway.py +154 -0
- prsmfile-0.1.0/src/prsmfile/render.py +245 -0
- prsmfile-0.1.0/src/prsmfile/report.py +78 -0
- prsmfile-0.1.0/src/prsmfile/tables.py +180 -0
- prsmfile-0.1.0/src/prsmfile/values.py +173 -0
- prsmfile-0.1.0/src/prsmfile.egg-info/PKG-INFO +217 -0
- prsmfile-0.1.0/src/prsmfile.egg-info/SOURCES.txt +56 -0
- prsmfile-0.1.0/src/prsmfile.egg-info/dependency_links.txt +1 -0
- prsmfile-0.1.0/src/prsmfile.egg-info/entry_points.txt +2 -0
- prsmfile-0.1.0/src/prsmfile.egg-info/requires.txt +3 -0
- prsmfile-0.1.0/src/prsmfile.egg-info/top_level.txt +1 -0
- prsmfile-0.1.0/tests/__init__.py +0 -0
- prsmfile-0.1.0/tests/builder.py +264 -0
- prsmfile-0.1.0/tests/corpus_manifest.json +812 -0
- prsmfile-0.1.0/tests/helpers.py +10 -0
- prsmfile-0.1.0/tests/test_archive.py +467 -0
- prsmfile-0.1.0/tests/test_auc.py +65 -0
- prsmfile-0.1.0/tests/test_builder.py +194 -0
- prsmfile-0.1.0/tests/test_cli.py +536 -0
- prsmfile-0.1.0/tests/test_corpus.py +284 -0
- prsmfile-0.1.0/tests/test_examples.py +124 -0
- prsmfile-0.1.0/tests/test_generic.py +316 -0
- prsmfile-0.1.0/tests/test_nonlinear.py +151 -0
- prsmfile-0.1.0/tests/test_oneway.py +225 -0
- prsmfile-0.1.0/tests/test_packaging.py +68 -0
- prsmfile-0.1.0/tests/test_review_round.py +255 -0
- prsmfile-0.1.0/tests/test_tables.py +430 -0
- prsmfile-0.1.0/tests/test_ttest.py +409 -0
- prsmfile-0.1.0/tests/test_twoway.py +262 -0
- prsmfile-0.1.0/tests/test_values.py +141 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
|
+
Breaking changes in 0.x releases are listed here.
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.0] - 2026-11-22
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Readers for `.prism` files (zip archives of JSON and CSV members) that extract stored analysis results and raw data tables without Prism.
|
|
14
|
+
- Structured readers for t tests and nonparametric two-sample tests, one-way ANOVA, two-way ANOVA, nonlinear regression and area under curve.
|
|
15
|
+
- Generic fallback reader that lists all stored values as `path, value` rows for every other analysis class, so nothing is dropped silently.
|
|
16
|
+
- Command line tool `prsmfile` with `--list`, `--analysis`, `--data`, `--json` and `--csv DIR`.
|
|
17
|
+
- JSON output with the report sections, and CSV export with one file per section plus `index.csv`.
|
|
18
|
+
- Python API: `prsmfile.open`, `read_analysis`, `read_table` and a reader registry.
|
|
19
|
+
- Warnings for result stubs, not calculated analyses and other known limitations.
|
|
20
|
+
|
|
21
|
+
[Unreleased]: https://github.com/deraljoscha/prsmfile/compare/v0.1.0...HEAD
|
|
22
|
+
[0.1.0]: https://github.com/deraljoscha/prsmfile/releases/tag/v0.1.0
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
title: prsmfile
|
|
3
|
+
message: If you use this software, please cite it using the metadata in this file.
|
|
4
|
+
type: software
|
|
5
|
+
authors:
|
|
6
|
+
- alias: deraljoscha
|
|
7
|
+
version: 0.1.0
|
|
8
|
+
date-released: 2026-11-22
|
|
9
|
+
license: MIT
|
|
10
|
+
repository-code: https://github.com/deraljoscha/prsmfile
|
|
11
|
+
abstract: Read the results and data tables stored in GraphPad Prism .prism files without Prism, as text, JSON or CSV.
|
|
12
|
+
keywords:
|
|
13
|
+
- GraphPad Prism
|
|
14
|
+
- prism file format
|
|
15
|
+
- statistics
|
|
16
|
+
- data extraction
|
|
17
|
+
- reproducibility
|
prsmfile-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 deraljoscha
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
prsmfile-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: prsmfile
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Read GraphPad Prism .prism files (results and data tables) without Prism
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/deraljoscha/prsmfile
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Intended Audience :: Science/Research
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering
|
|
17
|
+
Classifier: Typing :: Typed
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Provides-Extra: test
|
|
22
|
+
Requires-Dist: pytest; extra == "test"
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# prsmfile
|
|
26
|
+
|
|
27
|
+
Read the results and data tables stored in GraphPad Prism `.prism` files, without Prism.
|
|
28
|
+
Pure Python, standard library only, works on any OS with Python 3.10 or newer.
|
|
29
|
+
|
|
30
|
+
prsmfile reads files created by GraphPad Prism. It is an independent project and is not affiliated with, endorsed or sponsored by Dotmatics or GraphPad Software. GraphPad Prism is a trademark of its respective owner.
|
|
31
|
+
|
|
32
|
+
A `.prism` file is a zip archive of JSON and CSV members. When Prism has calculated an
|
|
33
|
+
analysis, the numbers are stored in the file. prsmfile turns them into plain tables, JSON or
|
|
34
|
+
CSV so you can check, reuse or archive results without opening Prism. The format is not
|
|
35
|
+
documented by the vendor; `docs/format.md` records what was observed in 75 public files.
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
pip install prsmfile
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
To install the development version from GitHub instead:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
pip install git+https://github.com/deraljoscha/prsmfile
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Stability
|
|
50
|
+
|
|
51
|
+
The `.prism` format is undocumented and reverse engineered. The Python API, the CLI output and
|
|
52
|
+
the JSON and CSV layout may change in 0.x releases. Breaking changes are listed in `CHANGELOG.md`.
|
|
53
|
+
|
|
54
|
+
## Command line
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
prsmfile FILE [--list] [--json] [--csv DIR] [--data] [--analysis TEXT]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
List the analyses and whether results are stored. The numbers are stable: every output uses
|
|
61
|
+
the number shown here, also when `--analysis` selects a subset.
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
$ prsmfile examples/example.prism --list
|
|
65
|
+
01 T_TESTS_AND_NONPARAMETRIC calculated Welch's t test of Lysozyme activity
|
|
66
|
+
02 ONE_WAY_ANOVA calculated Ordinary one-way ANOVA of Shoot dry mass
|
|
67
|
+
03 NORMALITY_TESTS calculated Normality and Lognormality Tests of Shoot dry mass
|
|
68
|
+
04 TWO_WAY_ANOVA calculated Ordinary two-way ANOVA of Root length
|
|
69
|
+
05 AREA_UNDER_CURVE calculated Area under the curve of Tracer clearance
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Show one analysis as text tables. `--analysis` takes the number from `--list` (`02`, ASCII digits only), an
|
|
73
|
+
analysis id, or else a case-insensitive part of the title. A pure number that matches no analysis is an
|
|
74
|
+
error (`no analysis numbered N`) and never searches titles:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
$ prsmfile examples/example.prism --analysis 02
|
|
78
|
+
File: examples/example.prism
|
|
79
|
+
created with Prism 11.1.0.224, saved with Prism 11.1.0.224, format 1-6-1
|
|
80
|
+
|
|
81
|
+
== 02 Ordinary one-way ANOVA of Shoot dry mass [ONE_WAY_ANOVA] ==
|
|
82
|
+
|
|
83
|
+
Parameters
|
|
84
|
+
Name Value
|
|
85
|
+
---------------------- --------------
|
|
86
|
+
Design ORDINARY_ANOVA
|
|
87
|
+
Post test design ALL_VS_ALL
|
|
88
|
+
Method Tukey
|
|
89
|
+
Comparisons per family 3
|
|
90
|
+
|
|
91
|
+
ANOVA
|
|
92
|
+
Source SS df MS F DFn DFd P R squared
|
|
93
|
+
--------- ------- -- ------- ------- --- --- --------- ---------
|
|
94
|
+
Treatment 5364.56 2 2682.28 37.1094 2 15 1.557e-06 0.831874
|
|
95
|
+
Residual 1084.21 15 72.2803
|
|
96
|
+
Total 6448.77 17
|
|
97
|
+
...
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
`examples/example.prism` is a synthetic file with invented data, see `examples/README.md`.
|
|
101
|
+
|
|
102
|
+
Other outputs:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
prsmfile FILE --json # the report sections as one JSON document (each analysis
|
|
106
|
+
# carries its list number as "number")
|
|
107
|
+
prsmfile FILE --json --data # plus the raw data tables
|
|
108
|
+
prsmfile FILE --csv out_dir # one CSV per section, plus index.csv
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
`--json` holds what the readers extract, not every stored number: for example the covariances
|
|
112
|
+
of a nonlinear regression are not in it. Use `Analysis.results` from Python for the complete
|
|
113
|
+
stored values. Text and CSV show the p-value number (with a `>` for a bound), JSON also carries
|
|
114
|
+
the stored significance verdict and alpha of each p-value. Text and CSV write booleans as
|
|
115
|
+
`yes` and `no`, JSON as `true` and `false`.
|
|
116
|
+
|
|
117
|
+
`--csv` writes into a new or empty directory. It builds the files in a temporary directory
|
|
118
|
+
next to the target and renames it at the end, so a failed export leaves nothing behind (also
|
|
119
|
+
no parent directories it created) and an existing non-empty directory is never touched. Exit
|
|
120
|
+
status is 1 for unreadable files and other errors, 2 for wrong command line options
|
|
121
|
+
(`--list` cannot be combined with `--data`).
|
|
122
|
+
|
|
123
|
+
## Python
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
import prsmfile
|
|
127
|
+
|
|
128
|
+
with prsmfile.open("examples/example.prism") as pf:
|
|
129
|
+
for a in pf.analyses():
|
|
130
|
+
print(prsmfile.read_analysis(pf, a).to_dict())
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
`read_analysis` returns a `Report` with a `kind` (`structured`, `generic` or `not_calculated`),
|
|
134
|
+
a list of `Section`s (title, columns, rows, optional note) and warnings. `pf.analyses()` returns
|
|
135
|
+
copies: changing `a.results` or `a.parameters` does not affect later calls.
|
|
136
|
+
|
|
137
|
+
Raw data tables and rendered result tables:
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
with prsmfile.open("examples/example.prism") as pf:
|
|
141
|
+
for sheet_id in pf.data_tables(): # raw data tables, in the listed order
|
|
142
|
+
table = prsmfile.read_table(pf, sheet_id) # Table: title, columns, rows (strings)
|
|
143
|
+
a = pf.analyses()[0]
|
|
144
|
+
for name, data_sheet_id in a.views: # Prism's rendered result views of an analysis
|
|
145
|
+
table = pf.result_table(data_sheet_id) # None if the sheet is not a result view
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Readers live in a registry, `prsmfile.readers.REGISTRY` (analysis class to function).
|
|
149
|
+
`prsmfile.readers.register("CLASS")` adds one for the whole process, and registering a class that
|
|
150
|
+
already has a reader replaces it (see `docs/readers.md`).
|
|
151
|
+
|
|
152
|
+
## Supported analyses
|
|
153
|
+
|
|
154
|
+
Structured readers (named columns, p-values with their bounds and significance) exist for five
|
|
155
|
+
analysis families:
|
|
156
|
+
|
|
157
|
+
- t tests and nonparametric two-sample tests (Welch, unpaired, paired, Mann-Whitney, Wilcoxon)
|
|
158
|
+
- one-way ANOVA (ordinary and repeated measures)
|
|
159
|
+
- two-way ANOVA (ordinary, repeated measures GLM, mixed model REML)
|
|
160
|
+
- nonlinear regression
|
|
161
|
+
- area under curve
|
|
162
|
+
|
|
163
|
+
Every other analysis class, and every analysis whose stored layout a structured reader cannot
|
|
164
|
+
handle, goes through a generic reader that lists all stored values as `path, value` rows. A
|
|
165
|
+
structured reader adds an "Other values" section with the stored values it has no column for,
|
|
166
|
+
so nothing is dropped silently.
|
|
167
|
+
|
|
168
|
+
## Known limitations
|
|
169
|
+
|
|
170
|
+
- Only analyses with stored results can be read. If Prism saved an analysis without results
|
|
171
|
+
(not calculated), prsmfile says so. Open the file in Prism, view the results and save again.
|
|
172
|
+
- Files written by Prism 10.0 often carry result stubs. For those, the rendered result tables
|
|
173
|
+
are shown instead, marked as rounded values.
|
|
174
|
+
- In repeated measures GLM two-way ANOVA the subjects row is only present in Prism's rendered
|
|
175
|
+
table, not in the stored numbers. prsmfile prints a warning in that case.
|
|
176
|
+
- Text tables align by character count. Wide characters (for example CJK) occupy two columns in a
|
|
177
|
+
terminal, so such columns look misaligned. JSON and CSV output are not affected.
|
|
178
|
+
- `.pzf` files (Prism's other file format) are not supported. Save the project as `.prism`.
|
|
179
|
+
- Graphs, layouts and embedded media are not read.
|
|
180
|
+
- Only the five structured families above get dedicated readers; other analyses are generic.
|
|
181
|
+
- For unpaired tests, the stored `swapDirection` flag is not trusted. The direction of a
|
|
182
|
+
difference is derived from the stored means.
|
|
183
|
+
|
|
184
|
+
## Tests and the corpus
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
pip install -e '.[test]'
|
|
188
|
+
pytest -q
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
The default run uses synthetic files built by `tests/builder.py`. A larger check runs against 75
|
|
192
|
+
public CC0 and CC-BY files from Zenodo. They are not part of this repository. Fetch them (the
|
|
193
|
+
script verifies SHA256 hashes) and run the corpus tests:
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
python scripts/fetch_corpus.py
|
|
197
|
+
pytest -q tests/test_corpus.py -s
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Without a `corpus/` directory the corpus tests are skipped.
|
|
201
|
+
|
|
202
|
+
## Contributing
|
|
203
|
+
|
|
204
|
+
To add a reader for another analysis class, see `docs/readers.md`. The file format notes are in
|
|
205
|
+
`docs/format.md`. Please attach only files you may share, and never real personal data.
|
|
206
|
+
|
|
207
|
+
## Reporting problems
|
|
208
|
+
|
|
209
|
+
Open an issue with the Prism version and, if possible, a file with invented data.
|
|
210
|
+
|
|
211
|
+
## Citing
|
|
212
|
+
|
|
213
|
+
See `CITATION.cff`.
|
|
214
|
+
|
|
215
|
+
## License
|
|
216
|
+
|
|
217
|
+
MIT, see `LICENSE`.
|
prsmfile-0.1.0/README.md
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# prsmfile
|
|
2
|
+
|
|
3
|
+
Read the results and data tables stored in GraphPad Prism `.prism` files, without Prism.
|
|
4
|
+
Pure Python, standard library only, works on any OS with Python 3.10 or newer.
|
|
5
|
+
|
|
6
|
+
prsmfile reads files created by GraphPad Prism. It is an independent project and is not affiliated with, endorsed or sponsored by Dotmatics or GraphPad Software. GraphPad Prism is a trademark of its respective owner.
|
|
7
|
+
|
|
8
|
+
A `.prism` file is a zip archive of JSON and CSV members. When Prism has calculated an
|
|
9
|
+
analysis, the numbers are stored in the file. prsmfile turns them into plain tables, JSON or
|
|
10
|
+
CSV so you can check, reuse or archive results without opening Prism. The format is not
|
|
11
|
+
documented by the vendor; `docs/format.md` records what was observed in 75 public files.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
pip install prsmfile
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
To install the development version from GitHub instead:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
pip install git+https://github.com/deraljoscha/prsmfile
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Stability
|
|
26
|
+
|
|
27
|
+
The `.prism` format is undocumented and reverse engineered. The Python API, the CLI output and
|
|
28
|
+
the JSON and CSV layout may change in 0.x releases. Breaking changes are listed in `CHANGELOG.md`.
|
|
29
|
+
|
|
30
|
+
## Command line
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
prsmfile FILE [--list] [--json] [--csv DIR] [--data] [--analysis TEXT]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
List the analyses and whether results are stored. The numbers are stable: every output uses
|
|
37
|
+
the number shown here, also when `--analysis` selects a subset.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
$ prsmfile examples/example.prism --list
|
|
41
|
+
01 T_TESTS_AND_NONPARAMETRIC calculated Welch's t test of Lysozyme activity
|
|
42
|
+
02 ONE_WAY_ANOVA calculated Ordinary one-way ANOVA of Shoot dry mass
|
|
43
|
+
03 NORMALITY_TESTS calculated Normality and Lognormality Tests of Shoot dry mass
|
|
44
|
+
04 TWO_WAY_ANOVA calculated Ordinary two-way ANOVA of Root length
|
|
45
|
+
05 AREA_UNDER_CURVE calculated Area under the curve of Tracer clearance
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Show one analysis as text tables. `--analysis` takes the number from `--list` (`02`, ASCII digits only), an
|
|
49
|
+
analysis id, or else a case-insensitive part of the title. A pure number that matches no analysis is an
|
|
50
|
+
error (`no analysis numbered N`) and never searches titles:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
$ prsmfile examples/example.prism --analysis 02
|
|
54
|
+
File: examples/example.prism
|
|
55
|
+
created with Prism 11.1.0.224, saved with Prism 11.1.0.224, format 1-6-1
|
|
56
|
+
|
|
57
|
+
== 02 Ordinary one-way ANOVA of Shoot dry mass [ONE_WAY_ANOVA] ==
|
|
58
|
+
|
|
59
|
+
Parameters
|
|
60
|
+
Name Value
|
|
61
|
+
---------------------- --------------
|
|
62
|
+
Design ORDINARY_ANOVA
|
|
63
|
+
Post test design ALL_VS_ALL
|
|
64
|
+
Method Tukey
|
|
65
|
+
Comparisons per family 3
|
|
66
|
+
|
|
67
|
+
ANOVA
|
|
68
|
+
Source SS df MS F DFn DFd P R squared
|
|
69
|
+
--------- ------- -- ------- ------- --- --- --------- ---------
|
|
70
|
+
Treatment 5364.56 2 2682.28 37.1094 2 15 1.557e-06 0.831874
|
|
71
|
+
Residual 1084.21 15 72.2803
|
|
72
|
+
Total 6448.77 17
|
|
73
|
+
...
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`examples/example.prism` is a synthetic file with invented data, see `examples/README.md`.
|
|
77
|
+
|
|
78
|
+
Other outputs:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
prsmfile FILE --json # the report sections as one JSON document (each analysis
|
|
82
|
+
# carries its list number as "number")
|
|
83
|
+
prsmfile FILE --json --data # plus the raw data tables
|
|
84
|
+
prsmfile FILE --csv out_dir # one CSV per section, plus index.csv
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`--json` holds what the readers extract, not every stored number: for example the covariances
|
|
88
|
+
of a nonlinear regression are not in it. Use `Analysis.results` from Python for the complete
|
|
89
|
+
stored values. Text and CSV show the p-value number (with a `>` for a bound), JSON also carries
|
|
90
|
+
the stored significance verdict and alpha of each p-value. Text and CSV write booleans as
|
|
91
|
+
`yes` and `no`, JSON as `true` and `false`.
|
|
92
|
+
|
|
93
|
+
`--csv` writes into a new or empty directory. It builds the files in a temporary directory
|
|
94
|
+
next to the target and renames it at the end, so a failed export leaves nothing behind (also
|
|
95
|
+
no parent directories it created) and an existing non-empty directory is never touched. Exit
|
|
96
|
+
status is 1 for unreadable files and other errors, 2 for wrong command line options
|
|
97
|
+
(`--list` cannot be combined with `--data`).
|
|
98
|
+
|
|
99
|
+
## Python
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
import prsmfile
|
|
103
|
+
|
|
104
|
+
with prsmfile.open("examples/example.prism") as pf:
|
|
105
|
+
for a in pf.analyses():
|
|
106
|
+
print(prsmfile.read_analysis(pf, a).to_dict())
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`read_analysis` returns a `Report` with a `kind` (`structured`, `generic` or `not_calculated`),
|
|
110
|
+
a list of `Section`s (title, columns, rows, optional note) and warnings. `pf.analyses()` returns
|
|
111
|
+
copies: changing `a.results` or `a.parameters` does not affect later calls.
|
|
112
|
+
|
|
113
|
+
Raw data tables and rendered result tables:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
with prsmfile.open("examples/example.prism") as pf:
|
|
117
|
+
for sheet_id in pf.data_tables(): # raw data tables, in the listed order
|
|
118
|
+
table = prsmfile.read_table(pf, sheet_id) # Table: title, columns, rows (strings)
|
|
119
|
+
a = pf.analyses()[0]
|
|
120
|
+
for name, data_sheet_id in a.views: # Prism's rendered result views of an analysis
|
|
121
|
+
table = pf.result_table(data_sheet_id) # None if the sheet is not a result view
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Readers live in a registry, `prsmfile.readers.REGISTRY` (analysis class to function).
|
|
125
|
+
`prsmfile.readers.register("CLASS")` adds one for the whole process, and registering a class that
|
|
126
|
+
already has a reader replaces it (see `docs/readers.md`).
|
|
127
|
+
|
|
128
|
+
## Supported analyses
|
|
129
|
+
|
|
130
|
+
Structured readers (named columns, p-values with their bounds and significance) exist for five
|
|
131
|
+
analysis families:
|
|
132
|
+
|
|
133
|
+
- t tests and nonparametric two-sample tests (Welch, unpaired, paired, Mann-Whitney, Wilcoxon)
|
|
134
|
+
- one-way ANOVA (ordinary and repeated measures)
|
|
135
|
+
- two-way ANOVA (ordinary, repeated measures GLM, mixed model REML)
|
|
136
|
+
- nonlinear regression
|
|
137
|
+
- area under curve
|
|
138
|
+
|
|
139
|
+
Every other analysis class, and every analysis whose stored layout a structured reader cannot
|
|
140
|
+
handle, goes through a generic reader that lists all stored values as `path, value` rows. A
|
|
141
|
+
structured reader adds an "Other values" section with the stored values it has no column for,
|
|
142
|
+
so nothing is dropped silently.
|
|
143
|
+
|
|
144
|
+
## Known limitations
|
|
145
|
+
|
|
146
|
+
- Only analyses with stored results can be read. If Prism saved an analysis without results
|
|
147
|
+
(not calculated), prsmfile says so. Open the file in Prism, view the results and save again.
|
|
148
|
+
- Files written by Prism 10.0 often carry result stubs. For those, the rendered result tables
|
|
149
|
+
are shown instead, marked as rounded values.
|
|
150
|
+
- In repeated measures GLM two-way ANOVA the subjects row is only present in Prism's rendered
|
|
151
|
+
table, not in the stored numbers. prsmfile prints a warning in that case.
|
|
152
|
+
- Text tables align by character count. Wide characters (for example CJK) occupy two columns in a
|
|
153
|
+
terminal, so such columns look misaligned. JSON and CSV output are not affected.
|
|
154
|
+
- `.pzf` files (Prism's other file format) are not supported. Save the project as `.prism`.
|
|
155
|
+
- Graphs, layouts and embedded media are not read.
|
|
156
|
+
- Only the five structured families above get dedicated readers; other analyses are generic.
|
|
157
|
+
- For unpaired tests, the stored `swapDirection` flag is not trusted. The direction of a
|
|
158
|
+
difference is derived from the stored means.
|
|
159
|
+
|
|
160
|
+
## Tests and the corpus
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
pip install -e '.[test]'
|
|
164
|
+
pytest -q
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
The default run uses synthetic files built by `tests/builder.py`. A larger check runs against 75
|
|
168
|
+
public CC0 and CC-BY files from Zenodo. They are not part of this repository. Fetch them (the
|
|
169
|
+
script verifies SHA256 hashes) and run the corpus tests:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
python scripts/fetch_corpus.py
|
|
173
|
+
pytest -q tests/test_corpus.py -s
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Without a `corpus/` directory the corpus tests are skipped.
|
|
177
|
+
|
|
178
|
+
## Contributing
|
|
179
|
+
|
|
180
|
+
To add a reader for another analysis class, see `docs/readers.md`. The file format notes are in
|
|
181
|
+
`docs/format.md`. Please attach only files you may share, and never real personal data.
|
|
182
|
+
|
|
183
|
+
## Reporting problems
|
|
184
|
+
|
|
185
|
+
Open an issue with the Prism version and, if possible, a file with invented data.
|
|
186
|
+
|
|
187
|
+
## Citing
|
|
188
|
+
|
|
189
|
+
See `CITATION.cff`.
|
|
190
|
+
|
|
191
|
+
## License
|
|
192
|
+
|
|
193
|
+
MIT, see `LICENSE`.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
Please report vulnerabilities privately through GitHub: open the Security tab of this repository and choose "Report a vulnerability" (private vulnerability reporting).
|
|
4
|
+
Please do not open a public issue for security problems.
|
|
5
|
+
The supported version is the latest release.
|