How To: Manual Grid Detection When Automatic Fails#

When automatic grid detection does not find the correct grid layout, use ManualGridDetector to specify colony positions explicitly.

[1]:
from phenotypic.data import load_yeast_plate
from phenotypic.detect import ManualGridDetector
[2]:
plate = load_yeast_plate()
plate.dash()

Data type cannot be displayed: application/vnd.plotly.v1+json

Identify Anchor Points#

Use the interactive Plotly figure above to find the pixel coordinates of the top-left colony center (coord1) and optionally the adjacent colony at row 1, column 1 (coord2). Hover over the colonies to read coordinates.

ManualGridDetector places a footprint of specified shape and width at each grid position, using the anchor points to infer the grid spacing.

[3]:
# Replace these coordinates with values from your plate
detector = ManualGridDetector(
    coord1=(50, 50),      # (y, x) of top-left colony center
    coord2=(120, 120),    # (y, x) of colony at row 1, col 1
    shape="disk",
    width=15,
)
plate = detector.apply(plate)
plate.dash(overlay=True, show_grid=True)

Data type cannot be displayed: application/vnd.plotly.v1+json

Adjust coord1, coord2, and width until the footprints align with your colonies. Increase width for larger colonies.