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.
- 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.
- 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.
- 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.
- dnacauldron.AssemblyMix.LigaseCyclingReactionMix¶
alias of <module ‘dnacauldron.AssemblyMix.LigaseCyclingReactionMix’ from ‘/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/site-packages/dnacauldron/AssemblyMix/LigaseCyclingReactionMix.py’>
Fragment¶
- class dnacauldron.Fragment.StickyEndFragment(seq: Seq | MutableSeq | None, id: str | None = '<unknown id>', name: str = '<unknown name>', description: str = '<unknown description>', dbxrefs: list[str] | None = None, features: list[SeqFeature] | None = None, annotations: dict[str, str | int] | None = None, letter_annotations: dict[str, Sequence[Any]] | None = None)[source]¶
Biopython SeqRecord whose sequence has sticky ends.
- annotate_connector(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(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()[source]¶
Plot a fragment as left//PART_NAME//right (where // is a new line)
- class dnacauldron.Fragment.HomologousFragment(seq: Seq | MutableSeq | None, id: str | None = '<unknown id>', name: str = '<unknown name>', description: str = '<unknown description>', dbxrefs: list[str] | None = None, features: list[SeqFeature] | None = None, annotations: dict[str, str | int] | None = None, letter_annotations: dict[str, Sequence[Any]] | None = 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(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(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.