Skip to main content

compatpower

tests DOI

Power, equivalence and design of in vitro compatibility assays between biological control agents and pesticides.

In vitro compatibility assays (for example, colony-forming units of an entomopathogenic fungus on medium with a pesticide) are often run on a single day with 3–5 plates per treatment. "Compatible" is then declared when the treatment does not differ significantly from the control. compatpower simulates such assays to answer three planning questions:

  • How likely is my design to detect a given reduction (power)?
  • How likely is it to demonstrate compatibility with an equivalence test (TOST on the treatment/control ratio)?
  • Given a fixed number of plates, how should I split them into independent runs (days) and plates per run?

Model

Plate counts follow a negative binomial (variance = μ + μ²/k). Each run (day) shifts both groups by a random effect (sd_run). The product effect may vary between runs, which is the run × treatment interaction (tau). Analyses compared:

  • run: the run is the experimental unit (paired t test on per-run log mean differences). This is recommended and keeps the nominal error rate.
  • pooled: plates are treated as replicates, as is common practice. Error inflates when tau > 0.
  • blocked: plates with the run as a block, equivalent to a random-run-intercept mixed model.

Install

pip install compatpower            # after release
pip install git+https://github.com/siriani/compatpower

Quick start

from compatpower import AssayModel, power, equivalence, design_table, allocate, estimate_model

m = AssayModel(mu0=25, k=4.3, sd_run=0.48, tau=0.15)   # defaults: CFU of a B. bassiana isolate
power(runs=6, plates=10, reduction=0.3, model=m)          # ~0.70
equivalence(runs=8, plates=20, margin=(0.75, 1/0.75), model=m)
allocate(total_plates=60, reduction=0.3, model=m)         # 2x30 vs 10x6 vs 20x3 ...
design_table(model=m)                                     # runs x plates table

import pandas as pd                                      # your own counts: run, group, count [, product]
model, report = estimate_model(pd.read_csv("my_counts.csv"))

Command line:

compatpower power --runs 6 --plates 10 --reduction 0.3
compatpower allocate --total 60
compatpower table --out design.csv
compatpower estimate examples/example_counts.csv

Defaults and caveats

The default parameters are estimated from CFU counts of Beauveria bassiana isolate IBCB 170 over three runs. sd_run is imprecise (three runs), and tau was assumed (0.15), because it can be estimated only when the same product is tested in several runs. Estimate the parameters from your own data whenever possible (estimate_model). Analyses use log(count + 0.5). A negative binomial mixed model is the natural alternative for final analyses.

Citation

Siriani ALR, Leite SMM. compatpower: power, equivalence and design of in vitro compatibility assays between biological control agents and pesticides (version 0.1.0). Zenodo; 2026. https://doi.org/10.5281/zenodo.24380785

Please also cite the accompanying article (in preparation).

License

MIT

Metadata

Release files for compatpower 0.1.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 compatpower 0.1.0
File Size Uploaded Provenance Actions
compatpower-0.1.0.tar.gz 10.3 kB Without provenance Details for compatpower-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for compatpower 0.1.0
File Interpreter ABI Platform Actions
compatpower-0.1.0-py3-none-any.whl Python 3 none any Details for compatpower-0.1.0-py3-none-any.whl

Total release size: 21.5 kB

Release files / compatpower-0.1.0.tar.gz

Download URL compatpower-0.1.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f85035a417ca0c97e4866e912d432141108ca43e6b2efb979490d7d3a545b5af
BLAKE2b-256 checksum
How to use checksums
00eae21aaec7f552b5d8d47b83308c9ab85ab03acc2ced0e0513722049ce42ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / compatpower-0.1.0-py3-none-any.whl

Download URL compatpower-0.1.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8e0e29022692ff62c665ef6248202df1b2e8f9b9881158362872f15c8c1ba45
BLAKE2b-256 checksum
How to use checksums
866f4b801295a20b8e2385ebe14599c10d0d67f8b7032b8a16e743e47e78b111
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for compatpower 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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