Skip to content
Open
Changes from 1 commit
Commits
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
19 changes: 18 additions & 1 deletion sbol_utilities/helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,21 @@ def is_circular(obj: Union[sbol3.Component, sbol3.LocalSubComponent, sbol3.Exter
:param obj: design to be checked
:return: true if circular
"""
return any(n==sbol3.SO_CIRCULAR for n in obj.types)
return any(n==sbol3.SO_CIRCULAR for n in obj.types)

def is_composite(obj):
def has_dna_type(o):
Comment thread
vinayakjeet marked this conversation as resolved.
return any(tyto.SO.DNA == tyto.SO.get_uri_by_term(t) for t in o.types)

def has_assembly_plan(o):
if not hasattr(o, "generated_by"):
Comment thread
vinayakjeet marked this conversation as resolved.
Outdated
return False
for activity_ref in o.generated_by:
activity = activity_ref.lookup()
if activity and 'http://sbols.org/v3#assemblyPlan' in activity.types and 'sbol:design' in activity.types:
Comment thread
vinayakjeet marked this conversation as resolved.
Outdated
return True
return False

if isinstance(obj, sbol3.Component):
return has_dna_type(obj) and has_assembly_plan(obj)
return False