Skip to content

pharmbio/robotlab

Repository files navigation

robotlab

The monorepo for the robots in our robotlabs for cell painting and imaging.

The cell painter system

The cell painter system controls the dispenser from BioTek and washers from Biotek and BlueCatBio as well as the incubator using the universal robots robot arm. Here is an overview:

The standard operating procedure is here: sop-cellpainter.md.

The imager system

The imager system controls the Squid microscope and the Nikon microscope as well as the fridge using the precise flex robot arm. Here is an overview:

The standard operating procedure is here: sop-imager.md.

Network setup

machine os room ip
Ubuntu NUC ubuntu the cage 10.10.0.55
Windows NUC windows the cage 10.10.0.56
Nikon stage computer raspian squikon 10.10.0.72
Nikon NIS computer windows squikon 10.10.0.76
Squid Mikro Asus ubuntu squikon 10.10.0.95
"GBG" computer windows squikon 10.10.0.97
PF robotarm - squikon 10.10.0.98
UR robotarm control box linux the cage 10.10.0.112

The node names and IP-addresses are also specified in labrobots/labrobots/__init__.py.

Packages

The project consists of a few packages:

cellpainter Cell painter program and control of the Universal Robot (UR) robotarm. Microscope imager program and control of the PreciseFlex (PF) robotarm.
labrobots Remote control of non-robotarm robots: liquid handling machines, incubator, fridge, microscopes and barcode scanners.
flash_pf Code to flash the PreciseFlex (PF) robotarm with our modified software.

It also includes two utility packages:

viable Library for writing web frontend code in python.
pbutils Shared utilities such as bridging dataclasses and sqlite3.

External dependencies:

flask Micro framework for building web applications.
z3-solver SMT-solver used in the robotlab scheduler.
apsw Another python sqlite3 wrapper, needed for precise control of sqlite3 version. We need all json extensions.
pyserial COM-port communication with barcode scanner and bluewasher.
RPi.GPIO GPIO-communication with RPi for the Nikon automated stage.

The BioTek control code require a C# program that needs to be separately built.

Installation

On the ubuntu NUC that will run the guis and schedulers, install python >= 3.10 and:

./foreach.sh pip install --editable .

On each windows machine that runs labrobots, install python >= 3.10 and:

pip install --editable labrobots

Further instructions are in under labrobots/

Test

Github actions is set up, check .github/workflows/test.yml. One way to run this locally is to use act.

Configure hostnames

The gui is run on the ubuntu NUC. To make it easier to find it we alias its hostname.

On windows, for example the BioTek computer, add this line to C:\Windows\System32\drivers\etc\hosts

10.10.0.55 cellpainter

On ubuntu, for example the squid mikro asus computer, add this line to /etc/hosts

10.10.0.55 imager

Git diff of sqlite databases

To enable showing diffs of sqlite databases when running git commands you can follow https://stackoverflow.com/questions/13271643/git-hook-for-diff-sqlite-table

One way to ignore big blobs is adding this to git config:

[diff "sqlite3"]
    binary = true
    textconv = "dump(){ sqlite3 -batch \"$1\" .dump | sed \"s,X'\\([0-9a-f]\\{16\\}\\)[0-9a-f]*',X'\\1...',g\"; }; dump"

You will need to add this to git attributes:

*.db diff=sqlite3