Skip to content

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

identify_wells_and_sequences()

Identifies wells and sequences from the plate data and combines them into one database.

get_sequence

get_sequence(category, slat_position, slat_side, cargo_id=0)

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

get_well(category, slat_position, slat_side, cargo_id=0)

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

get_concentration(category, slat_position, slat_side, cargo_id=0)

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

get_plate_name(category, slat_position, slat_side, cargo_id)

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

get_plateclass(name, plate_name, plate_folder, **kwargs)

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

get_assembly_handle_v2_sample_plates()

Generates plates used for the initial testing of assembly handle library v2.

get_standard_plates

get_standard_plates(handle_library_v2=False)

Generates standard plates used commonly in most designs.

get_cutting_edge_plates

get_cutting_edge_plates(handle_library_working_stock_concentration=None)

Generates standard plates used commonly in most designs. These are the most updated plates in the current library.

get_cargo_plates

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

sanitize_plate_map(name)

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

add_data_to_plate_df(letters, column_total, data_dict)

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

read_dna_plate_mapping(filename, data_type='2d_excel', plate_size=384)

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: '2d_excel'

plate_size

Either 96 or 384-well plate sizes

DEFAULT: 384

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: None

data_type

Either 2d_excel (2d output array) or IDT_order (for IDT order form).

DEFAULT: '2d_excel'

plate_size

96 or 384

DEFAULT: 384

plate_name

Name of the plate (used for IDT order form)

DEFAULT: None

scramble_names

If true, scrubs all identifiable names when preparing an IDT order output

DEFAULT: False

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: False

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: None

well_label_dict

Optional label to place in specific wells

DEFAULT: None

plate_title

Title to display above plate

DEFAULT: None

save_folder

Output folder

DEFAULT: None

save_file

Output file name

DEFAULT: None

direct_show

Set to true to display the image directly

DEFAULT: True

plate_display_aspect_ratio

Aspect ratio to use for plate display

DEFAULT: 1.495

RETURNS DESCRIPTION

N/A