Metadata-Version: 2.5
Name: mic-50-90
Version: 1.0.3
Summary: A Python package for bounding MIC distributions from incomplete susceptibility reports
Project-URL: Documentation, https://github.com/maciejkochanowski/mic-50-90/blob/main/docs/GUI_GUIDE.md
Project-URL: Homepage, https://github.com/maciejkochanowski/mic-50-90
Project-URL: Repository, https://github.com/maciejkochanowski/mic-50-90
Project-URL: Issues, https://github.com/maciejkochanowski/mic-50-90/issues
Author-email: Maciej Kochanowski <maciej.kochanowski@piwet.pulawy.pl>
License-Expression: MIT
License-File: LICENSE.txt
Keywords: MIC50,MIC90,antimicrobial resistance,antimicrobial susceptibility reporting,minimum inhibitory concentration,partial identification,surveillance
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: numpy>=1.26
Requires-Dist: scipy>=1.13
Provides-Extra: all
Requires-Dist: curl-cffi>=0.7; extra == 'all'
Requires-Dist: duckdb>=1.1; extra == 'all'
Requires-Dist: hatchling>=1.27; extra == 'all'
Requires-Dist: hypothesis>=6.110; extra == 'all'
Requires-Dist: ipykernel>=6.29; extra == 'all'
Requires-Dist: jsonschema>=4.22; extra == 'all'
Requires-Dist: lxml>=5.3; extra == 'all'
Requires-Dist: matplotlib>=3.8; extra == 'all'
Requires-Dist: nbclient>=0.10; extra == 'all'
Requires-Dist: nbformat>=5.10; extra == 'all'
Requires-Dist: openpyxl>=3.1; extra == 'all'
Requires-Dist: pandas>=2.2; extra == 'all'
Requires-Dist: pyarrow>=17; extra == 'all'
Requires-Dist: pytest-cov>=5.0; extra == 'all'
Requires-Dist: pytest>=8.2; extra == 'all'
Requires-Dist: python-docx>=1.1; extra == 'all'
Provides-Extra: benchmark
Requires-Dist: curl-cffi>=0.7; extra == 'benchmark'
Requires-Dist: duckdb>=1.1; extra == 'benchmark'
Requires-Dist: ipykernel>=6.29; extra == 'benchmark'
Requires-Dist: lxml>=5.3; extra == 'benchmark'
Requires-Dist: matplotlib>=3.8; extra == 'benchmark'
Requires-Dist: nbclient>=0.10; extra == 'benchmark'
Requires-Dist: nbformat>=5.10; extra == 'benchmark'
Requires-Dist: openpyxl>=3.1; extra == 'benchmark'
Requires-Dist: pandas>=2.2; extra == 'benchmark'
Requires-Dist: pyarrow>=17; extra == 'benchmark'
Requires-Dist: python-docx>=1.1; extra == 'benchmark'
Provides-Extra: test
Requires-Dist: duckdb>=1.1; extra == 'test'
Requires-Dist: hatchling>=1.27; extra == 'test'
Requires-Dist: hypothesis>=6.110; extra == 'test'
Requires-Dist: jsonschema>=4.22; extra == 'test'
Requires-Dist: pandas>=2.2; extra == 'test'
Requires-Dist: pytest-cov>=5.0; extra == 'test'
Requires-Dist: pytest>=8.2; extra == 'test'
Description-Content-Type: text/markdown

# MIC-50-90 1.0.3

