Skip to content

Conversation

@nroehner
Copy link
Member

Primary function validate_composite_part_assemblies returns true if the input composite part was generated only by assemblies that are valid according to SEP 055. This is a partial implementation of the best practices in SEP 055 and partially resolves #73


i = i + 1

return has_insert and has_backbone
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also check location/constraints.


invalid_assemblies = [a for a in activities if is_assembly(a) and not validate_assembly(a, c)]

return len(invalid_assemblies) == 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done more efficiently by applying any to a generator.

from sbol_utilities.workarounds import get_parent


def get_subcomponents(c: sbol3.Component) -> List[sbol3.SubComponent]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing docstrings

class TestBuildPlanning(unittest.TestCase):

def test_validate_composite_part_assemblies(self):
test_doc = sbol3.Document()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing docstrings


sbol3.set_namespace('http://testBuildPlanning.org')

assert validate_composite_part_assemblies(assemble_BBa_K093005(test_doc))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explain why these should or shouldn't work in comments

assert not validate_composite_part_assemblies(assemble_BBa_K093005(test_doc, 'EXTRA_ASSEMBLY_COMPONENT'))

def assemble_BBa_K093005(doc: sbol3.Document, failure_mode: Optional[str] = ''):
doc = sbol3.Document()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above; need comments to explain your testing

…plan. Also modified part in backbone validation to use is_plasmid helper function and check if component contains a single insert and a single backbone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validation of assembly-plan

2 participants