-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Composite Check Functionality to SBOL Utilities #238
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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): | ||
return any(tyto.SO.DNA == tyto.SO.get_uri_by_term(t) for t in o.types) | ||
|
||
def has_assembly_plan(o): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this should be necessary, because every |
||
if not hasattr(o, "generated_by"): | ||
return False | ||
for activity_ref in o.generated_by: | ||
activity = activity_ref.lookup() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please change |
||
if activity and 'http://sbols.org/v3#assemblyPlan' in activity.types and 'sbol:design' in activity.types: | ||
return True | ||
return False | ||
|
||
if isinstance(obj, sbol3.Component): | ||
return has_dna_type(obj) and has_assembly_plan(obj) | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function needs docstring