API reference
Bioprinter: print images with colored bacteria and yeast.
This implements the bioprint function, which takes an image and writes a CSV file that the Labcyte Echo dispenser can use to print the pictures on a plate using yeast, coli, …
Written by Zulko at the Edinburgh Genome Foundry.
Original idea and Matlab code by Mike Shen: https://github.com/mshen5/BioPointillism
- bioprinter.bioprint(image_filename, output_filename, bg_color, pigments_wells, resolution=(192, 128), transfer_volume=2.5, pigment_well_capacity=25000, transfer_rate=150, quantified_image_filename=None)[source]
Generate a CSV file for Echo printing of an image.
This function generates a CSV file for the Echo liquid handler to bioprint a given picture, using specified color wells.
- Parameters:
image_filename (str) – The path to the image file. The image can be any size and format, but should be suitable for low resolution yeast printing. Images taller than they are wide will automatically be rotated 90 degrees to maximize resolution while preserving aspect ratio.
output_filename (str) – The name of the CSV file for the Echo.
bg_color (tuple) – A triplet (R,G,B) of 0-255 integers indicating the background color of the original image (no pigment).
pigments_wells (dict) – A dictionary of well names and the corresponding pigments ( e.g., {“A1”: [0, 10, 20], “B1”: […]}). Only one well per pigment is supported currently.
resolution (tuple, optional) – Resolution (width, height) of the printing plate. You must define a plate with these exact same characteristics using the Echo software. Default is (192, 128), equivalent to twice the resolution of a 1536-well plate. The aspect ratio of the image is preserved.
transfer_volume (float, optional) – Volume in microliters of liquid used per pixel, default is 2.5 μL.
pigment_well_capacity (float) – Volume in microliters that each pigment well can dispense. Raises an error if required pigment for any color exceeds the content of the well, i.e. if
transfer_volume * number_pixels > well_capacity
.transfer_rate (int, optional) – Average number of droplet transfers per second; used to estimate printing time.
quantified_image_filename (str, optional) – Path to save the quantified version of the picture as an image file.
Examples
Print the EGF logo!
bioprint( image_filename="egf_logo.jpeg", output_filename="egf_logo.csv", bg_color=[255, 255, 255], # White background pigments_wells={ "A1": [0, 0, 0], # Black "A2": [250, 120, 10] # Orange } )