Automated Mycobacterial Growth Detection Algorithm (AMyGDA)
AMyGDA analyses photographs of antibiotic-containing 96-well plates, estimates growth in each well, and infers minimum inhibitory concentrations (MICs).
A paper describing the software and demonstrating its reproducibility and accuracy is available in Microbiology.
This is a major release and the CLI uses a proper verb structure so is different to earlier versions!
AMyGDA has been used to analyse all images of all the 96-well plates from the CRyPTIC project; each was inoculated with a sample of M. tuberculosis and incubated for two weeks. Where possible, a minimum inhibitory concentration (MIC) for each drug was estimated -- these are referred to as AMYGDA_DILUTION in the UKMYC_PHENOTYPES table in the current release (v3.4.0) of the CRyPTIC datatables which are freely available on Zenodo.
Installation
AMyGDA now uses modern Python packaging via pyproject.toml.
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
Running the CLI
amygda run examples/sample-images/01/image-01-raw.png
Subcommands:
amygda filter IMAGEamygda segment IMAGEamygda measure IMAGEamygda run IMAGEamygda strips IMAGEamygda panels IMAGE
Useful options:
measureandrunaccept--plate_design UKMYC5--growth_pixel_threshold 130--growth_percentage 2--measured_region 0.5--sensitivity 4
Stage outputs:
filterreads the exact image you pass and writes an image with-filteredappended to the stemsegmentreads the exact image you pass, writes a matching-arrays.npz, and only writes-segmentedif you pass--save-segmented-imagemeasurereads the exact image you pass, loads the matching-arrays.npz, and writes an image with-growthappended to the stemstripsreads a filtered image plus the matching segmented arrays and automatically saves one horizontal*-DRUG-panel.pngimage per drugpanelsdoes the same asstripsbut also includes the positive control wells above the drug strip, left-aligned, to help downstream machine-learning workflows- existing stage suffixes are replaced rather than accumulated, so segmenting
image-filtered.pngproducesimage-segmented.png runexecutes all three stages in sequence in memory, producing*-filtered,*-growth, and the segmentation arrays, with*-segmentedonly if--save-segmented-imageis supplied
Library usage
from amygda import PlateMeasurement
plate = PlateMeasurement(
"examples/sample-images/01",
categories={"ImageFileName": "image-01"},
plate_design="UKMYC5",
)
plate.load_image("-raw.png")
plate.mean_shift_filter()
plate.equalise_histograms_locally()
plate.stretch_histogram()
plate.save_image("-filtered.jpg")
Development
Run the tests with:
pytest
Run linting and type checks with:
ruff check .
mypy
Compatibility notes
The legacy PlateMeasurement constructor arguments new, tags, and
configuration_path are still accepted for compatibility, but they now emit
deprecation warnings and no longer affect behavior.
Plate designs
Plate layouts live in amygda/config/ and are shipped as package data. Each design is defined by three matrices:
*-drug-matrix.txt*-conc-matrix.txt*-dilution-matrix.txt
Adding a new plate design means adding a matching set of those files.
Licence
The software is available subject to the terms of the attached academic-use licence.
Metadata
Release files for amygda 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| amygda-2.1.0.tar.gz | 28.2 kB | Without provenance | Details for amygda-2.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| amygda-2.1.0-py3-none-any.whl | Python 3 | none | any | Details for amygda-2.1.0-py3-none-any.whl |
Total release size: 55.4 kB
Release files / amygda-2.1.0.tar.gz
| Download URL | amygda-2.1.0.tar.gz |
|---|---|
| Size | 28.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a90112766788d70914f1bfaa0d10f6fbe4fa7abc8cb662b8aba1ec9faf360f95
|
|
BLAKE2b-256 checksum How to use checksums |
48bc615e356f0505cb5b79e7e70da893b82a427089b25d955ad23806f6118b99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / amygda-2.1.0-py3-none-any.whl
| Download URL | amygda-2.1.0-py3-none-any.whl |
|---|---|
| Size | 27.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4bb63c1dcd8c96674a2432313aea53804cd83d1a1739d5a5d7483256425ff449
|
|
BLAKE2b-256 checksum How to use checksums |
8490e711b1a2cec4a3bf1bf2d4a0efac297355495126e9a0669bfbd724e3ba1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Security for amygda 2.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.