Core classes

AssemblyMix

class dnacauldron.AssemblyMix.AssemblyMix[source]

Base class for assembly mixes.

The subclasses (Type2sRestrictionMix and Gibson) implement their own version of how the original parts are broken into fragments, when two fragments will clip together, etc.

initialize(self)[source]

Precompute the fragments and connections graph of the mix.

class dnacauldron.AssemblyMix.StickyEndAssemblyMix(fragments, fragment_filters=(), name='sticky_ends_mix')[source]

Class to represent and simulate the assembly of sticky-ended fragments.

Used notably for BASIC assembly and other places where we are mixing sticky-ended fragments, not necessarily from enzyme digestions (see the subclass RestrictionLigationMix for this case).

Parameters
fragments

A list of StickyEndFragment instances, which will assemble together based of sticky ends perfect homologies.

fragment_filters

List of functions of the form fragment=>True/False. If a fragment generates a “False” by at least one filter, it is taken out of the mix (this is used to remove unstable fragments that won’t make it to the final assembly, for instance fragments with internal restriction sites).

name

Name of the mix as it will appear in reports

static assemble(fragments, circularize=False, annotate_homologies=False)[source]

Assemble sticky-end fragments into a single one (sticky or not).

Parameters
fragments

List of StickyEndFragment fragments

circularize

If True and if the two ends of the final assembly are compatible, circularize the construct, i.e. return a non-sticky record representing the circular assembly of the fragments.

annotate_homologies

If True, all homology regions that where formerly sticky ends will be annotated in the final record.

static will_clip_in_this_order(fragment1, fragment2)[source]

Return True iff f1’s right sticky end fits f2’s left.

class dnacauldron.AssemblyMix.RestrictionLigationMix(parts=None, enzymes=None, fragments=None, fragment_filters=(), name='restriction_mix', annotate_fragments_with_parts=True)[source]

Mix to represent and simulate restriction-ligation reactions.

For reactions using type-2S enzymes (Golden Gate assembly etc.), see the helper function generate_type2s_restriction_mix().

Parameters
parts

List of Biopython records representing circular or blunt-end linear DNA fragments which will be restricted into sticky-end fragments and assembled toghether via sticky-end homologies.

enzymes

List of names of the enzyme to be used for the restriction

fragments

A list of StickyEndFragment instances, which will assemble together based of sticky ends perfect homologies.

fragment_filters

List of functions of the form fragment=>True/False. If a fragment generates a “False” by at least one filter, it is taken out of the mix (this is used to remove unstable fragments that won’t make it to the final assembly, for instance fragments with internal restriction sites).

name

Name of the mix as it will appear in reports

annotate_fragments_with_parts

If True, final constructs will have annotations “From xxx” indicating which part each sequence segment comes from.

compute_digest(self, part)[source]

Compute the fragments resulting from the digestion

compute_fragments(self)[source]

Compute the (sticky-ended) fragments resulting from the digestion of the mix’s parts by the mix’s enzyme.

Note that all fragments receive an annotation (feature) of type “source” that will show in the genbank of final constructs.

class dnacauldron.AssemblyMix.HomologousAssemblyMix(parts, homology_checker, name='homology_mix', annotate_fragments_with_parts=True)[source]

Mix to represent and simulate long-homology-based reactions.

Such as Gibson Assembly.

Parameters
parts

List of Biopython records representing blunt-end linear DNA fragments which will be assembled toghether via end-homologies.

homology_checker

An HomologyChecker instance determining which size ranges and melting temperatures define an acceptable homology.

annotate_fragments_with_parts

If True, final constructs will have annotations “From xxx” indicating which part each sequence segment comes from.

will_clip_in_this_order(self, fragment1, fragment2)[source]

Return True iff f1’s right sticky end fits f2’s left.

dnacauldron.AssemblyMix.LigaseCyclingReactionMix

alias of dnacauldron.AssemblyMix.LigaseCyclingReactionMix

Fragment

class dnacauldron.Fragment.StickyEndFragment(seq, id='<unknown id>', name='<unknown name>', description='<unknown description>', dbxrefs=None, features=None, annotations=None, letter_annotations=None)[source]

Biopython SeqRecord whose sequence has sticky ends.

annotate_connector(self, connector, annotation_type='homology')[source]

Annotate a connector to indicate it used to be a sticky end.

static assemble(fragments, circularize=False, annotate_homologies=False)[source]

Return the (sticky end) record obtained by assembling the fragments.

Parameters
fragments

List of StickyEndFragments to assemble.

circularize

True to also assemble the end flanks of the final construct (results in a Biopython Record), false to not do it (the result is then a StickyEndFragment).

annotate_homologies

If true, homologies will have an annotation in the final, predicted construct records.

circularized(self, annotate_homology=False, annotation_type='homology', qualifiers=None)[source]

Return the Biopython record obtained by cirularizing the result.

Only works if the left and right sticky ends are compatible. The return is a simple Biopython record where the sticky end has been integrated in the sequence.

text_representation_in_plots(self)[source]

Plot a fragment as left//PART_NAME//right (where // is a new line)

to_standard_string(self)[source]

Return a string representation of the fragment, used for quick comparison of fragments and fragments chains.

will_clip_in_this_order_with(self, other)[source]

Return True if this record’s right sticky end is complementary with the other record’s left sticky end.

class dnacauldron.Fragment.HomologousFragment(seq, id='<unknown id>', name='<unknown name>', description='<unknown description>', dbxrefs=None, features=None, annotations=None, letter_annotations=None)[source]
static assemble(fragments, homology_checker, circularize=False, annotate_homologies=False)[source]

Return the record obtained by assembling the fragments.

Parameters
fragments

List of HomologousFragments to assemble.

homology_checker

An HomologyChecker instance definining the homology conditions.

circularize

True to also assemble the end flanks of the final construct.

annotate_homologies

If true, homologies will have an annotation in the final, predicted construct records.

assemble_with(self, fragment, homology_checker, annotate_homology=True, annotation_type='homology')[source]

Return the fragment resulting from the assembly of this fragment with another, in that order.

Parameters
fragment

The other parameter to assemble with.

homology_checker

An HomologyChecker instance definining the homology conditions.

annotate_homology

If true, homologies will have an annotation in the final, predicted construct records.

circularized(self, homology_checker, annotate_homology=False, annotation_type='homology')[source]

Return the Biopython record obtained by cirularizing the result.

Only works if the left and right sticky ends are compatible. The return is a simple Biopython record where the sticky end has been integrated in the sequence.

static from_biopython_record(biopython_record)[source]

Convert a Biopython record into a HomologousFragment (class change).

will_clip_in_this_order_with(self, other_fragment, homology_checker)[source]

Return whether the fragment will assemble with anoter via homology recombination.

homology_checker should be an HomologyChecker instance definining the homology conditions.