biobricks_assembly.biobricks10.bbinput
biobricks
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 generatedconstruct_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)thermocyle
- True or False, indicating whether the user has and would like to use the Opentrons Thermocycler 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 (assembly, transformation), metainformation
get_constructs
Returns construct dataframe from constructs csv Args: path = path of construct csv
Returns:
merged_constructs_list
- dataframe of constructsdest_well_list
- list of wells in construct plate that are used
process_construct
Returns construct dictionary from row in csv file Used in get_constructs() Args: construct_entry = construct row from csv in list Returns: Dictionary of construct info
get_parts
Returns a dataframe of parts from part csv file. Uses constructs_list to record the number of times the part is used in the constructs and the roles it plays.
Arguments:
paths
- list of paths to part csvsconstructs_list
- dataframe of constructs
Returns:
merged_parts_list
- dataframe of parts
process_part
Returns a part dataframe with detailed information. Used in get_parts()
Arguments:
part
- row of part csv fileconstructs_list
- constructs dataframeplate
- source plate of part
Returns:
Dataframe of individual part
get_reagents_wells
Arguments:
constructs_list
- dataframe of constructsparts
- dataframe of parts
Returns:
Dataframe with rows as reagent names and cols as the reagent well and the volume of the reagent required. List of wells used for reagents in reagents tube rack Master mix dataframe giving volumes of each reagent
get_digests
Creates a dataframe of digests, the intermediate step in assembly BioBricks constructs.
Arguments:
constructs_list
- dataframe of constructsparts
- dataframe of partsreagents
- dataframe of reagents
Returns:
dataframe of digests updated parts dataframe with digest well column
next_well
Finds the next available well from a list of used wells for a 96 well plate
Arguments:
List of wells used in 96 well plate
Returns:
Next unused well in 96 well plate
next_well_reagent
Finds the next available well from a list of used wells for a 24 well plate/tube rack
Arguments:
List of wells used in 24 well plate/tube rack
Returns:
Next unused well in 24 well plate/tube rack
count_part_occurences
Counts the number of times a part is used in the constructs. Differentiates between upstream uses, downstream uses, and plasmid uses: all require different digests.
Arguments:
constructs_list
- dataframe of constructspart
- row in part csv file as list
Returns:
counts
- list where 0th element = upstream counts, 1st element = downstream counts, 2nd element = plasmid countsconstructs_in_upstream
- index of constructs a part appears in as the upstream partconstructs_in_downstream
- index of constructs a part appears in as the downstream partconstructs_in_plasmid
- index of constructs a part appears in as the plasmid part
create_assembly_dicts
Returns assembly dictionaries to be used in the assembly protocol, instructing which transfers need to be made.
Arguments:
constructs
- dataframe of constructsparts
- dataframe of partsdigests
- dataframe of digestsreagents
- dataframe of reagents
Returns:
source_to_digest
- dictionary with key = source (part) well, key = list of tuples in format (digest well, volume to transfer)reagent_to_digest
- dictionary with key = reagent well, key = list of tuples in format (digest well, volume to transfer)digest_to_construct
- dictionary with key = digest well, key = list of tuples in format (construct well, volume to transfer)reagent_to_construct
- dictionary with key = reagent well, key = list of tuples in format (construct well, volume to transfer)reagents_dict
- dictionary with key = reagent name, key = reagent well
create_tranformation_dicts
Creates transformation dictionaries to be used in the transformation protocol, instructing which transfers need to be made. Creates transform_df for metainformation Competent wells + construct wells -> same well for transformation. Control wells + water well -> same well for transformation.
Arguments:
Constructs
- dataframe of constructswater_well
- well that water is stored incontrols_per_cons
- create three controls per construct if True create three controls total if False
Returns:
competent_source_to_dest
- dictionary with key = competent cell well, value = tuple of destination well + transfer volcontrol_source_to_dest
- dictionary with key = control cell well, value = tuple of destination well + transfer volassembly_source_to_dest
- dictionary with key = construct well, value = tuple of destination well + transfer vol,water_source_to_dest
- dictionary with key = water well, value = tuple of destination well + transfer voltransform_df
- dataframe of transformation reactions
create_assembly_protocol
Generates the assembly protocol used by opentrons. Returns the path of the assembly script.
Arguments:
template_path
- absolute path of the Opentrons script templateoutput_path
- absolute path of the output folder to save protocol insource_to_digest
- dictionary of form Dict[str, List[Tuple(str, int)]], dictionary key (string) gives source (part) well to transfer from, the 0th element of each tuple gives well to transfer to (digest well in this case), with the 1st element of the tuple giving the volume to transfer.reagent_to_digest
- dictionary of same form as source_to_digest (Dict[str, List[Tuple(str, int)]]), instructing transfers from reagent wells to digest wellsdigest_to_storage
- dictionary of same form as source_to_digest (Dict[str, List[Tuple(str, int)]]), instructing transfers from digest wells to storage wells (wells where digest not used in construct is stored after assembly)digest_to_construct
- dictionary of same form as source_to_digest (Dict[str, List[Tuple(str, int)]]), instructing transfers from digest wells to construct wellsreagent_to_construct
- dictionary of same form as source_to_digest (Dict[str, List[Tuple(str, int)]]), instructing transfers from reagent wells to construct wellsp10_mount
- "left" or "right", the Opentrons pipette mount optionsp10_type
- the name of the p10 pipette, e.g. "p10_single"well_plate_type
- the name of the well plate type used as the source plate and construct platetube_rack_type
- the name of the tube rack type used for holding the reagentsthermocycle
- True or False, True = run thermocycle module in scripts, False = use benchtop thermocycler
Returns:
path of assembly protocol script
create_transformation_protocol
Generates the transformation protocol used by opentrons.
Arguments:
template_path
- absolute path of the Opentrons script templateoutput_path
- absolute path of the output folder to save protocol incompetent_source_to_digest
- dictionary of form Dict[str, List[Tuple(str, int)]], dictionary key (string) gives competent cell well to transfer from, the 0th element of each tuple gives well to transfer to (transformation well), with the 1st element of the tuple giving the volume to transfer.control_source_to_digest
- dictionary of same form as competent_source_to_digest (Dict[str, List[Tuple(str, int)]]), instructing transfers from control wells to transformation wellsassembly_source_to_digest
- dictionary of same form as competent_source_to_digest (Dict[str, List[Tuple(str, int)]]), instructing transfers from construct wells to transformation wellswater_source_to_digest
- dictionary of same form as competent_source_to_digest (Dict[str, List[Tuple(str, int)]]), instructing transfers from water well to transformation wellsp10_mount
- "left" or "right", the Opentrons pipette mount optionsp300_mount
- "left" or "right", the Opentrons pipette mount optionsp10_type
- the name of the p10 pipette, e.g. "p10_single"p300_type
- the name of the p300 pipette, e.g. "p300_single"well_plate_type
- the name of the well plate type used as the construct platetransformation_plate_type
- the name of the well plate type used as the transformation platetube_rack_type
- the name of the tube rack type used to store cellssoc_plate_type
- the name of the plate type used to store soc
Returns:
path of transform protocol script
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.