Skip to content

Add Electroporation capability and BTX Gemini X2 backend#1063

Open
hazlamshamin wants to merge 4 commits into
PyLabRobot:v1b1from
hazlamshamin:btx-electroporation-v1b1
Open

Add Electroporation capability and BTX Gemini X2 backend#1063
hazlamshamin wants to merge 4 commits into
PyLabRobot:v1b1from
hazlamshamin:btx-electroporation-v1b1

Conversation

@hazlamshamin
Copy link
Copy Markdown
Contributor

Summary

This PR adds a new Electroporation capability and a BTX Gemini X2 implementation for prepared electroporation runs.

The workflow is modeled around the actual Gemini X2 / HT-200 operation:

  1. Create a temporary user protocol on the Gemini.
  2. Arm that protocol on the Run Protocol screen through the touchscreen workflow.
  3. Optionally set HT-200 plate columns.
  4. Start the prepared run or cancel it.
  5. Match the new BTXDATA run log and clean up the temporary protocol.

What changed

  • Added pylabrobot.capabilities.electroporation

    • Electroporation frontend
    • ElectroporationBackend
    • serializable protocol/run/result dataclasses
    • chatterbox backend for device-free tests/docs
  • Added pylabrobot.btx

    • BTXGeminiX2 device
    • Gemini X2 driver and electroporation backend
    • Protocol Manager/file-transfer control for user protocols and BTXDATA logs
    • GhostTouch RSI touchscreen control for selecting and starting user protocols
    • HT-200 helper for plate-handler assumptions
  • Added BTX/Gemini X2 test fixtures

    • selected physical-device screen captures from a real GO run
    • portable metadata only; no local paths or host serial-port details
    • tests for screen detection, protocol selection, two-step Set Plate Columns, GO completion, and log matching
  • Added docs

    • electroporation capability notebook
    • BTX Gemini X2 user guide notebook
    • BTX install notes and pylabrobot[btx] extra
    • API docs and supported-devices listing
  • CI

    • adds btx to the extras test matrix
    • installs external tesseract-ocr for btx/all CI jobs because GhostTouch OCR depends on the tesseract executable
  • Also includes one docs-only fix for existing bulk-dispenser API module paths (peristaltic8/backend8, syringe8/backend8).

Hardware validation

Validated on a physical BTX Gemini X2 with HT-200 using a temporary square-wave protocol:

  • firmware: BTX Gemini 4.0.4
  • plate columns: 3
  • GO pressed: yes
  • run log matched under \BTXDATA
  • result: complete / no error
  • temporary protocol deleted after run

The committed screen fixtures are selected PNGs from this run and are used for digital tests so the screen-state logic can be tested without the physical device. See btx/test_data/gemini_x2/screens, as well as the attached video for "The Ghost Touch". I believe this is the first crazy backend that relies on screen detection and OCR to control lab devices. Mainly due to inability of the machine to expose firmware API that allows seamless control by a desktop. The remote desktop app by OEM literally streams the screen bytes to the desktop, and users need to click the streamed screen on their desktop to be able to control the device. Hence this is my best effort.

Tests

Run locally:

python -m pytest pylabrobot/btx pylabrobot/capabilities/electroporation -q
python -m ruff check pylabrobot/btx pylabrobot/capabilities/electroporation docs/user_guide/capabilities/electroporation.ipynb docs/user_guide/btx/gemini_x2/hello-world.ipynb
python -m ruff format --check pylabrobot/btx pylabrobot/capabilities/electroporation
python -m mypy pylabrobot/btx pylabrobot/capabilities/electroporation --check-untyped-defs
git diff --check

https://github.com/user-attachments/assets/48a1b306-9d2c-4e9f-b61b-0d91286c81ef

@hazlamshamin
Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant