How to use the notebooks in the duckweed growth assay workflow - machineagency/duckbot GitHub Wiki
Notebook 0 - Creat Expt Config
What does it do?
Creates a JSON file defining the key details of your experimental design. This JSON file is then read by the other scripts in the workflow. You can create this JSON file by hand but the formatting has to be exactly right so we'd recommend using the set up notebook.
How to use it
Unlike the other notebooks this one requires you to actually edit the code in the cell marked "ACTION REQUIRED". Otherwise you just click through the cells, running each one.
Notebook 1 - Plate set up
What does it do?
- Produce an online screen visulation of your plate set up so that you can confirm this is what you want before proceeding.
- Guide you through media dispensing, providing prompts to place the appropriate media in position 0 on the machine before automatically dispensing the defined amount into the defined cells.
How to use it
Click through and run each cell. Examine the print out from cells where appropriate. As you run through the script you will be prompted to take actions and to confirm those actions by entering text in an input cell.
Before running the script
- Define the absolute positions of all the wells for every plate position. Assuming that you are working with 24 well plates all you need to do is define the position of the first well in position 0 on the machine and update this in the relevant config file (variable 'plate_start_position' in duckbot/ConfigFiles/PlatePositionsConfig.py). You will also want to check that the offsets between plates and between wells are also correct.
- Define the machine parameters in duckbot/ConfigFiles/HardwareLabwareConfigs)
"media_reservoir" and "duckweed_reservoir_loc" = A spot at the center of the media reservoir you will be using to dispense media from (this is where the syringe will move to in order to aspirate, and the reservoir the duckweed will be transferred from. "tool_positions" = The index of each tool (You can check this using Duet Web Controller). "dispense_calcs" = Volumes to use for media dispensing "media_dispensing_z_dict" and "inoculation_loop_z_dict" : Z-positions for different tasks, again you can verify these by manually controlling the machine via Duet Web Controller.
As you run the script
Media dispensing: Place a container filled with the appropriate sterile media in bedplate position 0 (also labelled R) on the machine when prompted by the notebook. If desired you will need to manually swap out syringes or syringeheads to avoid cross-contamination between media swaps.
Duckweed transfer: Place a container filled with fronds of the relevant duckweed type and the machine will attempt to move individual fronds into the relevant wells. After each attempt at filling all wells a camera will take pictures of each well to confirm success and then unsuccessful wells will be reattempted
Notebook 2 - Image plates
What does it do?
This notebook will guide you through collecting images of duckweed at a single time point of a growth assay experiment. You will run this notebook every time you want to collect image data and the resulting image files will be saved into the folder defined in the notebook.
Note that by default image data will be saved to duckbot/test_data/YOUR_EXPT_NAME. If you want to change this then just search for 'test_data' in the notebook to find the relevant cell and edit this.
How to use it
Run the cells in the notebook in order. Images will be automatically collected and saved and you will be presented with a summary graphic showing you all the images that have been collected so that you can see if anything weird or unexpected has happened but you don't need to save those images, the images are already saved.
Notebook 3 - Data analysis
What does it do?
The key thing this script does is make use of computer vision tools to identify duckweed in all the image files produced during the experiment and then extract the area of duckweed fronds in pixels-squared to be able to produce growth curves and a dose-repsonse curve.
The image analysis relies to a large extent on images being uniform in composition and lighting. The image analysis method also produces a figure showing you what the algorithm thinks is duckweed. One of those is produced for every analysed image and saved in a folder called 'processed' in the same folder that houses the original input images. So you can go and check if those look right and if necessary make tweaks to the analysis method itself ('calculate_plant_pixels' in utils/DataAnalysisUtils). The algorithms used are from the plant CV package that has its own documentation and tutorials (https://plantcv.danforthcenter.org/) and from Open CV (https://pypi.org/project/opencv-python/).
The methods in this notebook rely on image files being saved with this exact format "exptname_plate_wellID_yyyymmdd.jpg. That's how the script can calculate the days-post-initiation and match up the image to the well it came from.
How to use it
- Directly enter the start date of the experiment into the cell in section 1 where prompted, in the format yyyy-mm-dd.
- Run the cells in section 2 and select the appropriate config file
- Run the remaining cells to analyze images and produce summary figures. To modify the analysis methods you can play around with the code in the data analysis library in the 'utils' folder.