Version **1.0.3** publishes a container image with each release; its computations and results are those of 1.0.2 (see `CHANGELOG.md`). The release files and their checksums are attached to the [GitHub release](https://github.com/maciejkochanowski/mic-50-90/releases/tag/v1.0.3) and archived at Zenodo.

MIC-50-90 is a Python package for bounding MIC distributions from incomplete susceptibility reports. Published antimicrobial susceptibility results often give only MIC50, MIC90, a range and a few percentages. From these, and from exact or rounded counts, MIC-50-90 computes the smallest and largest count the report allows in every MIC category and range, names the count that would narrow an open question most, selects counts a laboratory can publish so that readers can check its conclusions, and gives optional population bounds under stated sampling assumptions. A local browser form, a Windows application, the command line and the Python interface use the same calculation engine.

Use it to interpret an unreported concentration range, distinguish missing counts from measurement censoring, determine which additional counts would resolve a question, or prepare a short laboratory report whose conclusions a recipient can verify. Inputs refer to the same original isolates and retain their denominator, panel, units and reporting convention.

## Install and start

Use Python 3.11–3.13 in a separate environment. The release checksums identify the published files; the release workflow records the operating systems and Python versions on which they were tested.

Install from PyPI with the Python interpreter of that environment:

```text
python -m pip install mic-50-90==1.0.3
mic-50-90 gui
```

To install from a source checkout, run `python -m pip install .` from its root directory. The guided form opens in your local browser; use **Quit application** to stop it.

A portable Windows application is part of a release only when the release workflow attaches it together with its build and browser-test receipts. Earlier releases keep their own files and validation records.

Each release is also published as a container image that already contains Python and all dependencies, so only Docker or another container runtime is needed. On Linux or macOS, this runs the program on files in the current folder:

```text
docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/data" -w /data ghcr.io/maciejkochanowski/mic-50-90:1.0.3 mic-50-90 --help
```

Started without a command, the container runs the software checks.

To inspect the command-line interface:

```text
mic-50-90 --help
mic-50-90 distribution --help
```

Download the source archive for the example inputs, schemas and documentation. From its extracted directory, run:

```text
mic-50-90 distribution examples/distribution/summaries.json --precision-pp 10 --output-dir output/distribution
```

Open the generated `report.html`. Reports also provide CSV/JSON results and reusable input settings. The wheel installs the application and library; the software source release supplies the tests, formal checks, examples and user documentation.

## Choose the inference you need

| Question | Result | Requirements |
|---|---|---|
| What follows about these isolates? | Sharp finite-sample bounds over the distributions compatible with the report | Truthful summaries, ranks, panel geometry and category definitions |
| What follows about the source population? | Simultaneous confidence bounds accounting for incomplete reporting and sampling uncertainty | Independent observations from the same distribution, a declared population and confidence level |
| What is covered for a new study unit? | Calibrated bounds for the quantities in the declared protocol | Exchangeable study units and a matching reference, score, unit and calibration contract |

These layers answer different questions. Complete category counts can still leave concentrations uncertain inside measurement intervals. Optional likelihood, Bayesian, entropy and reference-based analyses report their additional assumptions. Incomplete numerical searches retain valid available bounds and their explicit completion status.

## Practical workflows

- Analyse published MIC summaries or counts, including several declared rank interpretations when necessary.
- Add a count from the original collection and update the analysis while preserving previous truthful information.
- Select contiguous concentration groups at a requested sample or population precision.
- Plan one request or successive requests for additional counts, with explicit permitted questions and costs.
- Select sufficient counts from complete category counts so a recipient can verify the stated sample conclusions.
- Prepare and assess study-unit calibration with its own reference and sampling requirements.

The main mathematical result gives a checkable P6 endpoint-attainment condition: when it holds, a selected family of compatible count tables attains the same population-range endpoints as considering every compatible table for the fixed confidence construction. Written proofs, independent numerical checks and 29 Lean-checked algebraic declarations have distinct roles; the Lean development does not certify the entire program or all statistical assumptions.

## Documentation and checks

### What the repository contains

| Folder | Purpose |
|---|---|
| `src` | Calculation engine, CLI, Windows application and report resources |
| `tests` | Automated checks of calculations, input handling and interfaces |
| `tools` and `.github/workflows` | Build, test and publish the software packages |
| `docs` and `schemas` | Installation, usage, input formats and output definitions |
| `examples` and `data` | Small example inputs, source attribution and data terms |
| `formal` and `reproducibility` | Formal algebra and independent checks of the implemented calculations |
| `evaluation` | Inputs, scripts and result tables of the comparisons reported in the article |
| `scripts` | Source manifest, source bundle, archive installation check, command reference and document claim check |

The Windows application and CLI use the same calculation engine. Article-production files are maintained outside this repository.

- [Windows user guide](https://github.com/maciejkochanowski/mic-50-90/blob/main/docs/GUI_GUIDE.md): installation, data entry, saved analyses and reports.
- [Distribution guide](https://github.com/maciejkochanowski/mic-50-90/blob/main/docs/distribution-user-guide.md): an end-to-end CLI analysis and interpretation.
- [CLI reference](https://github.com/maciejkochanowski/mic-50-90/blob/main/docs/CLI_REFERENCE.md): every command and option.
- [Python interface](https://github.com/maciejkochanowski/mic-50-90/blob/main/docs/PYTHON_INTERFACE.md): callable analysis functions and update contracts.
- [Report contents](https://github.com/maciejkochanowski/mic-50-90/blob/main/docs/REPORT_CONTENTS.md): results, numerical checks and exports.
- [Public functions](https://github.com/maciejkochanowski/mic-50-90/blob/main/docs/PUBLIC_FUNCTIONS.md): tasks, implementation and independent checks.
- [Reproducing software checks](https://github.com/maciejkochanowski/mic-50-90/blob/main/docs/REPRODUCING_RESULTS.md) and [formal algebra](https://github.com/maciejkochanowski/mic-50-90/blob/main/formal/README.md).

The GitHub Actions workflow tests installed packages on Windows and Linux with Python 3.11–3.13. The release workflow builds the Python and Windows packages, checks their contents and attaches only software assets. Consult the completed Actions run and the release checksums for the exact distributed files.

Manuscripts, supplementary appendices and editorial figures are maintained separately. They are not included in this repository, its software release assets, or a software deposit generated from this repository. [Distribution policy](https://github.com/maciejkochanowski/mic-50-90/blob/main/docs/DISTRIBUTION_POLICY.md).

## Scientific scope and license

MIC-50-90 supports research and reporting audits. It does not infer clinical breakpoints, classify individual susceptibility or recommend treatment. Results depend on correct metadata and the assumptions attached to the chosen inference layer.

The software is distributed under **MIT**. Example data, source publications and bundled fonts retain their own attributed terms; some publication examples have noncommercial source terms. Source URLs, hashes and exclusions are documented in `docs/DATA_TERMS.md` and `data/LICENSES.md`. The software license does not relicense third-party material.

Author: **Maciej Kochanowski**, Department of Bacteriology and Bacterial Diseases, National Veterinary Research Institute, Puławy, Poland. [ORCID 0000-0002-9982-3028](https://orcid.org/0000-0002-9982-3028). Use `CITATION.cff` for citation metadata. Archived releases: [doi:10.5281/zenodo.23297915](https://doi.org/10.5281/zenodo.23297915). Report issues through the [GitHub issue tracker](https://github.com/maciejkochanowski/mic-50-90/issues).
