pase-framework 1.1.0__tar.gz → 1.2.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.
- {pase_framework-1.1.0 → pase_framework-1.2.0}/CHANGELOG.md +20 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/CITATION.cff +2 -1
- {pase_framework-1.1.0 → pase_framework-1.2.0}/PKG-INFO +82 -29
- pase_framework-1.2.0/README.md +164 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/docs/inputs.md +28 -18
- {pase_framework-1.1.0 → pase_framework-1.2.0}/docs/outputs.md +3 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/docs/quickstart.md +32 -11
- {pase_framework-1.1.0 → pase_framework-1.2.0}/docs/release.md +23 -8
- {pase_framework-1.1.0 → pase_framework-1.2.0}/docs/reporting-policy.md +4 -5
- {pase_framework-1.1.0 → pase_framework-1.2.0}/docs/reproducibility.md +20 -2
- {pase_framework-1.1.0 → pase_framework-1.2.0}/pyproject.toml +1 -1
- {pase_framework-1.1.0 → pase_framework-1.2.0}/scripts/prepare_bioconda.py +1 -1
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase/__init__.py +1 -1
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase/_reporting.py +5 -10
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase/association.py +31 -9
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase_framework.egg-info/PKG-INFO +82 -29
- {pase_framework-1.1.0 → pase_framework-1.2.0}/tests/test_association.py +44 -1
- pase_framework-1.1.0/README.md +0 -111
- {pase_framework-1.1.0 → pase_framework-1.2.0}/.github/workflows/publish.yml +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/.github/workflows/tests.yml +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/.readthedocs.yaml +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/LICENSE +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/MANIFEST.in +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/THIRD_PARTY_DATA.md +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/docs/api.rst +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/docs/conf.py +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/docs/index.md +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/docs/statistics.md +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/examples/build_gse234933_subset.py +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/examples/gse234933_quickstart.ipynb +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/scripts/check_docs.py +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/scripts/run_tutorial.py +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/setup.cfg +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase/_statistics.py +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase/data/DATA_NOTICE.md +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase/data/gse234933_demo.npz +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase/data/gse234933_demo_manifest.json +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase/data/gse234933_demo_obs.tsv +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase/datasets.py +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase/result.py +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase_framework.egg-info/SOURCES.txt +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase_framework.egg-info/dependency_links.txt +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase_framework.egg-info/requires.txt +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/src/pase_framework.egg-info/top_level.txt +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/tests/test_datasets.py +0 -0
- {pase_framework-1.1.0 → pase_framework-1.2.0}/tests/test_reporting.py +0 -0
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
- Added `standardize_before_mask` to `associate()`. The default estimates
|
|
6
|
+
patient-specific module means and sample SDs before applying the cell mask,
|
|
7
|
+
matching the order in the manuscript. Pass `False` for PASE 1.1.x behavior.
|
|
8
|
+
- Recorded the chosen standardization order and reference set in result
|
|
9
|
+
metadata. Ungated and single-gene association estimates are unchanged.
|
|
10
|
+
|
|
11
|
+
## 1.1.1
|
|
12
|
+
|
|
13
|
+
- Corrected the environment commands for Windows, macOS and Linux.
|
|
14
|
+
- Made README links work on PyPI and added a saved-plot example.
|
|
15
|
+
- Linked the software, simulation protocol, core results and manuscript
|
|
16
|
+
reproduction workflow, with the later supplementary analyses listed separately.
|
|
17
|
+
- Clarified categorical inputs and the four-gene teaching example versus the
|
|
18
|
+
manuscript's 15-gene workflow.
|
|
19
|
+
- This documentation and packaging update leaves the statistical calculations,
|
|
20
|
+
reporting defaults and bundled data unchanged from 1.1.0. The manuscript
|
|
21
|
+
analyses used 1.1.0.
|
|
22
|
+
|
|
3
23
|
## 1.1.0
|
|
4
24
|
|
|
5
25
|
- Changed the default reporting floor from two to six method-eligible patients.
|
|
@@ -2,8 +2,9 @@ cff-version: 1.2.0
|
|
|
2
2
|
message: "Please cite this software and the version-specific release URL or DOI accompanying the version used."
|
|
3
3
|
type: software
|
|
4
4
|
title: "PASE: patient-level association estimation"
|
|
5
|
-
version: 1.
|
|
5
|
+
version: 1.2.0
|
|
6
6
|
repository-code: "https://github.com/tjw0613-cell/pase-software"
|
|
7
|
+
url: "https://github.com/tjw0613-cell/pase-software/releases/tag/v1.2.0"
|
|
7
8
|
authors:
|
|
8
9
|
- family-names: Tang
|
|
9
10
|
given-names: Jinwei
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pase-framework
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Patient-level association estimates for multi-patient single-cell studies
|
|
5
5
|
Author: Jinwei Tang, Yunfan Lin, Linrui Cai, Yali Wen, Guangyang Chen, Li Huang
|
|
6
6
|
License-Expression: MIT
|
|
@@ -53,40 +53,59 @@ for installation, the API and the statistical meaning of each parameter.
|
|
|
53
53
|
## Installation
|
|
54
54
|
|
|
55
55
|
Use Python 3.10 or later in a fresh environment. Install the published release
|
|
56
|
-
from [PyPI](https://pypi.org/project/pase-framework/1.
|
|
56
|
+
from [PyPI](https://pypi.org/project/pase-framework/1.2.0/).
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
Windows PowerShell:
|
|
59
|
+
|
|
60
|
+
```powershell
|
|
59
61
|
python -m venv .venv
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
.\.venv\Scripts\python.exe -m pip install pase-framework==1.2.0
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
macOS or Linux:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python3 -m venv .venv
|
|
69
|
+
.venv/bin/python -m pip install pase-framework==1.2.0
|
|
63
70
|
```
|
|
64
71
|
|
|
72
|
+
These commands run Python directly from the new environment.
|
|
73
|
+
|
|
65
74
|
The distribution is named **pase-framework**, but the Python import is `pase`.
|
|
66
75
|
The unrelated audio package named `pase` on PyPI uses the same import name;
|
|
67
76
|
do not install both in one environment. The
|
|
68
|
-
[v1.
|
|
77
|
+
[v1.2.0 release](https://github.com/tjw0613-cell/pase-software/releases/tag/v1.2.0)
|
|
69
78
|
is also available on GitHub. For development, clone this repository and use
|
|
70
79
|
`python -m pip install -e ".[test]"`.
|
|
71
80
|
|
|
72
|
-
##
|
|
81
|
+
## Quick example
|
|
82
|
+
|
|
83
|
+
Save this as `quickstart.py`:
|
|
73
84
|
|
|
74
85
|
```python
|
|
75
86
|
import pase
|
|
76
87
|
adata = pase.datasets.load_gse234933_demo()
|
|
77
|
-
res = pase.associate(
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
res = pase.associate(
|
|
89
|
+
adata, anchor="LILRB4", target=["MMP14", "MMP9", "SPP1", "APOE"],
|
|
90
|
+
patient_key="donor", covariates=["log_depth"], cell_mask="myeloid",
|
|
91
|
+
aggregate="equal", min_cells=30,
|
|
92
|
+
)
|
|
93
|
+
print(res.summary().to_string(index=False))
|
|
94
|
+
print(res.patients[["patient_id", "n_cells", "r", "eligible", "reason"]])
|
|
95
|
+
ax = res.plot_forest()
|
|
96
|
+
ax.figure.savefig("association.pdf", bbox_inches="tight")
|
|
80
97
|
```
|
|
81
98
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
99
|
+
Run it with `.\.venv\Scripts\python.exe quickstart.py` on Windows or
|
|
100
|
+
`.venv/bin/python quickstart.py` on macOS/Linux. It prints the cohort summary
|
|
101
|
+
and patient table and saves a forest plot as `association.pdf`.
|
|
102
|
+
|
|
103
|
+
The example uses four genes from the bundled GSE234933 teaching dataset.
|
|
104
|
+
The [tutorial notebook](https://github.com/tjw0613-cell/pase-software/blob/v1.2.0/examples/gse234933_quickstart.ipynb)
|
|
105
|
+
uses the manuscript's 15-gene score on the same subset. For the complete
|
|
106
|
+
cohort analyses, use the [RNA workflow](https://github.com/tjw0613-cell/pase-reproducibility/tree/main/workflows/rna).
|
|
107
|
+
See the [quick-start guide](https://pase-software.readthedocs.io/en/latest/quickstart.html)
|
|
108
|
+
for notebook installation and execution.
|
|
90
109
|
|
|
91
110
|
## Input format
|
|
92
111
|
|
|
@@ -103,11 +122,21 @@ genes. `associate` does not normalize raw counts.
|
|
|
103
122
|
| `adata.obs["myeloid"]` | Boolean cell-selection column. Patients with no selected cells remain in the output. |
|
|
104
123
|
| `anchor` | One gene name. |
|
|
105
124
|
| `target` | One gene name, or a list whose within-patient gene z scores are averaged. |
|
|
125
|
+
| `standardize_before_mask` | `True` uses all input cells with complete expression in each patient as the standardization reference. `False` uses the mask-selected cells. |
|
|
126
|
+
|
|
127
|
+
For the gated manuscript analysis, supply the ungated myeloid population as
|
|
128
|
+
the input and pass the detection gate as `cell_mask`. In version 1.2.0 the
|
|
129
|
+
module score uses the same reference population in the ungated and gated fits
|
|
130
|
+
by default. Set `standardize_before_mask=False` to recover the masked-score
|
|
131
|
+
behavior of PASE 1.1.x. This option changes only the scaling of masked gene
|
|
132
|
+
lists. See [score construction](https://pase-software.readthedocs.io/en/latest/inputs.html#scores-covariates-and-missing-values).
|
|
106
133
|
|
|
107
134
|
Covariates enter a separate least-squares model for each patient, with an
|
|
108
|
-
intercept.
|
|
135
|
+
intercept. Encode categorical covariates as numeric dummy variables; integer
|
|
136
|
+
labels such as 0, 1 and 2 are otherwise treated as a numeric covariate.
|
|
109
137
|
Patients absent from the object can be retained using `patient_ids`.
|
|
110
|
-
See [the input guide](
|
|
138
|
+
See [the input guide](https://pase-software.readthedocs.io/en/latest/inputs.html)
|
|
139
|
+
for missing values and eligibility rules.
|
|
111
140
|
|
|
112
141
|
## Outputs and choice of summary
|
|
113
142
|
|
|
@@ -123,6 +152,11 @@ warnings. `res.plot_forest()` returns a Matplotlib Axes.
|
|
|
123
152
|
| `"re_hksj"` | REML random-effects mean on the Fisher-z scale, back-transformed for display, with a classical HKSJ interval. It has a different target from the arithmetic mean. |
|
|
124
153
|
| `"eb"` | Individual patient effects shrunk toward the fitted Fisher-z population mean. Conditional intervals exclude uncertainty in fitted population parameters; no cohort P value is returned. |
|
|
125
154
|
|
|
155
|
+
REML means restricted maximum likelihood; HKSJ is the
|
|
156
|
+
Hartung–Knapp–Sidik–Jonkman interval adjustment; EB means empirical Bayes.
|
|
157
|
+
See [the output guide](https://pase-software.readthedocs.io/en/latest/outputs.html)
|
|
158
|
+
for field definitions and warning codes.
|
|
159
|
+
|
|
126
160
|
`min_cells=30` is adjustable. Version 1.1.0 changes the default
|
|
127
161
|
`min_patients` from 2 to **6**. Below the selected method's eligible-patient
|
|
128
162
|
threshold, PASE returns observed patient correlations, descriptive summaries
|
|
@@ -134,7 +168,7 @@ and a precision warning when the full correlation-scale interval is wider
|
|
|
134
168
|
than `max_ci_width=0.2`. Warnings retain the interval. The patient boundaries
|
|
135
169
|
are result-informed reporting choices, and 0.2 is a configurable practical
|
|
136
170
|
tolerance; none guarantees calibrated coverage. See the
|
|
137
|
-
[reporting policy and its evidence](
|
|
171
|
+
[reporting policy and its evidence](https://pase-software.readthedocs.io/en/latest/reporting-policy.html).
|
|
138
172
|
|
|
139
173
|
For the equal-patient mean, an externally specified `planning_sd` enables a
|
|
140
174
|
model-based minimum detectable effect (MDE). Record its origin with
|
|
@@ -142,15 +176,34 @@ model-based minimum detectable effect (MDE). Record its origin with
|
|
|
142
176
|
scientifically meaningful effect. This is a planning calculation, not achieved
|
|
143
177
|
power, and is not provided for Fisher or EB targets.
|
|
144
178
|
|
|
179
|
+
## Reproduce the manuscript
|
|
180
|
+
|
|
181
|
+
The [reproduction repository](https://github.com/tjw0613-cell/pase-reproducibility)
|
|
182
|
+
contains figure commands and the full 15-gene RNA workflow.
|
|
183
|
+
The [public API example](https://github.com/tjw0613-cell/pase-reproducibility/blob/main/workflows/h/public_api_example.py)
|
|
184
|
+
recreates the manuscript's RNA associations from the prepared cohort caches.
|
|
185
|
+
Use the [workflow instructions](https://github.com/tjw0613-cell/pase-reproducibility/tree/main/workflows/h)
|
|
186
|
+
to download the GEO data, build those caches and run the comparison.
|
|
187
|
+
|
|
188
|
+
- [Simulation protocol, version 2.0.0](https://doi.org/10.5281/zenodo.24010816):
|
|
189
|
+
the design archived before the formal simulations.
|
|
190
|
+
- [Core results and reproducibility materials](https://doi.org/10.5281/zenodo.24015713):
|
|
191
|
+
the subsequent code and results archive, including PASE 1.1.0.
|
|
192
|
+
- Supplementary Data S1 contains the detection-matched gene analysis.
|
|
193
|
+
Supplementary Data S2 contains the unequal-yield native count benchmark.
|
|
194
|
+
|
|
195
|
+
See [reproduction instructions](https://pase-software.readthedocs.io/en/latest/reproducibility.html)
|
|
196
|
+
for the scope of each workflow and the software test commands.
|
|
197
|
+
|
|
145
198
|
## Citation
|
|
146
199
|
|
|
147
|
-
For this code, cite the authors, PASE software version **1.
|
|
148
|
-
[release URL](https://github.com/tjw0613-cell/pase-software/releases/tag/v1.
|
|
149
|
-
Machine-readable author
|
|
150
|
-
|
|
151
|
-
available at [Zenodo v3](https://doi.org/10.5281/zenodo.23032874); that DOI does
|
|
152
|
-
not identify this 1.1.0 software release.
|
|
200
|
+
For this code, cite the authors, PASE software version **1.2.0**, and its
|
|
201
|
+
[release URL](https://github.com/tjw0613-cell/pase-software/releases/tag/v1.2.0).
|
|
202
|
+
Machine-readable author information is in
|
|
203
|
+
[CITATION.cff](https://github.com/tjw0613-cell/pase-software/blob/v1.2.0/CITATION.cff).
|
|
153
204
|
|
|
154
205
|
Code is distributed under the MIT License. The real-data example retains its
|
|
155
|
-
source attribution and third-party terms; see
|
|
206
|
+
source attribution and third-party terms; see
|
|
207
|
+
[THIRD_PARTY_DATA.md](https://github.com/tjw0613-cell/pase-software/blob/v1.2.0/THIRD_PARTY_DATA.md).
|
|
208
|
+
Report software problems through [GitHub Issues](https://github.com/tjw0613-cell/pase-software/issues).
|
|
156
209
|
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# PASE
|
|
2
|
+
|
|
3
|
+
PASE estimates molecular associations within individual patients and summarizes them across a single-cell cohort.
|
|
4
|
+
|
|
5
|
+
Read the [online documentation](https://pase-software.readthedocs.io/en/latest/)
|
|
6
|
+
for installation, the API and the statistical meaning of each parameter.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
Use Python 3.10 or later in a fresh environment. Install the published release
|
|
11
|
+
from [PyPI](https://pypi.org/project/pase-framework/1.2.0/).
|
|
12
|
+
|
|
13
|
+
Windows PowerShell:
|
|
14
|
+
|
|
15
|
+
```powershell
|
|
16
|
+
python -m venv .venv
|
|
17
|
+
.\.venv\Scripts\python.exe -m pip install pase-framework==1.2.0
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
macOS or Linux:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
python3 -m venv .venv
|
|
24
|
+
.venv/bin/python -m pip install pase-framework==1.2.0
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
These commands run Python directly from the new environment.
|
|
28
|
+
|
|
29
|
+
The distribution is named **pase-framework**, but the Python import is `pase`.
|
|
30
|
+
The unrelated audio package named `pase` on PyPI uses the same import name;
|
|
31
|
+
do not install both in one environment. The
|
|
32
|
+
[v1.2.0 release](https://github.com/tjw0613-cell/pase-software/releases/tag/v1.2.0)
|
|
33
|
+
is also available on GitHub. For development, clone this repository and use
|
|
34
|
+
`python -m pip install -e ".[test]"`.
|
|
35
|
+
|
|
36
|
+
## Quick example
|
|
37
|
+
|
|
38
|
+
Save this as `quickstart.py`:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
import pase
|
|
42
|
+
adata = pase.datasets.load_gse234933_demo()
|
|
43
|
+
res = pase.associate(
|
|
44
|
+
adata, anchor="LILRB4", target=["MMP14", "MMP9", "SPP1", "APOE"],
|
|
45
|
+
patient_key="donor", covariates=["log_depth"], cell_mask="myeloid",
|
|
46
|
+
aggregate="equal", min_cells=30,
|
|
47
|
+
)
|
|
48
|
+
print(res.summary().to_string(index=False))
|
|
49
|
+
print(res.patients[["patient_id", "n_cells", "r", "eligible", "reason"]])
|
|
50
|
+
ax = res.plot_forest()
|
|
51
|
+
ax.figure.savefig("association.pdf", bbox_inches="tight")
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Run it with `.\.venv\Scripts\python.exe quickstart.py` on Windows or
|
|
55
|
+
`.venv/bin/python quickstart.py` on macOS/Linux. It prints the cohort summary
|
|
56
|
+
and patient table and saves a forest plot as `association.pdf`.
|
|
57
|
+
|
|
58
|
+
The example uses four genes from the bundled GSE234933 teaching dataset.
|
|
59
|
+
The [tutorial notebook](https://github.com/tjw0613-cell/pase-software/blob/v1.2.0/examples/gse234933_quickstart.ipynb)
|
|
60
|
+
uses the manuscript's 15-gene score on the same subset. For the complete
|
|
61
|
+
cohort analyses, use the [RNA workflow](https://github.com/tjw0613-cell/pase-reproducibility/tree/main/workflows/rna).
|
|
62
|
+
See the [quick-start guide](https://pase-software.readthedocs.io/en/latest/quickstart.html)
|
|
63
|
+
for notebook installation and execution.
|
|
64
|
+
|
|
65
|
+
## Input format
|
|
66
|
+
|
|
67
|
+
Supply an AnnData object with cells in rows and unique gene names in
|
|
68
|
+
`adata.var_names`. `adata.X`, or the requested `layer`, must already contain
|
|
69
|
+
transformed expression. For count data, the tutorial uses
|
|
70
|
+
`log1p(10000 * count / total_counts)` with totals calculated **before** selecting
|
|
71
|
+
genes. `associate` does not normalize raw counts.
|
|
72
|
+
|
|
73
|
+
| Input | Meaning |
|
|
74
|
+
|---|---|
|
|
75
|
+
| `adata.obs["donor"]` | Independent patient ID, with no missing values. Repeated samples from one patient must share an ID. |
|
|
76
|
+
| `adata.obs["log_depth"]` | Numeric covariate; the tutorial uses `log1p(total_counts)` from the full matrix. |
|
|
77
|
+
| `adata.obs["myeloid"]` | Boolean cell-selection column. Patients with no selected cells remain in the output. |
|
|
78
|
+
| `anchor` | One gene name. |
|
|
79
|
+
| `target` | One gene name, or a list whose within-patient gene z scores are averaged. |
|
|
80
|
+
| `standardize_before_mask` | `True` uses all input cells with complete expression in each patient as the standardization reference. `False` uses the mask-selected cells. |
|
|
81
|
+
|
|
82
|
+
For the gated manuscript analysis, supply the ungated myeloid population as
|
|
83
|
+
the input and pass the detection gate as `cell_mask`. In version 1.2.0 the
|
|
84
|
+
module score uses the same reference population in the ungated and gated fits
|
|
85
|
+
by default. Set `standardize_before_mask=False` to recover the masked-score
|
|
86
|
+
behavior of PASE 1.1.x. This option changes only the scaling of masked gene
|
|
87
|
+
lists. See [score construction](https://pase-software.readthedocs.io/en/latest/inputs.html#scores-covariates-and-missing-values).
|
|
88
|
+
|
|
89
|
+
Covariates enter a separate least-squares model for each patient, with an
|
|
90
|
+
intercept. Encode categorical covariates as numeric dummy variables; integer
|
|
91
|
+
labels such as 0, 1 and 2 are otherwise treated as a numeric covariate.
|
|
92
|
+
Patients absent from the object can be retained using `patient_ids`.
|
|
93
|
+
See [the input guide](https://pase-software.readthedocs.io/en/latest/inputs.html)
|
|
94
|
+
for missing values and eligibility rules.
|
|
95
|
+
|
|
96
|
+
## Outputs and choice of summary
|
|
97
|
+
|
|
98
|
+
`res.patients` reports every patient, cell counts, observed correlation,
|
|
99
|
+
eligibility, exclusion reasons and, where applicable, weights or shrunken effects.
|
|
100
|
+
`res.summary()` returns one row with the selected method, target, estimate,
|
|
101
|
+
interval, P value and status. `res.metadata` records the analysis settings and
|
|
102
|
+
warnings. `res.plot_forest()` returns a Matplotlib Axes.
|
|
103
|
+
|
|
104
|
+
| `aggregate` | What it reports |
|
|
105
|
+
|---|---|
|
|
106
|
+
| `"equal"` | Arithmetic mean of eligible patients' observed correlations, with a t interval. Each eligible patient has equal weight. |
|
|
107
|
+
| `"re_hksj"` | REML random-effects mean on the Fisher-z scale, back-transformed for display, with a classical HKSJ interval. It has a different target from the arithmetic mean. |
|
|
108
|
+
| `"eb"` | Individual patient effects shrunk toward the fitted Fisher-z population mean. Conditional intervals exclude uncertainty in fitted population parameters; no cohort P value is returned. |
|
|
109
|
+
|
|
110
|
+
REML means restricted maximum likelihood; HKSJ is the
|
|
111
|
+
Hartung–Knapp–Sidik–Jonkman interval adjustment; EB means empirical Bayes.
|
|
112
|
+
See [the output guide](https://pase-software.readthedocs.io/en/latest/outputs.html)
|
|
113
|
+
for field definitions and warning codes.
|
|
114
|
+
|
|
115
|
+
`min_cells=30` is adjustable. Version 1.1.0 changes the default
|
|
116
|
+
`min_patients` from 2 to **6**. Below the selected method's eligible-patient
|
|
117
|
+
threshold, PASE returns observed patient correlations, descriptive summaries
|
|
118
|
+
and exclusion reasons, but withholds inferential estimates, intervals and
|
|
119
|
+
P values. An explicit lower threshold is allowed and recorded as an override.
|
|
120
|
+
|
|
121
|
+
Reported inference receives a small-cohort warning below 20 eligible patients
|
|
122
|
+
and a precision warning when the full correlation-scale interval is wider
|
|
123
|
+
than `max_ci_width=0.2`. Warnings retain the interval. The patient boundaries
|
|
124
|
+
are result-informed reporting choices, and 0.2 is a configurable practical
|
|
125
|
+
tolerance; none guarantees calibrated coverage. See the
|
|
126
|
+
[reporting policy and its evidence](https://pase-software.readthedocs.io/en/latest/reporting-policy.html).
|
|
127
|
+
|
|
128
|
+
For the equal-patient mean, an externally specified `planning_sd` enables a
|
|
129
|
+
model-based minimum detectable effect (MDE). Record its origin with
|
|
130
|
+
`planning_sd_source`; set `minimum_relevant_effect` to compare the MDE with a
|
|
131
|
+
scientifically meaningful effect. This is a planning calculation, not achieved
|
|
132
|
+
power, and is not provided for Fisher or EB targets.
|
|
133
|
+
|
|
134
|
+
## Reproduce the manuscript
|
|
135
|
+
|
|
136
|
+
The [reproduction repository](https://github.com/tjw0613-cell/pase-reproducibility)
|
|
137
|
+
contains figure commands and the full 15-gene RNA workflow.
|
|
138
|
+
The [public API example](https://github.com/tjw0613-cell/pase-reproducibility/blob/main/workflows/h/public_api_example.py)
|
|
139
|
+
recreates the manuscript's RNA associations from the prepared cohort caches.
|
|
140
|
+
Use the [workflow instructions](https://github.com/tjw0613-cell/pase-reproducibility/tree/main/workflows/h)
|
|
141
|
+
to download the GEO data, build those caches and run the comparison.
|
|
142
|
+
|
|
143
|
+
- [Simulation protocol, version 2.0.0](https://doi.org/10.5281/zenodo.24010816):
|
|
144
|
+
the design archived before the formal simulations.
|
|
145
|
+
- [Core results and reproducibility materials](https://doi.org/10.5281/zenodo.24015713):
|
|
146
|
+
the subsequent code and results archive, including PASE 1.1.0.
|
|
147
|
+
- Supplementary Data S1 contains the detection-matched gene analysis.
|
|
148
|
+
Supplementary Data S2 contains the unequal-yield native count benchmark.
|
|
149
|
+
|
|
150
|
+
See [reproduction instructions](https://pase-software.readthedocs.io/en/latest/reproducibility.html)
|
|
151
|
+
for the scope of each workflow and the software test commands.
|
|
152
|
+
|
|
153
|
+
## Citation
|
|
154
|
+
|
|
155
|
+
For this code, cite the authors, PASE software version **1.2.0**, and its
|
|
156
|
+
[release URL](https://github.com/tjw0613-cell/pase-software/releases/tag/v1.2.0).
|
|
157
|
+
Machine-readable author information is in
|
|
158
|
+
[CITATION.cff](https://github.com/tjw0613-cell/pase-software/blob/v1.2.0/CITATION.cff).
|
|
159
|
+
|
|
160
|
+
Code is distributed under the MIT License. The real-data example retains its
|
|
161
|
+
source attribution and third-party terms; see
|
|
162
|
+
[THIRD_PARTY_DATA.md](https://github.com/tjw0613-cell/pase-software/blob/v1.2.0/THIRD_PARTY_DATA.md).
|
|
163
|
+
Report software problems through [GitHub Issues](https://github.com/tjw0613-cell/pase-software/issues).
|
|
164
|
+
|
|
@@ -39,28 +39,38 @@ retain one inference unit per independent patient. Missing IDs are an error.
|
|
|
39
39
|
|
|
40
40
|
`cell_mask` is either a boolean `obs` column or a boolean vector in the same
|
|
41
41
|
order as the cells. Strings such as `"False"`, numeric 0/1 values and missing
|
|
42
|
-
mask values are rejected.
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
mask values are rejected. All observed patient IDs remain in the output even
|
|
43
|
+
when none of their cells satisfy the mask. Use `patient_ids` to retain patients
|
|
44
|
+
whose cells were removed before calling PASE.
|
|
45
45
|
|
|
46
46
|
## Scores, covariates and missing values
|
|
47
47
|
|
|
48
48
|
A string target selects one transformed gene. A list creates a score by
|
|
49
|
-
standardizing each component within the patient
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
49
|
+
standardizing each component within the patient using its sample standard
|
|
50
|
+
deviation (`ddof=1`) and averaging the z scores. A measured gene that is
|
|
51
|
+
constant in the standardization population contributes zero. Missing genes
|
|
52
|
+
raise an error.
|
|
53
|
+
|
|
54
|
+
By default, `standardize_before_mask=True` uses all cells in each patient's
|
|
55
|
+
input with finite anchor and target expression to calculate means and standard
|
|
56
|
+
deviations. The mask then defines which cells enter the association fit. Use
|
|
57
|
+
this order to compare the ungated and gated associations on the same score.
|
|
58
|
+
For example, provide an AnnData object already restricted to quality-filtered
|
|
59
|
+
myeloid cells, and pass the outcome-detection gate as `cell_mask`. Include
|
|
60
|
+
absent patients with `patient_ids` when you prefilter the reference population.
|
|
61
|
+
|
|
62
|
+
Set `standardize_before_mask=False` to compute the score only from the
|
|
63
|
+
mask-selected finite-expression cells, as in PASE 1.1.x. This is useful when
|
|
64
|
+
the mask defines the population in which you want to standardize. The two
|
|
65
|
+
settings agree for ungated fits and for single-gene string targets.
|
|
66
|
+
|
|
67
|
+
In both orders, covariate complete-case filtering follows standardization.
|
|
68
|
+
PASE residualizes the anchor and score on the same numeric covariates and
|
|
69
|
+
intercept within each patient, then correlates the residuals and applies the
|
|
70
|
+
eligibility rules. The caller supplies any outcome-detection gate. PASE accepts
|
|
71
|
+
numeric covariates, including explicit dummy variables.
|
|
72
|
+
For a categorical covariate, create numeric dummy variables with a reference
|
|
73
|
+
category. Passing integer labels such as 0, 1 and 2 instead fits a numeric trend.
|
|
64
74
|
Within each patient's complete cases, nuisance columns are centered and scaled
|
|
65
75
|
for numerical stability. Constant nuisance columns are omitted; the intercept
|
|
66
76
|
is retained. Rank-deficient designs use their numerical rank. Nonfinite values are counted
|
|
@@ -68,6 +68,9 @@ individual intervals in the equal or random-effects forest plot.
|
|
|
68
68
|
|
|
69
69
|
## Saving tables and metadata
|
|
70
70
|
|
|
71
|
+
`result.metadata` records `standardize_before_mask` and the cell population
|
|
72
|
+
used to construct the score in `score_standardization`.
|
|
73
|
+
|
|
71
74
|
```python
|
|
72
75
|
import json
|
|
73
76
|
result.summary().to_csv("summary.tsv", sep="\t", index=False)
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
# Quick start
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Install the published release in a new environment. These commands call that
|
|
4
|
+
environment's Python directly, so no activation step is needed.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Windows PowerShell:
|
|
7
|
+
|
|
8
|
+
```powershell
|
|
6
9
|
python -m venv .venv
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
.\.venv\Scripts\python.exe -m pip install "pase-framework[tutorial]==1.2.0"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
macOS or Linux:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python3 -m venv .venv
|
|
17
|
+
.venv/bin/python -m pip install "pase-framework[tutorial]==1.2.0"
|
|
10
18
|
```
|
|
11
19
|
|
|
12
20
|
The package distribution is `pase-framework`; the Python module is `pase`.
|
|
13
21
|
Use a fresh environment to avoid the unrelated `pase` audio package.
|
|
14
22
|
|
|
23
|
+
Save the following example as `quickstart.py`. Run it with
|
|
24
|
+
`.\.venv\Scripts\python.exe quickstart.py` on Windows or
|
|
25
|
+
`.venv/bin/python quickstart.py` on macOS/Linux.
|
|
26
|
+
|
|
15
27
|
```python
|
|
16
28
|
import pase
|
|
17
29
|
adata = pase.datasets.load_gse234933_demo()
|
|
@@ -30,12 +42,21 @@ This is an interface example using real cells, not a full-cohort analysis.
|
|
|
30
42
|
The four-gene target demonstrates module input; the revised manuscript's main
|
|
31
43
|
biological analysis uses a separately sourced 15-gene signature.
|
|
32
44
|
|
|
33
|
-
Download [the tutorial notebook](https://github.com/tjw0613-cell/pase-software/blob/v1.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
Download [the tutorial notebook](https://github.com/tjw0613-cell/pase-software/blob/v1.2.0/examples/gse234933_quickstart.ipynb)
|
|
46
|
+
into the working directory, then open it with JupyterLab:
|
|
47
|
+
|
|
48
|
+
```powershell
|
|
49
|
+
.\.venv\Scripts\python.exe -m jupyter lab gse234933_quickstart.ipynb
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
On macOS/Linux, replace `.\.venv\Scripts\python.exe` with `.venv/bin/python`.
|
|
53
|
+
If you cloned the repository instead, use
|
|
54
|
+
`examples/gse234933_quickstart.ipynb` as the notebook path. The notebook uses
|
|
55
|
+
the 15-gene target and walks through normalization metadata, exclusions, the
|
|
56
|
+
three summaries, threshold sensitivity and saving results. After installation,
|
|
57
|
+
it needs neither network access nor a separate raw-data download. The
|
|
58
|
+
[full-cohort RNA workflow](https://github.com/tjw0613-cell/pase-reproducibility/tree/main/workflows/rna)
|
|
59
|
+
is separate; its inputs and computing requirements are larger.
|
|
39
60
|
|
|
40
61
|
|
|
41
62
|
## Inspect reporting warnings
|
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## Release records
|
|
4
4
|
|
|
5
|
+
Version 1.2.0 adds the `standardize_before_mask` option. Its default implements
|
|
6
|
+
the manuscript's score-before-gate order. Set it to `False` to reproduce the
|
|
7
|
+
masked module behavior of the 1.1 series.
|
|
8
|
+
|
|
9
|
+
Version 1.1.1 corrected documentation and packaging for 1.1.0.
|
|
10
|
+
|
|
5
11
|
Version 1.1.0 changes reporting defaults and adds precision warnings and a
|
|
6
|
-
model-based planning MDE. See [the changelog](https://github.com/tjw0613-cell/pase-software/blob/v1.
|
|
12
|
+
model-based planning MDE. See [the changelog](https://github.com/tjw0613-cell/pase-software/blob/v1.2.0/CHANGELOG.md)
|
|
7
13
|
and [reporting policy](reporting-policy.md) before upgrading an existing workflow.
|
|
8
|
-
Release artifacts are indexed on [PyPI](https://pypi.org/project/pase-framework/1.
|
|
9
|
-
and [GitHub](https://github.com/tjw0613-cell/pase-software/releases/tag/v1.
|
|
14
|
+
Release artifacts are indexed on [PyPI](https://pypi.org/project/pase-framework/1.2.0/)
|
|
15
|
+
and [GitHub](https://github.com/tjw0613-cell/pase-software/releases/tag/v1.2.0).
|
|
10
16
|
Check the actual [release workflow results](https://github.com/tjw0613-cell/pase-software/actions/workflows/publish.yml)
|
|
11
17
|
for cross-platform tests and upload status; the configuration alone is not proof
|
|
12
18
|
that a run passed.
|
|
@@ -29,9 +35,11 @@ python -m twine check dist/*
|
|
|
29
35
|
```
|
|
30
36
|
|
|
31
37
|
Inspect the actual GitHub Actions results on Linux, macOS and Windows. Fix
|
|
32
|
-
failures before tagging a release. For a future version, update
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
failures before tagging a release. For a future version, update `pyproject.toml`,
|
|
39
|
+
`pase.__version__` and `CITATION.cff`, then use the matching GitHub version tag.
|
|
40
|
+
Keep installation commands, release links and the changelog consistent with
|
|
41
|
+
the version being published. Do not move an existing published tag or replace
|
|
42
|
+
its distributions.
|
|
35
43
|
|
|
36
44
|
## PyPI
|
|
37
45
|
|
|
@@ -47,16 +55,23 @@ The manual **Publish release** workflow uploads to TestPyPI. A **published
|
|
|
47
55
|
GitHub release** triggers the same tests and then uploads to PyPI. The publisher
|
|
48
56
|
uses OIDC, not a password stored in the repository. After public upload,
|
|
49
57
|
verify the project page, download the published distribution and repeat the
|
|
50
|
-
|
|
58
|
+
quick example in a fresh environment using:
|
|
51
59
|
|
|
52
60
|
```bash
|
|
53
|
-
python -m pip install pase-framework==1.
|
|
61
|
+
python -m pip install pase-framework==1.2.0
|
|
54
62
|
```
|
|
55
63
|
|
|
56
64
|
Repeat the clean installation check for each future version before updating
|
|
57
65
|
its installation instructions. See the official
|
|
58
66
|
[Trusted Publisher guide](https://docs.pypi.org/trusted-publishers/using-a-publisher/).
|
|
59
67
|
|
|
68
|
+
PyPI displays the README packaged with a release. Editing the GitHub README
|
|
69
|
+
does not update an already published distribution. A documentation-only patch
|
|
70
|
+
release can carry corrected instructions without changing statistical code;
|
|
71
|
+
state that scope in its changelog and retain the earlier release. PyPI does
|
|
72
|
+
not allow an existing distribution filename to be reused. See
|
|
73
|
+
[PyPI upload troubleshooting](https://docs.pypi.org/publishing/troubleshooting/).
|
|
74
|
+
|
|
60
75
|
## Read the Docs
|
|
61
76
|
|
|
62
77
|
The project is [pase-software](https://app.readthedocs.org/projects/pase-software/).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Reporting policy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
PASE uses the number of **eligible patients for the selected method**
|
|
4
4
|
to decide what to report. The attempted cohort size cannot satisfy this check.
|
|
5
5
|
These defaults are result-informed reporting choices, not validated guarantees.
|
|
6
6
|
|
|
@@ -41,10 +41,9 @@ registered floor-2/4/6 counts. This verifies the extraction of the policy
|
|
|
41
41
|
evidence, not the statistical adequacy of the chosen reporting rules.
|
|
42
42
|
|
|
43
43
|
The formal main workflow used a fixed 15-gene outcome and depth-only
|
|
44
|
-
adjustment.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
it does not reproduce the formal outcome gate applied after score construction.
|
|
44
|
+
adjustment. Other choices of genes, covariates, normalization and cell masks
|
|
45
|
+
can change coverage. PASE 1.2.0 defaults to standardizing before applying
|
|
46
|
+
`cell_mask`, the order used in the manuscript's gated analysis.
|
|
48
47
|
|
|
49
48
|
## Planning MDE
|
|
50
49
|
|
|
@@ -4,8 +4,25 @@ This repository supplies the software API, tests and a teaching dataset.
|
|
|
4
4
|
The separate [pase-reproducibility repository](https://github.com/tjw0613-cell/pase-reproducibility) supplies manuscript figure
|
|
5
5
|
scripts and the inputs used by those scripts.
|
|
6
6
|
|
|
7
|
+
## Find the right materials
|
|
8
|
+
|
|
9
|
+
| Material | Where to find it | What it covers |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| PASE 1.2.0 software | [GitHub release](https://github.com/tjw0613-cell/pase-software/releases/tag/v1.2.0) and [PyPI](https://pypi.org/project/pase-framework/1.2.0/) | The reusable API and teaching dataset. The public API supports the manuscript's reference population and score-then-gate order. |
|
|
12
|
+
| Simulation protocol 2.0.0 | [Zenodo 24010816](https://doi.org/10.5281/zenodo.24010816) | The design archived before the formal simulations. |
|
|
13
|
+
| Core results and reproduction materials | [Zenodo 24015713](https://doi.org/10.5281/zenodo.24015713) | The subsequent software and results deposit; it includes PASE 1.1.0. |
|
|
14
|
+
| Full 15-gene RNA analyses | [RNA workflow](https://github.com/tjw0613-cell/pase-reproducibility/tree/main/workflows/rna) | Input downloads, signature source, preprocessing, fitting and result comparisons for the three cohorts. |
|
|
15
|
+
| Public API reproduction | [Example script](https://github.com/tjw0613-cell/pase-reproducibility/blob/main/workflows/h/public_api_example.py) and [workflow instructions](https://github.com/tjw0613-cell/pase-reproducibility/tree/main/workflows/h) | Compares the public API with archived patient effects and cohort summaries using caches built from the GEO data. |
|
|
16
|
+
| Supplementary Data S1 and S2 | Files accompanying the revised manuscript | Detection-matched gene controls and the unequal-yield native count benchmark. These later analyses are not in the core-results DOI above. |
|
|
17
|
+
|
|
18
|
+
The four-gene README example demonstrates the interface. The notebook uses
|
|
19
|
+
the 15-gene list on a small subset; neither example reproduces the full RNA
|
|
20
|
+
cohort analyses. Use the RNA workflow for those results.
|
|
21
|
+
|
|
7
22
|
## Test the software
|
|
8
23
|
|
|
24
|
+
In a repository checkout, using its Python environment:
|
|
25
|
+
|
|
9
26
|
```bash
|
|
10
27
|
python -m pip install ".[test]"
|
|
11
28
|
python -m pytest
|
|
@@ -14,11 +31,12 @@ python -m pytest
|
|
|
14
31
|
Tests cover independent calculation examples, sparse/dense parity, patient
|
|
15
32
|
exclusions, cell duplication, model boundaries, input validation and lack of
|
|
16
33
|
input mutation. The CI configuration requests Linux, macOS and Windows runs
|
|
17
|
-
across Python versions.
|
|
18
|
-
have passed; use the actual run logs for that claim.
|
|
34
|
+
across Python versions. See the [CI run logs](https://github.com/tjw0613-cell/pase-software/actions/workflows/tests.yml).
|
|
19
35
|
|
|
20
36
|
## Run the tutorial
|
|
21
37
|
|
|
38
|
+
From the same checkout and environment:
|
|
39
|
+
|
|
22
40
|
```bash
|
|
23
41
|
python -m pip install ".[tutorial]"
|
|
24
42
|
python scripts/run_tutorial.py --output tutorial-output
|