Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
832c1d4
adding digeastion
Gonza10V Jul 25, 2022
6e702ba
solving Dseqrecord import
Gonza10V Jul 25, 2022
e26c2c8
updating sequence number cheking error message
Gonza10V Jul 27, 2022
944c0ab
Update digested_reactant logic
Gonza10V Jul 27, 2022
9a4e8c5
updated digestion
Gonza10V Jul 28, 2022
9e59f64
Merge pull request #163 from SynBioDex/develop
Gonza10V Jul 28, 2022
c22bfec
removing -1 from sequence computation on open backbone
Gonza10V Aug 1, 2022
12b7319
Merge branch 'gonzalo-internship3' of github.com:SynBioDex/SBOL-utili…
Gonza10V Aug 1, 2022
3d7ed6a
updating testing with sequence computation
Gonza10V Aug 1, 2022
b954a19
advances in ligation and is_circular helper function
Gonza10V Aug 26, 2022
1fa1049
advances on ligation process logic
Gonza10V Aug 31, 2022
7efbb2c
advances on components creation
Gonza10V Aug 31, 2022
bbf4138
ligation prototype
Gonza10V Sep 1, 2022
0adb6ee
assembly and part in backbone2
Gonza10V Sep 9, 2022
b970902
functional digestion
Gonza10V Sep 28, 2022
627dba9
updated components and tests
Gonza10V Jan 17, 2023
3d2990d
Merge pull request #1 from Gonza10V/gonzalo-internship3
Gonza10V Jan 17, 2023
44e4bc9
Merge branch 'SynBioDex:develop' into develop
Gonza10V Jan 18, 2023
f92d4af
Merge pull request #2 from Gonza10V/develop
Gonza10V Jan 18, 2023
baa89ee
updated version part_in_backbone_from_sbol
Gonza10V Mar 22, 2023
9f07fff
test in separated routines
Gonza10V Mar 22, 2023
a212530
provide a correct file direction for convert_from_genbank
Gonza10V Mar 22, 2023
599be7e
using paterns in sbol-utilities for directories
Gonza10V Mar 27, 2023
260b4d1
add dir from codebase on test_part_in_backbone_from_sbol_bp011
Gonza10V Mar 27, 2023
8cb7404
adding objects to the document
Gonza10V Mar 27, 2023
02e71f4
Update sbol_utilities/component.py
Gonza10V Mar 27, 2023
3d68860
Update sbol_utilities/component.py
Gonza10V Mar 27, 2023
a44b8b2
update
Gonza10V Mar 30, 2023
734b3fa
Merge branch 'gonzalo-internship3' of github.com:Gonza10V/SBOL-utilit…
Gonza10V Mar 30, 2023
2caea26
changes in response to code review 27/03/23
Gonza10V Mar 30, 2023
ccf6aba
if identity is not none overwrite the SBOL component
Gonza10V Apr 21, 2023
63d3414
improved test_part_in_backbone_from_sbol_bp011
Gonza10V Apr 26, 2023
a7c3592
asserts with sets
Gonza10V Apr 26, 2023
0717c46
Update sbol_utilities/component.py
Gonza10V Apr 28, 2023
d33c3e5
adds TODOs
Gonza10V Apr 28, 2023
5d86cf5
minor changes on comments
Gonza10V May 2, 2023
d0460e5
Merge pull request #192 from Gonza10V/gonzalo-internship3
jakebeal May 19, 2023
468d94a
combinatorial assembly and backbone from sbol
Gonza10V Oct 27, 2023
80c813f
Merge branch 'SynBioDex:gonzalo-internship3' into gonzalo-internship3
Gonza10V Oct 27, 2023
3d6598f
adding notebook
Gonza10V Oct 31, 2023
101742f
Merge branch 'gonzalo-internship3' of github.com:Gonza10V/SBOL-utilit…
Gonza10V Oct 31, 2023
335c1d9
update in engineered region
Gonza10V Dec 16, 2023
421a076
appending constraints to er
Gonza10V Dec 16, 2023
193ec3e
swapping er features order on constraints
Gonza10V Dec 16, 2023
5ab7e2a
now fixing order is optional on er
Gonza10V Dec 16, 2023
4408543
fixing order is optional and uses meets intead of preceeds
Gonza10V Dec 16, 2023
408a297
adding a new document to test linear backbone
Gonza10V Mar 26, 2024
f36b5b1
replacing meets for precedes in engineered region
Gonza10V Mar 26, 2024
5b77186
order is fixed by default un enr
Gonza10V Mar 27, 2024
4e0e958
testing now appending constraints
Gonza10V Mar 27, 2024
db85c64
Merge pull request #3 from SynBioDex/gonzalo-internship3
Gonza10V Mar 27, 2024
f9e565c
Merge pull request #233 from Gonza10V/gonzalo-internship3
Gonza10V Mar 27, 2024
1155790
Merge branch 'develop' into gonzalo-internship3
jakebeal Apr 7, 2024
978b6af
Correct missing comma from conflict resolution in setup.py
jakebeal Apr 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 83 additions & 2 deletions sbol_utilities/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import sbol3
import tyto

from sbol_utilities.helper_functions import id_sort, find_child, find_top_level, SBOL3PassiveVisitor, cached_references, is_plasmid
from sbol_utilities.helper_functions import id_sort, find_child, find_top_level, SBOL3PassiveVisitor, cached_references, is_plasmid, is_circular
from sbol_utilities.workarounds import get_parent

