Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f67af25
working madsci rest node actions, debug needed
caseystone Nov 4, 2025
bfae30c
Renamed module
caseystone Nov 4, 2025
add042e
cleanup
caseystone Nov 4, 2025
686a2c9
fixing merge issue
caseystone Nov 4, 2025
4b43a8c
after debug session, task to add persistent thread
caseystone Nov 4, 2025
fb87571
progress made on threads, debugging needed
caseystone Nov 5, 2025
61217c5
attempted bug fix
caseystone Nov 5, 2025
5468bae
threading and temp state working
caseystone Nov 5, 2025
dd951d2
progress on final cleanup
caseystone Nov 6, 2025
02dfbc7
resource handler and run_bmg script
caseystone Nov 14, 2025
4f51d0c
small changes from Ryan
caseystone Nov 14, 2025
7936651
added todos and node definition
caseystone Nov 18, 2025
e926820
debugging lines added for testing tomorrow
caseystone Nov 20, 2025
d11c80b
cleanup
caseystone Nov 25, 2025
ab11b49
updated README to MADSci
caseystone Nov 25, 2025
b9dd531
bmg_object_thread reorganized, passing pre-commit, testing needed
caseystone Nov 25, 2025
847079b
return plate resource id with assay data file path
caseystone Dec 8, 2025
5cc8778
argument validation for temperature in interface and conversion to Pa…
caseystone Dec 12, 2025
81f42bc
Paths tested, passing pre-commit checks
caseystone Dec 12, 2025
2a1aa62
cleanup
caseystone Dec 15, 2025
aa001c0
README cleanup
caseystone Dec 15, 2025
5447204
passing pre-commit checks
caseystone Dec 16, 2025
5b47fdc
cleanup
caseystone Dec 16, 2025
34450b7
fixing typo
caseystone Dec 16, 2025
1765ef0
edits after PR review, testing needed
caseystone Dec 17, 2025
e6d5c2f
Edits after PR review. Switched to windows paths and added argument f…
caseystone Dec 18, 2025
e01368b
improved device error state reporting and updated README
caseystone Dec 18, 2025
f6490f6
edits to README and a doc string
caseystone Dec 19, 2025
49653f3
upgrade to MADSci 0.6.0
caseystone Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# VS Code
.vscode/
11 changes: 7 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-ast
- id: check-merge-conflict
Expand All @@ -12,15 +11,19 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
rev: 0.8.1
hooks:
- id: nbstripout
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.9
rev: v0.14.2
hooks:
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: https://gitlab.com/bmares/check-json5
rev: v1.0.0
hooks:
- id: check-json5
25 changes: 0 additions & 25 deletions Dockerfile

This file was deleted.

125 changes: 67 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,118 +1,127 @@
# BMG module
# BMG Module

A WEI-powered module for controlling BMG Microplate Readers, currently tested with the VANTAstar model.
A MADSci-powered module for controlling BMG microplate readers, currently tested with the VANTAstar model.

Contains a BMG driver (bmg_driver.py) and BMG REST Node (bmg_rest_node.py).
Contains a BMG driver (bmg_driver.py), BMG Object Thread Class (bmg_object_thread.py), and BMG REST Node (bmg_rest_node.py).

### Assay Setup on BMG microplate reader
### Assay Setup on a BMG Microplate Reader

In order to run an assay on the BMG plate reader, you first need to create the assay using the BMG Smart Control software (not the Voyager software). Once the assay is created and saved, it needs to be exported and the .TCS file should be placed inside the BMG directory that contains the assay database .db file ("C:\Program Files (x86)\BMG\CLARIOstar\User\Definit" with default BMG Smart Control on Windows). Once the .TCS file for your assay has been saved into the database directory, it can be accessed by our BMG driver and REST Node by assay name.
To run an assay on the BMG plate reader, you must first create the assay using the BMG SMART Control software (not the Voyager software). Once the assay is created and saved, it must be exported, and the .TCS file should be placed inside the BMG directory that contains the assay database .db file ("C:\Program Files (x86)\BMG\CLARIOstar\User\Definit" with default BMG SMART Control on Windows).

### Running instructions
Once the .TCS file for your assay has been saved into the database directory, it can be accessed by the BMG driver and REST Node by assay name.

The BMG driver and REST Node can only connect to the device if run with **32-bit python**. In the following commands, be sure that you're running the correct python version, replacing 'python' with the complete path to your 32-bit python .exe file if necessary.
### Running Instructions

The BMG driver and REST Node can only connect to the device when run with **32-bit Python** on a Windows machine. When creating your Python virtual environment in the commands below, replace 'python.exe' with the path to a 32-bit Python executable.

#### Installation

When running the last line of these install instructions, be sure to pip install using your 32-bit python. An example of how to do this is below but make sure to replace python.exe with the path to your 32-bit python .exe.
Clone the repository:

python.exe -m pip install -e .
git clone https://github.com/AD-SDL/bmg_module.git
cd bmg_module

General install instructions:
Create a virtual environment with 32-bit Python, then activate it. Be sure to use your 32-bit Python path:

python.exe -m venv .venv
.venv\Scripts\activate

Install the dependencies using PDM or pip:

pdm install

or

git clone https://github.com/AD-SDL/bmg_module.git
cd bmg_module
pip install -e .

If you're having trouble installing the requirements or wei due to an issue installing httptools, use the Visual Studio Installer (download this if you don't have it already), and either modify or install Visual Studio Community 2022 to include "Desktop development with C++".
If you're having trouble installing the requirements or MADSci due to an issue installing httptools, use the Visual Studio Installer (download it if you do not already have it), and either modify or install Visual Studio Community 2022 to include Desktop development with C++.

