API Reference

sbol2build.sbol2build.add_object_to_doc(obj: SBOLObject, doc: Document) None[source]
sbol2build.sbol2build.append_extracts_to_doc(extract_tuples: List[Tuple[ComponentDefinition, Sequence]], doc: Document) None[source]

Helper function for batch adding sbol2.ComponentDefinition and sbol2.Sequence to an sbol2.Document

Parameters:
  • extract_tuples – list of tuples of sbol2.ComponentDefinition and sbol2.Sequence

  • doc – document which the content is to be added to

sbol2build.sbol2build.backbone_digestion(reactant: ComponentDefinition | ModuleDefinition, restriction_enzymes: List[ComponentDefinition], assembly_plan: ModuleDefinition, document: Document, **kwargs) Tuple[List[Tuple[ComponentDefinition, Sequence]], ModuleDefinition][source]

Runs a simulated digestion on the top level sequence in the reactant ComponentDefinition or ModuleDefinition with the given restriciton enzymes, creating an open backbone ComponentDefinition, a digestion Interaction, and converts existing scars to 5’ and 3’ overhangs. The product ComponentDefinition is assumed the open backbone in this case.

Written for use with the SBOL2.3 output of https://sbolcanvas.org

Parameters:
  • reactant – DNA to be digested as SBOL ComponentDefinition or ModuleDefinition, usually a part_in_backbone. ComponentDefinition is the best-practice type for plasmids.

  • restriction_enzymes – Restriction enzymes as sbol2.ComponentDefinition (generate with rebase_restriction_enzyme()).

  • assembly_plan – SBOL ModuleDefinition to contain the functional components, interactions, and participations

  • document – original SBOL2 document to be used to extract referenced objects.

Returns:

A tuple of a list ComponentDefinitions and Sequences, and an assembly plan ModuleDefinition.

sbol2build.sbol2build.dna_componentdefinition_with_sequence(identity: str, sequence: str, molecule: bool = False, **kwargs) Tuple[ComponentDefinition, Sequence][source]

Creates a DNA ComponentDefinition and its Sequence.

Parameters:
  • identity – The identity of the Component. The identity of Sequence is also identity with the suffix ‘_seq’.

  • sequence – The DNA sequence of the Component encoded in IUPAC.

  • molecule – Boolean value: true if type should be DNA molecule, false if DNA region

  • kwargs – Keyword arguments of any other Component attribute.

Returns:

A tuple of ComponentDefinition and Sequence.

class sbol2build.sbol2build.golden_gate_assembly_plan(name: str, parts_in_backbone: List[Document], plasmid_acceptor_backbone: Document, restriction_enzyme: str, document: Document)[source]

Bases: object

Creates an Assembly Plan.

Parameters:
  • name – Name of the assembly plan ModuleDefinition.

  • parts_in_backbone – Parts in backbone to be assembled.

  • plasmid_acceptor_backbone – Backbone in which parts are inserted on the assembly.

  • restriction_enzyme – Restriction enzyme name used by PyDNA. Case sensitive, follow standard restriction enzyme nomenclature, i.e. ‘BsaI’

  • document – SBOL Document where the assembly plan will be created.

run(plasmids_in_module_definitions=False) List[Tuple[ComponentDefinition, Sequence]][source]

Runs full assembly simulation.

document parameter of golden_gate_assembly_plan object is updated by reference to include assembly plan ModuleDefinition and all related information.

Runs part_digestion() for all parts_in_backbone and backbone_digestion() for plasmid_acceptor_backbone with restriction_enzyme. Then runs ligation() with these parts to form composites.

Returns:

List of all composites generated, in the form of tuples of ComponentDefinition and Sequence.

sbol2build.sbol2build.is_circular(obj: ComponentDefinition) bool[source]

Check if an SBOL Component or Feature is circular.

Parameters:

obj – design to be checked

Returns:

true if circular

sbol2build.sbol2build.ligation(reactants: List[ComponentDefinition], assembly_plan: ModuleDefinition, document: Document, ligase: ComponentDefinition = None) List[Tuple[ComponentDefinition, Sequence]][source]

Ligates Components using base complementarity and creates product Components and a ligation Interaction.

