Skip to main content

PASE

PASE estimates molecular associations within individual patients and summarizes them across a single-cell cohort.

Read the online documentation for installation, the API and the statistical meaning of each parameter.

Installation

Use Python 3.10 or later in a fresh environment. Install the published release from PyPI.

Windows PowerShell:

python -m venv .venv
.\.venv\Scripts\python.exe -m pip install pase-framework==1.2.0

macOS or Linux:

python3 -m venv .venv
.venv/bin/python -m pip install pase-framework==1.2.0

These commands run Python directly from the new environment.

The distribution is named pase-framework, but the Python import is pase. The unrelated audio package named pase on PyPI uses the same import name; do not install both in one environment. The v1.2.0 release is also available on GitHub. For development, clone this repository and use python -m pip install -e ".[test]".

Quick example

Save this as quickstart.py:

import pase
adata = pase.datasets.load_gse234933_demo()
res = pase.associate(
    adata, anchor="LILRB4", target=["MMP14", "MMP9", "SPP1", "APOE"],
    patient_key="donor", covariates=["log_depth"], cell_mask="myeloid",
    aggregate="equal", min_cells=30,
)
print(res.summary().to_string(index=False))
print(res.patients[["patient_id", "n_cells", "r", "eligible", "reason"]])
ax = res.plot_forest()
ax.figure.savefig("association.pdf", bbox_inches="tight")

Run it with .\.venv\Scripts\python.exe quickstart.py on Windows or .venv/bin/python quickstart.py on macOS/Linux. It prints the cohort summary and patient table and saves a forest plot as association.pdf.

The example uses four genes from the bundled GSE234933 teaching dataset. The tutorial notebook uses the manuscript's 15-gene score on the same subset. For the complete cohort analyses, use the RNA workflow. See the quick-start guide for notebook installation and execution.

Input format

Supply an AnnData object with cells in rows and unique gene names in adata.var_names. adata.X, or the requested layer, must already contain transformed expression. For count data, the tutorial uses log1p(10000 * count / total_counts) with totals calculated before selecting genes. associate does not normalize raw counts.

Input Meaning
adata.obs["donor"] Independent patient ID, with no missing values. Repeated samples from one patient must share an ID.
adata.obs["log_depth"] Numeric covariate; the tutorial uses log1p(total_counts) from the full matrix.
adata.obs["myeloid"] Boolean cell-selection column. Patients with no selected cells remain in the output.
anchor One gene name.
target One gene name, or a list whose within-patient gene z scores are averaged.
standardize_before_mask True uses all input cells with complete expression in each patient as the standardization reference. False uses the mask-selected cells.

For the gated manuscript analysis, supply the ungated myeloid population as the input and pass the detection gate as cell_mask. In version 1.2.0 the module score uses the same reference population in the ungated and gated fits by default. Set standardize_before_mask=False to recover the masked-score behavior of PASE 1.1.x. This option changes only the scaling of masked gene lists. See score construction.

Covariates enter a separate least-squares model for each patient, with an intercept. Encode categorical covariates as numeric dummy variables; integer labels such as 0, 1 and 2 are otherwise treated as a numeric covariate. Patients absent from the object can be retained using patient_ids. See the input guide for missing values and eligibility rules.

Outputs and choice of summary

res.patients reports every patient, cell counts, observed correlation, eligibility, exclusion reasons and, where applicable, weights or shrunken effects. res.summary() returns one row with the selected method, target, estimate, interval, P value and status. res.metadata records the analysis settings and warnings. res.plot_forest() returns a Matplotlib Axes.

aggregate What it reports
"equal" Arithmetic mean of eligible patients' observed correlations, with a t interval. Each eligible patient has equal weight.
"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.
"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.

REML means restricted maximum likelihood; HKSJ is the Hartung–Knapp–Sidik–Jonkman interval adjustment; EB means empirical Bayes. See the output guide for field definitions and warning codes.

min_cells=30 is adjustable. Version 1.1.0 changes the default min_patients from 2 to 6. Below the selected method's eligible-patient threshold, PASE returns observed patient correlations, descriptive summaries and exclusion reasons, but withholds inferential estimates, intervals and P values. An explicit lower threshold is allowed and recorded as an override.

Reported inference receives a small-cohort warning below 20 eligible patients and a precision warning when the full correlation-scale interval is wider than max_ci_width=0.2. Warnings retain the interval. The patient boundaries are result-informed reporting choices, and 0.2 is a configurable practical tolerance; none guarantees calibrated coverage. See the reporting policy and its evidence.

For the equal-patient mean, an externally specified planning_sd enables a model-based minimum detectable effect (MDE). Record its origin with planning_sd_source; set minimum_relevant_effect to compare the MDE with a scientifically meaningful effect. This is a planning calculation, not achieved power, and is not provided for Fisher or EB targets.

Reproduce the manuscript

The reproduction repository contains figure commands and the full 15-gene RNA workflow. The public API example recreates the manuscript's RNA associations from the prepared cohort caches. Use the workflow instructions to download the GEO data, build those caches and run the comparison.

See reproduction instructions for the scope of each workflow and the software test commands.

Citation

For this code, cite the authors, PASE software version 1.2.0, and its release URL. Machine-readable author information is in CITATION.cff.

Code is distributed under the MIT License. The real-data example retains its source attribution and third-party terms; see THIRD_PARTY_DATA.md. Report software problems through GitHub Issues.

Metadata

Release files for pase-framework 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pase-framework 1.2.0
File Size Uploaded Provenance Actions
pase_framework-1.2.0.tar.gz 112.2 kB With provenance Details for pase_framework-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pase-framework 1.2.0
File Interpreter ABI Platform Actions
pase_framework-1.2.0-py3-none-any.whl Python 3 none any Details for pase_framework-1.2.0-py3-none-any.whl

Total release size: 189.9 kB

Release files / pase_framework-1.2.0.tar.gz

Download URL pase_framework-1.2.0.tar.gz
Size 112.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bf07f159cc3ee6585ec928cc69c4caf128eebf63e2e0e9ff15e9c6da57f714f1
BLAKE2b-256 checksum
How to use checksums
02a851c6c7dff27ec98aead1f881efee72371a64df6b41bb425d395ee344ff41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

Release files / pase_framework-1.2.0-py3-none-any.whl

Download URL pase_framework-1.2.0-py3-none-any.whl
Size 77.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5b7914c61e3228d1a0159a6b9df2c4e016f8726a6ae63082f0deb8d77ab8b29
BLAKE2b-256 checksum
How to use checksums
80e69a613694d632873e4b1018dba8fbf1503059f7f7d8385863d430171b5453
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

Security for pase-framework 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pase_framework-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page