from Bio import Restriction
from pydna.dseqrecord import Dseqrecord


# TODO: consider allowing return of LocalSubComponent and ExternallyDefined
Expand Down Expand Up @@ -621,4 +622,84 @@ def part_in_backbone(identity: str, part: sbol3.Component, backbone: sbol3.Compo
part_in_backbone_component.features.append(backbone_subcomponent)
# adding topology
part_in_backbone_component.types.append(topology_type)
return part_in_backbone_component, part_in_backbone_seq
return part_in_backbone_component, part_in_backbone_seq

def digestion(reactant:sbol3.Component, restriction_enzymes:List[sbol3.ExternallyDefined], assembly_plan:sbol3.Component)-> Tuple[sbol3.Component, sbol3.Sequence]:
"""Digests a Component using the provided restriction enzymes and creates a product Component and a digestion Interaction.

Comment thread
Gonza10V marked this conversation as resolved.
:param reactant: DNA to be digested as SBOL Component.
:param restriction_enzymes: Restriction enzymes used Externally Defined.
:return: A tuple of Component and Interaction.
"""
if all(t != sbol3.SBO_DNA for t in reactant.types):
Comment thread
Gonza10V marked this conversation as resolved.
Outdated
raise TypeError(f'The reactant should has a DNA type. Types founded {reactant.types}.')
if len(reactant.sequences)!=1:
raise ValueError(f'The reactant needs to have only one sequence. The input reactant has {len(reactant.sequences)} sequences')
Comment thread
Gonza10V marked this conversation as resolved.
Outdated
participations=[]
restriction_enzymes_pydna=[]
for re in restriction_enzymes:
enzyme = Restriction.__dict__[re.name]
restriction_enzymes_pydna.append(enzyme)
assembly_plan.features.append(re)
modifier_participation = sbol3.Participation(roles=[sbol3.SBO_MODIFIER], participant=re)
participations.append(modifier_participation)

# Inform topology to PyDNA, if not found assuming circular.
if is_circular(reactant):
circular=True
Comment thread
Gonza10V marked this conversation as resolved.
linear=False
elif any(n==sbol3.SO_LINEAR for n in reactant.types):
circular=False
linear=True
else:
circular=True
linear=False
reactant_seq = reactant.sequences[0].lookup().elements
# Dseqrecord is from PyDNA package with reactant sequence
ds_reactant = Dseqrecord(reactant_seq, linear=linear, circular=circular)
digested_reactant = ds_reactant.cut(restriction_enzymes_pydna)

if len(digested_reactant)==0 or len(digested_reactant)>3:
Comment thread
Gonza10V marked this conversation as resolved.
Outdated
raise NotImplementedError(f'Not supported number of products. Found{len(digested_reactant)}')
elif circular and len(digested_reactant)==2:
digested_reactant = ds_reactant.cut(restriction_enzymes_pydna)
Comment thread
Gonza10V marked this conversation as resolved.
Outdated
part_extract, backbone = digested_reactant
Comment thread
Gonza10V marked this conversation as resolved.
Outdated
elif linear and len(digested_reactant)==3:
digested_reactant = ds_reactant.cut(restriction_enzymes_pydna)
# check digested_reactant
prefix, part_extract, suffix = digested_reactant
else: raise NotImplementedError('The reactant has no valid topology type')
# Extracting roles from features
reactant_features_roles = []
for f in reactant.features:
Comment thread
Gonza10V marked this conversation as resolved.
for r in f.roles:
reactant_features_roles.append(r)
# if part
if any(n==tyto.SO.engineered_insert for n in reactant_features_roles):
product_sequence = part_extract.seq
prod_comp, prod_seq = dna_component_with_sequence(identity=f'{reactant.name}_part_extract', sequence=str(product_sequence))
# add sticky ends features
# if backbone
elif any(n==tyto.SO.deletion for n in reactant_features_roles):
product_sequence = backbone.seq
prod_comp, prod_seq = dna_component_with_sequence(identity=f'{reactant.name}_backbone', sequence=str(product_sequence))
# add sticky ends features
# add recognition site features
else: raise NotImplementedError('The reactant has no valid roles')

# Create reactant Participation.
react_subcomp = sbol3.SubComponent(reactant)
assembly_plan.features.append(react_subcomp)
reactant_participation = sbol3.Participation(roles=[sbol3.SBO_REACTANT], participant=react_subcomp)
participations.append(reactant_participation)

prod_subcomp = sbol3.SubComponent(prod_comp)
assembly_plan.features.append(prod_subcomp)
product_participation = sbol3.Participation(roles=[sbol3.SBO_PRODUCT], participant=prod_subcomp)
participations.append(product_participation)

# Make Interaction
interaction = sbol3.Interaction(types=[tyto.SBO.cleavage], participations=participations)
assembly_plan.interactions.append(interaction)

return prod_comp, prod_seq
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
'graphviz',
'tyto>=1.2.1',
'openpyxl',
'sbol_factory>=1.0a11'
'sbol_factory>=1.0a11',
'pydna'
],
extras_require={ # requirements for development
'dev': ['pytest', 'interrogate']
Expand Down