basic_assembly.dna_bot.dnabot_app
dnabot
Main function, creates scripts and metainformation Can take specific args or just **labware_dict for all labware
Arguments:
output_folder
- the full file path of the intended output folder for files generated ethanol_well_for_stage_2 = ethanol well in letter format e.g. 'A1' to be used in purification deep_well_plate_stage_4 = soc well to be used in transformation please only enter wells from 'A1' to 'A12' as this is a troughconstruct_path
- a one element list with the full path of the construct csvpart_path
- a list of full paths to part csv(s) (one or more) see labware_dict for rest of arguments
Returns:
List of output paths If there is an exception, the list of output paths will contain only one element = the error path Otherwise the list of output paths will contain: OT-2 script paths (clip, thermocycle, purification, assembly, transformation), metainformation (clip run info, final assembly dict, wells - ethanol well and soc well)
generate_constructs_list
Generates a list of dataframes corresponding to each construct. Each dataframe lists components of the CLIP reactions required. Args: path = the absolute path of the constructs file Returns: List of dataframes, in which each dataframe = construct
generate_clips_df
Generates a dataframe containing information about all the unique clip reactions required to synthesise the constructs in constructs_list. Args: list of constructs stored as dataframes Returns: dataframe of all constructs
generate_sources_dict
Imports csvs files containing a series of parts/linkers with corresponding information into a dictionary where the key corresponds with part/linker and the value contains a tuple of corresponding information.
Arguments:
paths
list - list of strings each corresponding to a path for a sources csv file.
Returns:
sources_dict
- a dictionary with keys = part names, values = tuple of values - either well, concentration, plate or well, plate depending on whether concentration is provided for the partparts_df
- dataframe of parts with cols = concentration, name, well, plate
fill_parts_df
Fill dataframe of parts with metainformation to be stored in csv. Will add final assembly well in generate_final_assembly_dict()
Arguments:
clips_df
- the dataframe of clips created as intermediate steps before assemblyparts_df_temp
- the previous parts_df dataframe to be expanded on
Returns:
parts_df, with new columns of 'clip_well', 'mag_well', 'total_vol', 'vol_per_clip', and 'number'
generate_clips_dict
Using clips_df and sources_dict, returns a clips_dict which acts as the sole variable for the opentrons script "clip.ot2.py".
Arguments:
clips_df
- dataframe of clip reactionssources_dict
- dictionary of parts with csv values as keysparts_df
- dataframe of parts
Returns:
clips_dict
- dictionary to be used by 1_clip.ot2.py
generate_final_assembly_dict
Using constructs_list and clips_df, returns a dictionary of final assemblies with keys defining destination plate well positions and values indicating which clip reaction wells are used.
Arguments:
constructs_list
- list of constructs, constructs = dataframesclips_df
- dataframe of clip reactionsparts_df
- dataframe of parts
Returns:
dictionary of final assemblies with keys = destination plate, values = list of clip wells clips_df and parts_df updated with construct well column
calculate_final_assembly_tipracks
Calculates the number of final assembly tipracks required ensuring no more than MAX_FINAL_ASSEMBLY_TIPRACKS are used. Args: final_assembly_dict = dictionary with keys = final assembly wells, values = list of clip wells Returns: number of tipracks needed in final assembly (3_assembly.ot2.py) Raises: ValueError if final assembly tiprack number > tiprack slots
generate_spotting_tuples
Using constructs_list, generates a spotting tuple (Refer to 'transformation_spotting_template.py') for every column of constructs, assuming the 1st construct is located in well A1 and wells increase linearly. Target wells locations are equivalent to construct well locations and spotting volumes are defined by spotting_vols_dict.
Arguments:
spotting_vols_dict
dict - Part number defined by keys, spotting volumes defined by corresponding value.
Returns:
List of three tuples as instructions for transformation script
generate_ot2_script
Generates an ot2 script named 'ot2_script_path', where kwargs are written as global variables at the top of the script. For each kwarg, the keyword defines the variable name while the value defines the name of the variable. The remainder of template file is subsequently written below.
Arguments:
parent_dir
str - output folder dirot2_script_path
str - where the script should be saved, relative to the parent_dirtemplate_path
str - where the template script can be found
Returns:
absolute path of script (str)
generate_master_mix_df
Generates a dataframe detailing the components required in the clip reaction master mix. Args: Number of clips needed in total Returns: master mix dataframe containing reagents + volumes
generate_sources_paths_df
Generates a dataframe detailing source plate information.
Arguments:
paths
list - list of strings specifying paths to source plates.deck_positions
list - list of strings specifying candidate deck positions.
Returns:
Dataframe containing source plate information
dfs_to_csv
Generates a csv file defined by path, where kw_dfs are written one after another with each key acting as a title. If index=True, df indexes are written to the csv file.
handle_2_columns
This function has the intent of changing: ('A8', '2') => ('A8', '', '2') ('A8', '', '2') => ('A8', '', '2') [('E2', '5')] => [('E2', '', '5')][('G1', '', '5')] => [('G1', '', '5')] with the purpose of handling 2 column csv part file inputs, as at times when 2 column csv files are input it creates tuples of length 2 instead of 3
final_well
Determines well containing the final sample from sample number. Args: sample_number = integer, e.g. 0 = well index Returns: well in string form, e.g. 'A1' if sample_number = 0