Useful methods built on top of DNA Cauldron

dnacauldron.utils.list_overhangs_from_record_annotations(rec, with_locations=False)[source]

Return a least of the (probable) overhangs used building the construct

dnacauldron.utils.list_digestion_overhangs(records, enzyme='auto', parts_only=True)[source]

List all overhangs created by restriction in the provided records.

Warning: only overhangs on non-reversed fragments are returned, not their reverse-complement.

Parameters
records

List of records

enzyme

Either ‘BsmBI’, ‘BsaI’, etc. or just “auto” for automatic selection.

parts_only

If true, overhangs created by restriction which are not on a part (so for instance inside a backbone) will be ignored.

dnacauldron.utils.substitute_overhangs(record, substitutions, enzyme='auto', return_linear_parts=False)[source]

Replace the record’s subsequence that corresponds to overhangs.

This is practical to change the position of a part in a Type-2S assembly standard

Parameters
record

A Biopython record whose internal sequence needs to be replaced

substitutions

A dict {overhang: new_overhang} of which overhangs must be replaced

enzyme

Either ‘BsmBI’, ‘BsaI’, etc. or just “auto” for automatic selection.

Examples

>>> new_record = replace_overhangs(record, {'ATGC': 'CTCG'})
dnacauldron.utils.swap_donor_vector_part(donor_vector, insert, enzyme, allow_overhangs_edits=False)[source]

Return the records obtained by cloning inserts into a donor vector.

Meant for Type-2S assembly standards only (Golden Gate, etc.)

This method is meant to quickly go from a linearized sequence of a part to a circular vector (the part in its donor vector) by starting from an existing donor vector (with same overhangs) and swapping this vector’s part for the insert of interest.

Parameters
donor_vector

Biopython record of a donor vector. must have an insert producing a restriction-free fragment

insert

Biopython record of a plasmid or a linear DNA sequence containing an insert (i.e. a fragment that is cut out)

enzyme

The name of the enzyme to use e.g. ‘BsmBI’, ‘BsaI’, …

dnacauldron.utils.insert_parts_on_backbones(part_records, backbone_records, enzyme='autodetect', min_backbone_length=500, process_parts_with_backbone=False, default_backbone_choice=None)[source]

Autodetect the right backbone for each Golden Gate part.

This method is meant to process a batch of genbank files, some of which might represent a part on a backbone, and some of which represent simply a part (and enzyme-flanked overhangs) which needs to be complemented with the right backbone.

It will return, for each part, whether it has already a backbone, and if not, which backbone was selected and what the final sequence is.

Parameters
part_records

List of genbanks of the parts to put on vectors.

backbone_vectors

Vectors to insert parts in, typically donor vectors for different positions of an assembly standard.

enzyme

Enzyme to use. Use autodetect for autodetection.

min_backbone_length

Minimal length of a backbone. Used to determine if a part is represented alone or with a backbone.

process_parts_with_backbone

If true, parts will be inserted in an autoselected backbone even when they already have a backbone (it will be replaced).

dnacauldron.utils.record_contains_backbone(record, enzyme='BsmBI', min_backbone_length=500)[source]

Return True iff it believes the given record contains a backbone.

A backbone is detected if, when cutting the circularized record with the given enzyme, there is one fragment with no site (the insert), and the rest has a total size above the given min_backbone_length.

class dnacauldron.utils.BackboneChoice(record, already_on_backbone=None, error=None, backbone_record=None, final_record=None)[source]

Class to represent the result of a backbone autoselection.

Parameters
record

Record that was analyzed, containing an insert, to be backbonized, and potentially an original backbone too.

already_on_backbone

Was a backbone detected in that record ?

error
backbone_record

Record of the backone that was selected for this record among all provided choices.

final_record

Record featuring the original insert in the given record cloned into the auto-selected backbone.

static list_to_infos_spreadsheet(choices)[source]

Return a pandas dataframe summarizing a list of BackboneChoices.

The dataframe’s columns are ‘original_record’, ‘already_on_backbone’, ‘detected_backbone’, ‘final_record_length’, ‘error’.

to_dict(self)[source]

Return the object as a dict. Used for dataframe/spreadsheet.

static write_final_records(choices, directory)[source]

Write a list of BackboneChoices final records as genbanks.