#### Running the driver
#### Running the Interface

Inside the bmg_module directory, run the following commands to test the connection to the BMG device through the BMG interface.

cd bmg_module
cd src
python bmg_driver.py
python bmg_interface.py

This will print the current BMG LABTECH Remote Control version number if the driver is able to connect successfully to the BMG device.

This will print out the current BMG LABTECH Remote Control Version Number if the driver is able to connect correctly to the BMG device.
You can also use the driver in other programs. The example Python program below uses the BMG driver to open and close the plate tray, set the temperature, and run an assay named ASSAY_NAME.

You can also use the driver in other programs. See the below python program uses the bmg driver to open and close the plate tray, then sets the temperature and runs an assay named ASSAY_TEST. When connecting, the model must be CLARIOstar even when using a VANTAstar model.
When instantiating the bmg_device, the model name must be entered as "CLARIOstar" even if you own a BMG VANTAstar device. Also, be sure to replace the protocol_database_path and data_output_directory values with your correct paths.

If you own a BMG device with extended temperature range (10.0 deg C to 60.0 deg C), you will need to specify this when instantiating your BMG device in the code below.

import bmg_interface

bmg_device = bmg_interface.BmgCom("CLARIOstar")
bmg_device = bmg_interface.BmgCom(control_name = "CLARIOstar")
# for extended temperature range models, use the instantiation below instead.
# bmg_device = bmg_interface.BmgCom(
# control_name = "CLARIOstar",
# extended_temperature_range_model = True,
# )
bmg_device.plate_out()
bmg_device.plate_in()
bmg_device.set_temp(30.0)
bmg_device.run_assay(
protocol_name = "ASSAY_NAME",
protocol_database_path = "C:\\Program Files (x86)\\BMG\\CLARIOstar\\User\\Definit" ,
data_output_directory = "C:\\Program Files (x86)\\BMG\\CLARIOstar\\User\\Data",
data_output_file_name = "assya_data.txt",
data_output_file_name = "assay_data.txt",
)

Be sure to replace the protocol_database_path and data_output_directory with your correct paths.


#### Running the REST Node

The REST Node can be started with a command in the format below

python.exe bmg_rest_node.py --port <your_port> --db_directory_path <(optional) path to bmg db directory containing assay .TCS files> --output_path <(optional) path to directory for saving data output files>
The REST Node can be started with a command in the format below.

python bmg_rest_node.py --node_url <(str, optional) address for your LiCONiC MADSci REST Node> --db_directory_path <(str, optional) path to bmg db directory containing assay .TCS files> --data_output_directory_path <(str, optional) path to directory for saving data output files> --extended_temperature_range_model <(bool, optional) True if your BMG device has an extended temperature range of 10.0 deg C to 60.0 deg C, False if your BMG device has a temperature range of 25.0 deg C to 45.0 deg C>

--db_directory_path will default to "C:\\Program Files (x86)\\BMG\\CLARIOstar\\User\\Definit" unless specified \
and -- output_path will default to "C:\\Program Files (x86)\\BMG\\CLARIOstar\\User\\Data" unless specified.
--node_url will default to "http://127.0.0.1:2000" \
--db_directory_path will default to "C:\\Program Files (x86)\\BMG\\CLARIOstar\\User\\Definit" \
--data_output_directory_path will default to "C:\\Program Files (x86)\\BMG\\CLARIOstar\\User\\Data" \
and --extended_temperature_range_model will default to False.

Example usage with no optional arguments (remember to use 32-bit python):

Example usage with no optional arguments:

python.exe bmg_rest_node.py --port 3003

python bmg_rest_node.py

Example usage with all optional arguments:

Example usage with all optional arguments:

python.exe bmg_rest_node.py --port 3003 --db_directory_path "C:\\Program Files (x86)\\BMG\\CLARIOstar\\User\\Definit" --output_path "C:\\Program Files (x86)\\BMG\\CLARIOstar\\User\\Data"
python bmg_rest_node.py --node_url "http://127.0.0.1:3003" --db_directory_path "C:\\Program Files (x86)\\BMG\\CLARIOstar\\User\\Definit" --data_output_directory_path "C:\\Program Files (x86)\\BMG\\CLARIOstar\\User\\Data" --extended_temperature_range_model False

### Example Usage in MADSci Workflow YAML file

### Example Usage in WEI Workflow YAML file
Below is an example of a MADSci YAML workflow file that interacts with the BMG REST Node. Replace "ASSAY_NAME","ASSAY_DATA.txt", and "YOUR/DATA/OUTPUT/PATH/" with the name of the assay you wish to run on the BMG, the desired output data file name, and the path to the directory where the output data will be stored.

Below is an example of a YAML WEI Workflow file that could interact with the BMG REST Node.
name: Test Workflow

name: BMG Example
author: RPL
info: An example WEI workflow to show available BMG actions
version: '0.1'
metadata:
author: Casey Stone
info: Example MADSci workflow for BMG actions
version: 0.1

flowdef:
- name: open bmg
module: bmg
steps:
- name: open BMG
node: bmg
action: open

- name: close bmg
module: bmg
node: bmg
action: close

- name: set temp
module: bmg
node: bmg
action: set_temp
args:
temp: 30.0

- name: Run bmg
module: bmg
node: bmg
action: run_assay
args:
assay_name: Assay_name
data_output_file_name: assay_data.txt












args:
assay_name: ASSAY_NAME
data_output_file_name: ASSAY_DATA.txt
data_output_directory_path: YOUR/DATA/OUTPUT/PATH/
39 changes: 0 additions & 39 deletions compose.yaml

This file was deleted.

Loading