Measure mycobacterial growth on antibiotic plates and infer MICs
Project description
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.
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 amygda-2.0.0.tar.gz.
File metadata
- Download URL: amygda-2.0.0.tar.gz
- Upload date:
- Size: 27.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e62982dcb466d6c71284cf81bf0a686d6f35b6a06eed598453c975d46a8c7183
|
|
| MD5 |
5db1415779f8b882cc816acad82e7f66
|
|
| BLAKE2b-256 |
9752a627623cfd53cc823f358700b02283a554b25890e26f145e2813168cac05
|
File details
Details for the file amygda-2.0.0-py3-none-any.whl.
File metadata
- Download URL: amygda-2.0.0-py3-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c3d01f5b6a7e678891231c57a5a18213ef62e5b63e6a3338e555dea36a97452
|
|
| MD5 |
cc50fce36df925d0bb8fd2fd6d9eb187
|
|
| BLAKE2b-256 |
a91f243f4908431be9537db87b77afbc335206e0cf363cb1f31430ea3e867128
|