Plate Handling
Functions for managing laboratory plates and protocols.
Main plate reader class¶
crisscross.plate_mapping.hash_cad_plates ¶
HashCadPlate ¶
HashCadPlate(
plate_name,
plate_folder,
pre_read_plate_dfs=None,
plate_size=384,
apply_working_stock_concentration=None,
)
A standardized plate system that defines the same ID pattern for all possible handle types (cargo, assembly, seed, etc.). This same system can be read into #-CAD directly. Each plate also features a 2D layout tab to help visualize in the lab.
identify_wells_and_sequences ¶
Identifies wells and sequences from the plate data and combines them into one database.
get_sequence ¶
To retrieve data from the database, the following keys are required: - category: 'cargo', 'assembly', 'seed', etc. - slat_position: physical slat handle ID i.e. 1, 2, ..., 32 - slat_side: i.e. 2, 5 (for h2/h5 handles) - cargo_id: e.g., 'A', 'B', ..., 'Z' (for cargo plates) or 1-64 for assembly handles
get_well ¶
To retrieve data from the database, the following keys are required: - category: 'cargo', 'assembly', 'seed', etc. - slat_position: physical slat handle ID i.e. 1, 2, ..., 32 - slat_side: i.e. 2, 5 (for h2/h5 handles) - cargo_id: e.g., 'A', 'B', ..., 'Z' (for cargo plates) or 1-64 for assembly handles
get_concentration ¶
To retrieve data from the database, the following keys are required: - category: 'cargo', 'assembly', 'seed', etc. - slat_position: physical slat handle ID i.e. 1, 2, ..., 32 - slat_side: i.e. 2, 5 (for h2/h5 handles) - cargo_id: e.g., 'A', 'B', ..., 'Z' (for cargo plates) or 1-64 for assembly handles
get_plate_name ¶
To retrieve data from the database, the following keys are required: - category: 'cargo', 'assembly', 'seed', etc. - slat_position: physical slat handle ID i.e. 1, 2, ..., 32 - slat_side: i.e. 2, 5 (for h2/h5 handles) - cargo_id: e.g., 'A', 'B', ..., 'Z' (for cargo plates) or 1-64 for assembly handles
Utility functions¶
crisscross.plate_mapping ¶
get_plateclass ¶
Main model extractor.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Plate class name.
|
plate_name
|
Name/s of selected plate file/s.
|
plate_folder
|
Plate folder location
|
| RETURNS | DESCRIPTION |
|---|---|
|
instantiated plate reader class. |
get_assembly_handle_v2_sample_plates ¶
Generates plates used for the initial testing of assembly handle library v2.
get_standard_plates ¶
Generates standard plates used commonly in most designs.
get_cutting_edge_plates ¶
Generates standard plates used commonly in most designs. These are the most updated plates in the current library.
get_cargo_plates ¶
Generates standard cargo plates used commonly in most designs.
Standard plate names (change for your system if necessary)¶
crisscross.plate_mapping.plate_constants ¶
sanitize_plate_map ¶
Actual plate name for the Echo always just features the person's name and the plate ID.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Long-form plate name
|
| RETURNS | DESCRIPTION |
|---|---|
|
Barebones plate name for Echo |
Methods for generating and editing plates¶
crisscross.core_functions.plate_handling ¶
add_data_to_plate_df ¶
Creates an empty plate (i.e. with rows/columns premade) and inserts provided data dict, leaving all empty cells blank.
| PARAMETER | DESCRIPTION |
|---|---|
letters
|
Letters to use for rows.
|
column_total
|
Total amount of columns (numbers)
|
data_dict
|
Nested dictionary containing data to input into plate (keys are letters, values are dictionaries with numbers as keys)
|
| RETURNS | DESCRIPTION |
|---|---|
|
Updated plate |
read_dna_plate_mapping ¶
Reads a DNA plate mapping file and returns a dataframe with the data.
| PARAMETER | DESCRIPTION |
|---|---|
filename
|
Filename to read (full path)
|
data_type
|
Type of data - currently only supports 2d_excel and IDT_order
DEFAULT:
|
plate_size
|
Either 96 or 384-well plate sizes
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
|
Dataframe containing all data |
generate_new_plate_from_slat_handle_df ¶
generate_new_plate_from_slat_handle_df(
data_df,
folder,
filename,
restart_row_by_column=None,
data_type="2d_excel",
plate_size=384,
plate_name=None,
scramble_names=False,
output_generic_cargo_plate_mapping=False,
)
Generates a new plate from a dataframe containing sequences, names and notes, then saves it to file. TODO: make faster and more elegant.
| PARAMETER | DESCRIPTION |
|---|---|
data_df
|
Main sequence data to export containing sequence, name and description.
|
folder
|
Output folder.
|
filename
|
Output filename.
|
restart_row_by_column
|
Set this to a column name to restart the row number when the value changes.
DEFAULT:
|
data_type
|
Either 2d_excel (2d output array) or IDT_order (for IDT order form).
DEFAULT:
|
plate_size
|
96 or 384
DEFAULT:
|
plate_name
|
Name of the plate (used for IDT order form)
DEFAULT:
|
scramble_names
|
If true, scrubs all identifiable names when preparing an IDT order output
DEFAULT:
|
output_generic_cargo_plate_mapping
|
If true, outputs the generic cargo plate mapping naming schemes to the 'names' sheet so that the generic cargo plate system can be used directly from the generated file
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
|
final dataframe that's saved to file |
Method for visualizing a plate's contents¶
crisscross.helper_functions.simple_plate_visuals ¶
visualize_plate_with_color_labels ¶
visualize_plate_with_color_labels(
plate_size,
well_color_dict,
color_label_dict=None,
well_label_dict=None,
plate_title=None,
save_folder=None,
save_file=None,
direct_show=True,
plate_display_aspect_ratio=1.495,
)
Use this function to create a plate graphic with specific colours placed in each well, and alternatively a unique label for each well too.
| PARAMETER | DESCRIPTION |
|---|---|
plate_size
|
'384' or '96'
|
well_color_dict
|
Dictionary containing colour to be placed in specific wells.
|
color_label_dict
|
Legend to use for specific colours (at the bottom of the image)
DEFAULT:
|
well_label_dict
|
Optional label to place in specific wells
DEFAULT:
|
plate_title
|
Title to display above plate
DEFAULT:
|
save_folder
|
Output folder
DEFAULT:
|
save_file
|
Output file name
DEFAULT:
|
direct_show
|
Set to true to display the image directly
DEFAULT:
|
plate_display_aspect_ratio
|
Aspect ratio to use for plate display
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
|
N/A |