Parameters:
  • reactants – DNA parts to be ligated as SBOL ModuleDefinition.

  • assembly_plan – SBOL ModuleDefinition to contain the functional components, interactions, and participants

  • document – SBOL2 document containing all reactant ComponentDefinitions.

  • ligase – as SBOL ComponentDefinition, optional (defaults to T4 ligase)

Returns:

List of all composites generated, in the form of tuples of ComponentDefinition and Sequence.

sbol2build.sbol2build.number_to_suffix(n)[source]

Helper function for generating scar suffixes of the form: \(S=(A,B,C,…,Z,AA,AB,AC,…,AZ,BA,BB,…, S_n)\)

Parameters:

n – Number to convert to character suffix

Returns:

Character suffix corresponding to n

sbol2build.sbol2build.part_digestion(reactant: ComponentDefinition | ModuleDefinition, restriction_enzymes: List[ComponentDefinition], assembly_plan: ModuleDefinition, document: Document, **kwargs) Tuple[List[Tuple[ComponentDefinition, Sequence]], ModuleDefinition][source]

Runs a simulated digestion on the top level sequence in the reactant ComponentDefinition or ModuleDefinition with the given restriciton enzymes, creating a extracted part ComponentDefinition, a digestion Interaction, and converts existing scars to 5’ and 3’ overhangs. The product ComponentDefinition is assumed the open backbone in this case.

Written for use with the SBOL2.3 output of https://sbolcanvas.org

Parameters:
  • reactant – DNA to be digested as SBOL ComponentDefinition or ModuleDefinition, usually a part_in_backbone. ComponentDefinition is the best-practice type for plasmids..

  • restriction_enzymes – Restriction enzymes as sbol2.ComponentDefinition (generate with rebase_restriction_enzyme()).

  • assembly_plan – SBOL ModuleDefinition to contain the functional components, interactions, and participations

  • document – original SBOL2 document to be used to extract referenced objects.

Returns:

A tuple of a list ComponentDefinitions and Sequences, and an assembly plan ModuleDefinition.

sbol2build.sbol2build.part_in_backbone_from_sbol(identity: str | None, sbol_comp: ComponentDefinition, part_location: List[int], part_roles: List[str], fusion_site_length: int, document: Document, linear: bool = False, **kwargs) Tuple[ComponentDefinition, Sequence][source]

Restructures a plasmid ComponentDefinition to follow the part-in-backbone pattern with scars following BP011. It overwrites the SBOL2 ComponentDefinition provided. A part inserted into a backbone is represented by a Component that includes both the part insert as a feature that is a SubComponent and the backbone as another SubComponent. For more information about BP011 visit https://github.com/SynBioDex/SBOL-examples/tree/main/SBOL/best-practices/BP011

Parameters:
  • identity – The identity of the Component, is its a String it build a new SBOL Component, if None it adds on top of the input. The identity of Sequence is also identity with the suffix ‘_seq’.

  • sbol_comp – The SBOL2 Component that will be used to create the part in backbone Component and Sequence.

  • part_location – List of 2 integers that indicates the start and the end of the unitary part. Note that the index of the first location is 1, as is typical practice in biology, rather than 0, as is typical practice in computer science.

  • part_roles – List of strings that indicates the roles to add on the part.

  • fusion_site_length – Integer of the length of the fusion sites (eg. BsaI fusion site lenght is 4, SapI fusion site lenght is 3)

  • linear – Boolean than indicates if the backbone is linear, defaults to False (cicular topology).

  • kwargs – Keyword arguments of any other Component attribute.

Returns:

ModuleDefinition in the form that sbolcanvas would output

sbol2build.sbol2build.rebase_restriction_enzyme(name: str, **kwargs) ComponentDefinition[source]

Creates an ComponentDefinition Restriction Enzyme Component from rebase.

Parameters:
  • name – Name of the SBOL ExternallyDefined, used by PyDNA. Case sensitive, follow standard restriction enzyme nomenclature, i.e. ‘BsaI’

  • kwargs – Keyword arguments of any other ComponentDefinition attribute.

Returns:

A ComponentDefinition object.