Python Assay Suite for quick and reproducible assay analyses in python.
Project description
pySaySuite
python asSay Suite for quick, robust and reproducible assay analyses in python.
Installation (general)
The package can be obtained from PyPI:
pip install pySaySuite
qPCR module
Standardized, reproducible qPCR differential-expression analysis for the lab. One canonical, tested implementation of the ANCOVA / multivariable-linear-model method of
Hampton et al., Analyzing qPCR data: better practices to facilitate rigor and reproducibility, Biochem. Biophys. Rep. 44 (2025) 102356.
The statistical method is theirs; this package ports it to Python for Applied Biosystems ViiA 7 / QuantStudio exports.
Details
The module is qPCR-focused and reproduces the published better practices paper 1:1
(Tables 3 & 4 ANCOVA to 3 dp, geNorm conclusion, GAPDH–MMP10 correlation, and the
amplification efficiencies 1.53/1.57 to ~1e-6 against the qpcR R oracle). The whole
analysis is a short, curated set of functions in two modules:
pysaysuite.qpcr.core— the headline pipeline:read_plates({name: path}, kind="results"|"amplification", batch_map=None)— ingest QuantStudio/ViiA 7 exports into a tidy long table, retaining plate identity (D9).assign_group(long, group)— configurable sample→group assignment (prefix-dict / callable / layout table), flagging unmatched samples instead of silently grouping them.build_wide(long, ...)— collapse technical replicates to mean CT; flag noisy replicate groups (wide.attrs["noisy_replicates"], D11).run_ancova(wide, targets, refs, ...)— per-target ANCOVA on raw CT, returning a tidy coefficient DataFrame (one row per model term). Supports aformula=override andreference="gmean"(default) / a gene name /"separate"(D3); BH-FDR across the panel (D5) and an observations-per-parameter guard (D8).check_identifiability(...)— Group⊥plate separability (D6);run_ancovaalso warns on confounded designs automatically.
pysaysuite.qpcr.qc— quality screens and efficiency-based cross-checks:genorm2— geNorm M reference selection, a 1:1 port ofctrlGene::geNorm2(D14).reference_stability,target_reference_correlation— reference QC.estimate_eff(amp, design=..., method="spline")— per-gene efficiency; the optionaldesign=metadata join restricts the screen to real sample wells (drops NTC/water), which is what makes the published 1.53/1.57 reproduce exactly. Two estimators are kept and never conflated (D15):well_efficiency_spline(qpcR-faithful) andwell_efficiency(a robust, baseline-subtracted LinRegPCR screen).run_ancova_efficiency— ANCOVA on efficiency-weighted CT (robustness variant).pfaffl_compare— Pfaffl / 2^-ΔΔCt efficiency-corrected cross-check (D7).
pysaysuite.qpcr.plot/pysaysuite.qpcr.report— figures (forest, efficiency, reference stability, diagnostics, covariate, Pfaffl) and the methods-stamp / output writers (D10).pysaysuite.Config— typed analysis config, loadable from TOML.pysaysuite.core— intentionally empty for now; a shared cross-assay layer is premature with only the qPCR module present (each assay's input differs), and is deferred until a second assay lands (D12).
The headline functions are also re-exported at the top level:
from pysaysuite import read_plates, build_wide, run_ancova, genorm2, estimate_eff, ....
Quickstart
import pysaysuite as ps
# 1. Ingest QuantStudio exports (one entry per plate) and assign groups.
long = ps.read_plates({"Plate1": "plate1.xls", "Plate2": "plate2.xls"})
long = ps.assign_group(long, {"N": "Control", "T": "Case"}) # by sample-name prefix
# 2. Reference-gene QC and selection.
wide = ps.build_wide(long)
stability = ps.genorm2(wide, ["RNU48", "U6", "GAPDH"]) # geNorm M ranking
# 3. Headline differential expression (ANCOVA on raw CT, geometric-mean reference).
result = ps.run_ancova(wide, targets=["MIR-21", "MIR-331"], refs=["RNU48", "U6"])
groups = result[result["is_group_effect"]] # one row per target
print(groups[["target", "estimate", "p_value", "p_fdr", "direction"]])
# 4. (Optional) efficiency screen + Pfaffl cross-check.
amp = ps.read_plates({"Plate1": "plate1.xls"}, kind="amplification")
eff = ps.estimate_eff(amp, design=long[["well"]].drop_duplicates())
xchk = ps.pfaffl_compare(wide, ["MIR-21"], ["RNU48", "U6"], eff, result)
run_ancova returns a tidy table with columns target, term, estimate, se, t, p_value, is_group_effect, p_fdr, direction, n, n_params, obs_per_param, r2_adj; the analysis
parameters for the methods stamp live in result.attrs["params"].
Reproduce the paper, 1:1
docs/qpcr_examples/qpcr_paper_replication_pysaysuite.ipynb runs the package end-to-end on
Hampton et al.'s own data (docs/qpcr_examples/data/) and asserts, in-notebook, that every
result matches the published values: Tables 3 & 4 (ANCOVA), the geNorm conclusion, the
GAPDH–MMP10 correlation, and the GAPDH/MMP10 amplification efficiencies. Execute it with:
conda run -n pysaysuite jupyter nbconvert --to notebook --execute --inplace \
docs/testfiles/qpcr_paper_replication_pysaysuite.ipynb
Install (for development)
The package is developed in its own conda environment:
conda create -n pysaysuite python=3.12 -y
conda activate pysaysuite
pip install -e ".[dev]"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysaysuite-0.2.2.tar.gz.
File metadata
- Download URL: pysaysuite-0.2.2.tar.gz
- Upload date:
- Size: 489.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3af1d2e9878d77d5af4f0d207fc2b12eb52450f7f48bed818c360a9a747a602
|
|
| MD5 |
8a64c9a65737e642e9f8e91b90de4023
|
|
| BLAKE2b-256 |
8fa41de072976c6cfd17064ebaec1e98e5b76cbccf6e594db415ec3df2875fba
|
Provenance
The following attestation bundles were made for pysaysuite-0.2.2.tar.gz:
Publisher:
publish.yml on hasanalsharoh/pySaySuite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysaysuite-0.2.2.tar.gz -
Subject digest:
e3af1d2e9878d77d5af4f0d207fc2b12eb52450f7f48bed818c360a9a747a602 - Sigstore transparency entry: 1704118211
- Sigstore integration time:
-
Permalink:
hasanalsharoh/pySaySuite@4a4794af5ae5d149e3f9b235faebbc707ce7e92d -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/hasanalsharoh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4a4794af5ae5d149e3f9b235faebbc707ce7e92d -
Trigger Event:
release
-
Statement type:
File details
Details for the file pysaysuite-0.2.2-py3-none-any.whl.
File metadata
- Download URL: pysaysuite-0.2.2-py3-none-any.whl
- Upload date:
- Size: 35.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70bf57824884a139d1e6b1fc18032a4b8dfb2e1d023b097c6ccd41123e48faf1
|
|
| MD5 |
5f62f56abc771e804bcd0a69ccfddf9e
|
|
| BLAKE2b-256 |
93c59f81ccc28942ced9e941ebfe2fa6b9587703c22138ee14516bba44d2a15c
|
Provenance
The following attestation bundles were made for pysaysuite-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on hasanalsharoh/pySaySuite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysaysuite-0.2.2-py3-none-any.whl -
Subject digest:
70bf57824884a139d1e6b1fc18032a4b8dfb2e1d023b097c6ccd41123e48faf1 - Sigstore transparency entry: 1704118257
- Sigstore integration time:
-
Permalink:
hasanalsharoh/pySaySuite@4a4794af5ae5d149e3f9b235faebbc707ce7e92d -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/hasanalsharoh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4a4794af5ae5d149e3f9b235faebbc707ce7e92d -
Trigger Event:
release
-
Statement type: