diff --git a/.gitignore b/.gitignore index e613347..397db57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ -/src/paml_check.egg-info/ +/src/labop_check.egg-info/ /env/ /.idea/misc.xml /.idea/modules.xml -/.idea/paml-check.iml +/.idea/labop-check.iml /.idea/inspectionProfiles/profiles_settings.xml /.idea/inspectionProfiles/Project_Default.xml /.idea/vcs.xml diff --git a/.idea/paml-check.iml b/.idea/paml-check.iml new file mode 100644 index 0000000..49b5ec5 --- /dev/null +++ b/.idea/paml-check.iml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Pipfile b/Pipfile index 79ed465..27c2a26 100644 --- a/Pipfile +++ b/Pipfile @@ -4,8 +4,8 @@ verify_ssl = true name = "pypi" [packages] -paml-check = {editable = true, path = "."} -paml = {ref = "f0102179c2494d6f2b785aa9b32b1c6a80604c2f", git = "https://github.com/SD2E/paml.git"} +labop-check = {editable = true, path = "."} +labop = {ref = "f0102179c2494d6f2b785aa9b32b1c6a80604c2f", git = "https://github.com/SD2E/labop.git"} pyparsing = "==2.4.7" pyshacl = "==0.14.0" rdflib = "==5.0.0" diff --git a/README.md b/README.md index f873c21..c923769 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# paml-check \ No newline at end of file +# labop-check \ No newline at end of file diff --git a/setup.py b/setup.py index df17a12..c7c42ef 100644 --- a/setup.py +++ b/setup.py @@ -7,34 +7,37 @@ with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() + def _post_install(): print("Installing z3...") os.system("pysmt-install --z3 --confirm-agreement") os.system("export PYSMT_CYTHON=0") -setup(name='labop_check', - version='0.1.3', - description='LabOP Checker', - long_description=long_description, - long_description_content_type='text/markdown', - url='https://github.com/SD2E/labop-check', - author='Dan Bryce', - author_email='dbryce@sift.net', - license='MIT', - packages=find_packages('src'), - package_dir={'': 'src'}, - install_requires=[ - # "paml" This requires that paml have a valid package name - "pint", - "pysmt", - "sbol3", - "z3-solver", - # "plotly>=5.3.1", - "pandas", - "graphviz" - ], - tests_require=["pytest"], - zip_safe=False - ) + +setup( + name="labop_check", + version="0.1.3", + description="LabOP Checker", + long_description=long_description, + long_description_content_type="text/markdown", + url="https://github.com/SD2E/labop-check", + author="Dan Bryce", + author_email="dbryce@sift.net", + license="MIT", + packages=find_packages("src"), + package_dir={"": "src"}, + install_requires=[ + # "labop" This requires that labop have a valid package name + "pint", + "pysmt", + "sbol3", + "z3-solver", + # "plotly>=5.3.1", + "pandas", + "graphviz", + ], + tests_require=["pytest"], + zip_safe=False, +) _post_install() diff --git a/src/paml_check.egg-info/PKG-INFO b/src/paml_check.egg-info/PKG-INFO new file mode 100644 index 0000000..f7d24ae --- /dev/null +++ b/src/paml_check.egg-info/PKG-INFO @@ -0,0 +1,14 @@ +Metadata-Version: 2.1 +Name: paml-check +Version: 0.1.3 +Summary: LabOP Checker +Home-page: https://github.com/SD2E/paml-check +Author: Dan Bryce +Author-email: dbryce@sift.net +License: MIT +Platform: UNKNOWN +Description-Content-Type: text/markdown +License-File: LICENSE + +# paml-check + diff --git a/src/paml_check.egg-info/SOURCES.txt b/src/paml_check.egg-info/SOURCES.txt new file mode 100644 index 0000000..da95cf6 --- /dev/null +++ b/src/paml_check.egg-info/SOURCES.txt @@ -0,0 +1,30 @@ +LICENSE +README.md +pyproject.toml +setup.py +src/paml_check/__init__.py +src/paml_check/activity_graph.py +src/paml_check/constraints.py +src/paml_check/minimize_duration.py +src/paml_check/paml_check.py +src/paml_check/plot.py +src/paml_check/protocol.py +src/paml_check/schedule.py +src/paml_check/units.py +src/paml_check/utils.py +src/paml_check.egg-info/PKG-INFO +src/paml_check.egg-info/SOURCES.txt +src/paml_check.egg-info/dependency_links.txt +src/paml_check.egg-info/not-zip-safe +src/paml_check.egg-info/requires.txt +src/paml_check.egg-info/top_level.txt +src/paml_check/convert_constraints/__init__.py +src/paml_check/convert_constraints/comparison.py +src/paml_check/convert_constraints/duration.py +src/paml_check/convert_constraints/expression.py +src/paml_check/convert_constraints/logic.py +src/paml_check/convert_constraints/time.py +test/test_generate_constraints.py +test/test_hand_coded.py +test/test_read_paml.py +test/test_subprotocol.py \ No newline at end of file diff --git a/src/paml_check.egg-info/dependency_links.txt b/src/paml_check.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/paml_check.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/src/paml_check.egg-info/not-zip-safe b/src/paml_check.egg-info/not-zip-safe new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/paml_check.egg-info/not-zip-safe @@ -0,0 +1 @@ + diff --git a/src/paml_check.egg-info/requires.txt b/src/paml_check.egg-info/requires.txt new file mode 100644 index 0000000..384ee58 --- /dev/null +++ b/src/paml_check.egg-info/requires.txt @@ -0,0 +1,6 @@ +pint +pysmt +sbol3 +z3-solver +pandas +graphviz diff --git a/src/paml_check.egg-info/top_level.txt b/src/paml_check.egg-info/top_level.txt new file mode 100644 index 0000000..4b8dbd5 --- /dev/null +++ b/src/paml_check.egg-info/top_level.txt @@ -0,0 +1 @@ +paml_check diff --git a/test/generation/test_LUDOX_dual_protocol.py b/test/generation/test_LUDOX_dual_protocol.py index 2565726..a99f426 100644 --- a/test/generation/test_LUDOX_dual_protocol.py +++ b/test/generation/test_LUDOX_dual_protocol.py @@ -3,63 +3,71 @@ import unittest import filecmp import sbol3 -import paml +import labop import tyto + class TestLUDOXDual(unittest.TestCase): - paml_file = os.path.join(os.getcwd(), 'test/resources/paml', 'igem_ludox_dual_draft.ttl') - paml_format = sbol3.TURTLE + labop_file = os.path.join( + os.getcwd(), "test/resources/labop", "igem_ludox_dual_draft.ttl" + ) + labop_format = sbol3.TURTLE - # @unittest.skipIf(os.path.isfile(paml_file), + # @unittest.skipIf(os.path.isfile(labop_file), # "skipped due to local cache") def test_create_dual_protocol(self): ############################################# # set up the document - print('Setting up document') + print("Setting up document") doc = sbol3.Document() - sbol3.set_namespace('https://bbn.com/scratch/') + sbol3.set_namespace("https://bbn.com/scratch/") ############################################# # Import the primitive libraries - print('Importing libraries') - paml.import_library('liquid_handling') - print('... Imported liquid handling') - paml.import_library('plate_handling') - print('... Imported plate handling') - paml.import_library('spectrophotometry') - print('... Imported spectrophotometry') - paml.import_library('sample_arrays') - print('... Imported sample arrays') + print("Importing libraries") + labop.import_library("liquid_handling") + print("... Imported liquid handling") + labop.import_library("plate_handling") + print("... Imported plate handling") + labop.import_library("spectrophotometry") + print("... Imported spectrophotometry") + labop.import_library("sample_arrays") + print("... Imported sample arrays") # create the materials to be provisioned - ddh2o = sbol3.Component('ddH2O', 'https://identifiers.org/pubchem.substance:24901740') - ddh2o.name = 'Water, sterile-filtered, BioReagent, suitable for cell culture' # TODO get via tyto + ddh2o = sbol3.Component( + "ddH2O", "https://identifiers.org/pubchem.substance:24901740" + ) + ddh2o.name = "Water, sterile-filtered, BioReagent, suitable for cell culture" # TODO get via tyto doc.add(ddh2o) - ludox = sbol3.Component('LUDOX', 'https://identifiers.org/pubchem.substance:24866361') - ludox.name = 'LUDOX(R) CL-X colloidal silica, 45 wt. % suspension in H2O' + ludox = sbol3.Component( + "LUDOX", "https://identifiers.org/pubchem.substance:24866361" + ) + ludox.name = ( + "LUDOX(R) CL-X colloidal silica, 45 wt. % suspension in H2O" + ) doc.add(ludox) - self.create_protocol_a(doc, ddh2o, ludox) self.create_protocol_b(doc, ddh2o, ludox) ######################################## # Validate and write the document - print('Validating and writing protocol') + print("Validating and writing protocol") v = doc.validate() - assert len(v) == 0, "".join(f'\n {e}' for e in v) + assert len(v) == 0, "".join(f"\n {e}" for e in v) - doc.write(self.paml_file, self.paml_format) - print(f'Wrote file as {self.paml_file}') + doc.write(self.labop_file, self.labop_format) + print(f"Wrote file as {self.labop_file}") def create_protocol_a(self, doc, ddh2o, ludox): ############################################# # Create the protocol - print('Creating protocol') - protocol = paml.Protocol('iGEM_LUDOX_OD_calibration_2018_A') + print("Creating protocol") + protocol = labop.Protocol("iGEM_LUDOX_OD_calibration_2018_A") protocol.name = "iGEM 2018 LUDOX OD calibration protocol A" - protocol.description = ''' + protocol.description = """ With this protocol you will use LUDOX CL-X (a 45% colloidal silica suspension) as a single point reference to obtain a conversion factor to transform absorbance (OD600) data from your plate reader into a comparable OD600 measurement as would be obtained in a spectrophotometer. This conversion is necessary because plate @@ -69,35 +77,61 @@ def create_protocol_a(self, doc, ddh2o, ludox): Therefore this conversion calculation can transform OD600 measurements from a plate reader (i.e. absorbance at 600 nm, the basic output of most instruments) into comparable OD600 measurements. The LUDOX solution is only weakly scattering and so will give a low absorbance value. - ''' + """ doc.add(protocol) # actual steps of the protocol # get a plate - plate = protocol.primitive_step('EmptyContainer', specification=tyto.NCIT.get_uri_by_term('Microplate')) # replace with container ontology + plate = protocol.primitive_step( + "EmptyContainer", + specification=tyto.NCIT.get_uri_by_term("Microplate"), + ) # replace with container ontology # put ludox and water in selected wells - c_ddh2o = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A1:D1') - protocol.primitive_step('Provision', resource=ludox, destination=c_ddh2o.output_pin('samples'), - amount=sbol3.Measure(100, tyto.OM.microliter)) - - c_ludox = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A2:D2') - protocol.primitive_step('Provision', resource=ddh2o, destination=c_ludox.output_pin('samples'), - amount=sbol3.Measure(100, tyto.OM.microliter)) + c_ddh2o = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A1:D1", + ) + protocol.primitive_step( + "Provision", + resource=ludox, + destination=c_ddh2o.output_pin("samples"), + amount=sbol3.Measure(100, tyto.OM.microliter), + ) + + c_ludox = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A2:D2", + ) + protocol.primitive_step( + "Provision", + resource=ddh2o, + destination=c_ludox.output_pin("samples"), + amount=sbol3.Measure(100, tyto.OM.microliter), + ) # measure the absorbance - c_measure = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A1:D2') - measure = protocol.primitive_step('MeasureAbsorbance', samples=c_measure.output_pin('samples'), - wavelength=sbol3.Measure(600, tyto.OM.nanometer)) - - protocol.add_output('absorbance', measure.output_pin('measurements')) + c_measure = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A1:D2", + ) + measure = protocol.primitive_step( + "MeasureAbsorbance", + samples=c_measure.output_pin("samples"), + wavelength=sbol3.Measure(600, tyto.OM.nanometer), + ) + + protocol.add_output("absorbance", measure.output_pin("measurements")) def create_protocol_b(self, doc, ddh2o, ludox): ############################################# # Create the protocol - print('Creating protocol') - protocol = paml.Protocol('iGEM_LUDOX_OD_calibration_2018_B') + print("Creating protocol") + protocol = labop.Protocol("iGEM_LUDOX_OD_calibration_2018_B") protocol.name = "iGEM 2018 LUDOX OD calibration protocol B" - protocol.description = ''' + protocol.description = """ With this protocol you will use LUDOX CL-X (a 45% colloidal silica suspension) as a single point reference to obtain a conversion factor to transform absorbance (OD600) data from your plate reader into a comparable OD600 measurement as would be obtained in a spectrophotometer. This conversion is necessary because plate @@ -107,29 +141,55 @@ def create_protocol_b(self, doc, ddh2o, ludox): Therefore this conversion calculation can transform OD600 measurements from a plate reader (i.e. absorbance at 600 nm, the basic output of most instruments) into comparable OD600 measurements. The LUDOX solution is only weakly scattering and so will give a low absorbance value. - ''' + """ doc.add(protocol) # actual steps of the protocol # get a plate - plate = protocol.primitive_step('EmptyContainer', specification=tyto.NCIT.get_uri_by_term('Microplate')) # replace with container ontology + plate = protocol.primitive_step( + "EmptyContainer", + specification=tyto.NCIT.get_uri_by_term("Microplate"), + ) # replace with container ontology # put ludox and water in selected wells - c_ddh2o = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A1:D1') - protocol.primitive_step('Provision', resource=ludox, destination=c_ddh2o.output_pin('samples'), - amount=sbol3.Measure(100, tyto.OM.microliter)) - - c_ludox = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A2:D2') - protocol.primitive_step('Provision', resource=ddh2o, destination=c_ludox.output_pin('samples'), - amount=sbol3.Measure(100, tyto.OM.microliter)) + c_ddh2o = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A1:D1", + ) + protocol.primitive_step( + "Provision", + resource=ludox, + destination=c_ddh2o.output_pin("samples"), + amount=sbol3.Measure(100, tyto.OM.microliter), + ) + + c_ludox = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A2:D2", + ) + protocol.primitive_step( + "Provision", + resource=ddh2o, + destination=c_ludox.output_pin("samples"), + amount=sbol3.Measure(100, tyto.OM.microliter), + ) # measure the absorbance - c_measure = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A1:D2') - measure = protocol.primitive_step('MeasureAbsorbance', samples=c_measure.output_pin('samples'), - wavelength=sbol3.Measure(600, tyto.OM.nanometer)) + c_measure = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A1:D2", + ) + measure = protocol.primitive_step( + "MeasureAbsorbance", + samples=c_measure.output_pin("samples"), + wavelength=sbol3.Measure(600, tyto.OM.nanometer), + ) + + protocol.add_output("absorbance", measure.output_pin("measurements")) - protocol.add_output('absorbance', measure.output_pin('measurements')) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() - diff --git a/test/generation/test_LUDOX_dual_time_protocol.py b/test/generation/test_LUDOX_dual_time_protocol.py index 7fc4c3d..d5b8047 100644 --- a/test/generation/test_LUDOX_dual_time_protocol.py +++ b/test/generation/test_LUDOX_dual_time_protocol.py @@ -3,94 +3,127 @@ import unittest import filecmp import sbol3 -import paml -import paml_time as pamlt +import labop +import labop_time as labopt import tyto + class TestLUDOXDual(unittest.TestCase): - paml_file = os.path.join(os.getcwd(), 'test/resources/paml', 'igem_ludox_dual_time_draft.ttl') - paml_format = sbol3.TURTLE + labop_file = os.path.join( + os.getcwd(), "test/resources/labop", "igem_ludox_dual_time_draft.ttl" + ) + labop_format = sbol3.TURTLE - # @unittest.skipIf(os.path.isfile(paml_file), + # @unittest.skipIf(os.path.isfile(labop_file), # "skipped due to local cache") def test_create_dual_protocol(self): ############################################# # set up the document - print('Setting up document') + print("Setting up document") doc = sbol3.Document() - sbol3.set_namespace('https://bbn.com/scratch/') + sbol3.set_namespace("https://bbn.com/scratch/") ############################################# # Import the primitive libraries - print('Importing libraries') - paml.import_library('liquid_handling') - print('... Imported liquid handling') - paml.import_library('plate_handling') - print('... Imported plate handling') - paml.import_library('spectrophotometry') - print('... Imported spectrophotometry') - paml.import_library('sample_arrays') - print('... Imported sample arrays') + print("Importing libraries") + labop.import_library("liquid_handling") + print("... Imported liquid handling") + labop.import_library("plate_handling") + print("... Imported plate handling") + labop.import_library("spectrophotometry") + print("... Imported spectrophotometry") + labop.import_library("sample_arrays") + print("... Imported sample arrays") # create the materials to be provisioned - ddh2o = sbol3.Component('ddH2O', 'https://identifiers.org/pubchem.substance:24901740') - ddh2o.name = 'Water, sterile-filtered, BioReagent, suitable for cell culture' # TODO get via tyto + ddh2o = sbol3.Component( + "ddH2O", "https://identifiers.org/pubchem.substance:24901740" + ) + ddh2o.name = "Water, sterile-filtered, BioReagent, suitable for cell culture" # TODO get via tyto doc.add(ddh2o) - ludox = sbol3.Component('LUDOX', 'https://identifiers.org/pubchem.substance:24866361') - ludox.name = 'LUDOX(R) CL-X colloidal silica, 45 wt. % suspension in H2O' + ludox = sbol3.Component( + "LUDOX", "https://identifiers.org/pubchem.substance:24866361" + ) + ludox.name = ( + "LUDOX(R) CL-X colloidal silica, 45 wt. % suspension in H2O" + ) doc.add(ludox) - a = self.create_protocol_a(doc, ddh2o, ludox) b = self.create_protocol_b(doc, ddh2o, ludox) - + # FIXME this is a quick and dirty test to see if things are working at all. # Testing of multiple protocols needs to be thought through in greater detail. constraints = [] # protocol a starts at time 0 - constraints.append(pamlt.startTime(a['protocol'], 0, units=tyto.OM.hour)) + constraints.append( + labopt.startTime(a["protocol"], 0, units=tyto.OM.hour) + ) # protocol b starts at time hour 1 - constraints.append(pamlt.startTime(b['protocol'], 1, units=tyto.OM.hour)) + constraints.append( + labopt.startTime(b["protocol"], 1, units=tyto.OM.hour) + ) # ludox durations are 60 seconds - constraints.append(pamlt.duration(a['ludox'], 60, units=tyto.OM.second)) - constraints.append(pamlt.duration(b['ludox'], 60, units=tyto.OM.second)) + constraints.append( + labopt.duration(a["ludox"], 60, units=tyto.OM.second) + ) + constraints.append( + labopt.duration(b["ludox"], 60, units=tyto.OM.second) + ) # ddh2o durations are 60 seconds - constraints.append(pamlt.duration(a['ddh2o'], 60, units=tyto.OM.second)) - constraints.append(pamlt.duration(b['ddh2o'], 60, units=tyto.OM.second)) + constraints.append( + labopt.duration(a["ddh2o"], 60, units=tyto.OM.second) + ) + constraints.append( + labopt.duration(b["ddh2o"], 60, units=tyto.OM.second) + ) - constraints.append(pamlt.duration(a['measure'], 60, units=tyto.OM.minute)) - constraints.append(pamlt.duration(b['measure'], 60, units=tyto.OM.minute)) + constraints.append( + labopt.duration(a["measure"], 60, units=tyto.OM.minute) + ) + constraints.append( + labopt.duration(b["measure"], 60, units=tyto.OM.minute) + ) - constraints.append(pamlt.precedes(a['ludox'], [10, 15], a['ddh2o'], units=tyto.OM.hour)) - constraints.append(pamlt.precedes(b['ludox'], [10, 15], b['ddh2o'], units=tyto.OM.hour)) + constraints.append( + labopt.precedes( + a["ludox"], [10, 15], a["ddh2o"], units=tyto.OM.hour + ) + ) + constraints.append( + labopt.precedes( + b["ludox"], [10, 15], b["ddh2o"], units=tyto.OM.hour + ) + ) - time_constraints = pamlt.TimeConstraints("ludox_protocol_constraints", - constraints=[pamlt.And(constraints)], - protocols = [a['protocol'], b['protocol']] + time_constraints = labopt.TimeConstraints( + "ludox_protocol_constraints", + constraints=[labopt.And(constraints)], + protocols=[a["protocol"], b["protocol"]], ) doc.add(time_constraints) ######################################## # Validate and write the document - print('Validating and writing protocol') + print("Validating and writing protocol") v = doc.validate() - assert len(v) == 0, "".join(f'\n {e}' for e in v) + assert len(v) == 0, "".join(f"\n {e}" for e in v) - doc.write(self.paml_file, self.paml_format) - print(f'Wrote file as {self.paml_file}') + doc.write(self.labop_file, self.labop_format) + print(f"Wrote file as {self.labop_file}") def create_protocol_a(self, doc, ddh2o, ludox): ############################################# # Create the protocol - print('Creating protocol') - protocol = paml.Protocol('iGEM_LUDOX_OD_calibration_2018_A') + print("Creating protocol") + protocol = labop.Protocol("iGEM_LUDOX_OD_calibration_2018_A") protocol.name = "iGEM 2018 LUDOX OD calibration protocol A" - protocol.description = ''' + protocol.description = """ With this protocol you will use LUDOX CL-X (a 45% colloidal silica suspension) as a single point reference to obtain a conversion factor to transform absorbance (OD600) data from your plate reader into a comparable OD600 measurement as would be obtained in a spectrophotometer. This conversion is necessary because plate @@ -100,42 +133,68 @@ def create_protocol_a(self, doc, ddh2o, ludox): Therefore this conversion calculation can transform OD600 measurements from a plate reader (i.e. absorbance at 600 nm, the basic output of most instruments) into comparable OD600 measurements. The LUDOX solution is only weakly scattering and so will give a low absorbance value. - ''' + """ doc.add(protocol) # actual steps of the protocol # get a plate - plate = protocol.primitive_step('EmptyContainer', specification=tyto.NCIT.get_uri_by_term('Microplate')) # replace with container ontology + plate = protocol.primitive_step( + "EmptyContainer", + specification=tyto.NCIT.get_uri_by_term("Microplate"), + ) # replace with container ontology # put ludox and water in selected wells - c_ddh2o = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A1:D1') - provision_ludox = protocol.primitive_step('Provision', resource=ludox, destination=c_ddh2o.output_pin('samples'), - amount=sbol3.Measure(100, tyto.OM.microliter)) + c_ddh2o = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A1:D1", + ) + provision_ludox = protocol.primitive_step( + "Provision", + resource=ludox, + destination=c_ddh2o.output_pin("samples"), + amount=sbol3.Measure(100, tyto.OM.microliter), + ) - c_ludox = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A2:D2') - provision_ddh2o = protocol.primitive_step('Provision', resource=ddh2o, destination=c_ludox.output_pin('samples'), - amount=sbol3.Measure(100, tyto.OM.microliter)) + c_ludox = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A2:D2", + ) + provision_ddh2o = protocol.primitive_step( + "Provision", + resource=ddh2o, + destination=c_ludox.output_pin("samples"), + amount=sbol3.Measure(100, tyto.OM.microliter), + ) # measure the absorbance - c_measure = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A1:D2') - measure = protocol.primitive_step('MeasureAbsorbance', samples=c_measure.output_pin('samples'), - wavelength=sbol3.Measure(600, tyto.OM.nanometer)) + c_measure = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A1:D2", + ) + measure = protocol.primitive_step( + "MeasureAbsorbance", + samples=c_measure.output_pin("samples"), + wavelength=sbol3.Measure(600, tyto.OM.nanometer), + ) - protocol.add_output('absorbance', measure.output_pin('measurements')) + protocol.add_output("absorbance", measure.output_pin("measurements")) return { - 'protocol': protocol, - 'ludox': provision_ludox, - 'ddh2o': provision_ddh2o, - 'measure': measure + "protocol": protocol, + "ludox": provision_ludox, + "ddh2o": provision_ddh2o, + "measure": measure, } def create_protocol_b(self, doc, ddh2o, ludox): ############################################# # Create the protocol - print('Creating protocol') - protocol = paml.Protocol('iGEM_LUDOX_OD_calibration_2018_B') + print("Creating protocol") + protocol = labop.Protocol("iGEM_LUDOX_OD_calibration_2018_B") protocol.name = "iGEM 2018 LUDOX OD calibration protocol B" - protocol.description = ''' + protocol.description = """ With this protocol you will use LUDOX CL-X (a 45% colloidal silica suspension) as a single point reference to obtain a conversion factor to transform absorbance (OD600) data from your plate reader into a comparable OD600 measurement as would be obtained in a spectrophotometer. This conversion is necessary because plate @@ -145,36 +204,62 @@ def create_protocol_b(self, doc, ddh2o, ludox): Therefore this conversion calculation can transform OD600 measurements from a plate reader (i.e. absorbance at 600 nm, the basic output of most instruments) into comparable OD600 measurements. The LUDOX solution is only weakly scattering and so will give a low absorbance value. - ''' + """ doc.add(protocol) # actual steps of the protocol # get a plate - plate = protocol.primitive_step('EmptyContainer', specification=tyto.NCIT.get_uri_by_term('Microplate')) # replace with container ontology + plate = protocol.primitive_step( + "EmptyContainer", + specification=tyto.NCIT.get_uri_by_term("Microplate"), + ) # replace with container ontology # put ludox and water in selected wells - c_ddh2o = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A1:D1') - provision_ludox = protocol.primitive_step('Provision', resource=ludox, destination=c_ddh2o.output_pin('samples'), - amount=sbol3.Measure(100, tyto.OM.microliter)) + c_ddh2o = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A1:D1", + ) + provision_ludox = protocol.primitive_step( + "Provision", + resource=ludox, + destination=c_ddh2o.output_pin("samples"), + amount=sbol3.Measure(100, tyto.OM.microliter), + ) - c_ludox = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A2:D2') - provision_ddh2o = protocol.primitive_step('Provision', resource=ddh2o, destination=c_ludox.output_pin('samples'), - amount=sbol3.Measure(100, tyto.OM.microliter)) + c_ludox = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A2:D2", + ) + provision_ddh2o = protocol.primitive_step( + "Provision", + resource=ddh2o, + destination=c_ludox.output_pin("samples"), + amount=sbol3.Measure(100, tyto.OM.microliter), + ) # measure the absorbance - c_measure = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A1:D2') - measure = protocol.primitive_step('MeasureAbsorbance', samples=c_measure.output_pin('samples'), - wavelength=sbol3.Measure(600, tyto.OM.nanometer)) + c_measure = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A1:D2", + ) + measure = protocol.primitive_step( + "MeasureAbsorbance", + samples=c_measure.output_pin("samples"), + wavelength=sbol3.Measure(600, tyto.OM.nanometer), + ) - protocol.add_output('absorbance', measure.output_pin('measurements')) + protocol.add_output("absorbance", measure.output_pin("measurements")) return { - 'protocol': protocol, - 'ludox': provision_ludox, - 'ddh2o': provision_ddh2o, - 'measure': measure + "protocol": protocol, + "ludox": provision_ludox, + "ddh2o": provision_ddh2o, + "measure": measure, } -if __name__ == '__main__': + +if __name__ == "__main__": unittest.main() - diff --git a/test/generation/test_LUDOX_protocol.py b/test/generation/test_LUDOX_protocol.py index e1f4081..07c75ef 100644 --- a/test/generation/test_LUDOX_protocol.py +++ b/test/generation/test_LUDOX_protocol.py @@ -3,40 +3,43 @@ import unittest import filecmp import sbol3 -import paml +import labop import tyto + class TestLUDOX(unittest.TestCase): - paml_file = os.path.join(os.getcwd(), 'test/resources/paml', 'igem_ludox_draft.ttl') - paml_format = sbol3.TURTLE + labop_file = os.path.join( + os.getcwd(), "test/resources/labop", "igem_ludox_draft.ttl" + ) + labop_format = sbol3.TURTLE - # @unittest.skipIf(os.path.isfile(paml_file), + # @unittest.skipIf(os.path.isfile(labop_file), # "skipped due to local cache") def test_create_protocol(self): ############################################# # set up the document - print('Setting up document') + print("Setting up document") doc = sbol3.Document() - sbol3.set_namespace('https://bbn.com/scratch/') + sbol3.set_namespace("https://bbn.com/scratch/") ############################################# # Import the primitive libraries - print('Importing libraries') - paml.import_library('liquid_handling') - print('... Imported liquid handling') - paml.import_library('plate_handling') - print('... Imported plate handling') - paml.import_library('spectrophotometry') - print('... Imported spectrophotometry') - paml.import_library('sample_arrays') - print('... Imported sample arrays') + print("Importing libraries") + labop.import_library("liquid_handling") + print("... Imported liquid handling") + labop.import_library("plate_handling") + print("... Imported plate handling") + labop.import_library("spectrophotometry") + print("... Imported spectrophotometry") + labop.import_library("sample_arrays") + print("... Imported sample arrays") ############################################# # Create the protocol - print('Creating protocol') - protocol = paml.Protocol('iGEM_LUDOX_OD_calibration_2018') + print("Creating protocol") + protocol = labop.Protocol("iGEM_LUDOX_OD_calibration_2018") protocol.name = "iGEM 2018 LUDOX OD calibration protocol" - protocol.description = ''' + protocol.description = """ With this protocol you will use LUDOX CL-X (a 45% colloidal silica suspension) as a single point reference to obtain a conversion factor to transform absorbance (OD600) data from your plate reader into a comparable OD600 measurement as would be obtained in a spectrophotometer. This conversion is necessary because plate @@ -46,48 +49,79 @@ def test_create_protocol(self): Therefore this conversion calculation can transform OD600 measurements from a plate reader (i.e. absorbance at 600 nm, the basic output of most instruments) into comparable OD600 measurements. The LUDOX solution is only weakly scattering and so will give a low absorbance value. - ''' + """ doc.add(protocol) # create the materials to be provisioned - ddh2o = sbol3.Component('ddH2O', 'https://identifiers.org/pubchem.substance:24901740') - ddh2o.name = 'Water, sterile-filtered, BioReagent, suitable for cell culture' # TODO get via tyto + ddh2o = sbol3.Component( + "ddH2O", "https://identifiers.org/pubchem.substance:24901740" + ) + ddh2o.name = "Water, sterile-filtered, BioReagent, suitable for cell culture" # TODO get via tyto doc.add(ddh2o) - ludox = sbol3.Component('LUDOX', 'https://identifiers.org/pubchem.substance:24866361') - ludox.name = 'LUDOX(R) CL-X colloidal silica, 45 wt. % suspension in H2O' + ludox = sbol3.Component( + "LUDOX", "https://identifiers.org/pubchem.substance:24866361" + ) + ludox.name = ( + "LUDOX(R) CL-X colloidal silica, 45 wt. % suspension in H2O" + ) doc.add(ludox) # actual steps of the protocol # get a plate - plate = protocol.primitive_step('EmptyContainer', specification=tyto.NCIT.get_uri_by_term('Microplate')) # replace with container ontology + plate = protocol.primitive_step( + "EmptyContainer", + specification=tyto.NCIT.get_uri_by_term("Microplate"), + ) # replace with container ontology # put ludox and water in selected wells - c_ddh2o = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A1:D1') - protocol.primitive_step('Provision', resource=ludox, destination=c_ddh2o.output_pin('samples'), - amount=sbol3.Measure(100, tyto.OM.microliter)) + c_ddh2o = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A1:D1", + ) + protocol.primitive_step( + "Provision", + resource=ludox, + destination=c_ddh2o.output_pin("samples"), + amount=sbol3.Measure(100, tyto.OM.microliter), + ) - c_ludox = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A2:D2') - protocol.primitive_step('Provision', resource=ddh2o, destination=c_ludox.output_pin('samples'), - amount=sbol3.Measure(100, tyto.OM.microliter)) + c_ludox = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A2:D2", + ) + protocol.primitive_step( + "Provision", + resource=ddh2o, + destination=c_ludox.output_pin("samples"), + amount=sbol3.Measure(100, tyto.OM.microliter), + ) # measure the absorbance - c_measure = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A1:D2') - measure = protocol.primitive_step('MeasureAbsorbance', samples=c_measure.output_pin('samples'), - wavelength=sbol3.Measure(600, tyto.OM.nanometer)) + c_measure = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A1:D2", + ) + measure = protocol.primitive_step( + "MeasureAbsorbance", + samples=c_measure.output_pin("samples"), + wavelength=sbol3.Measure(600, tyto.OM.nanometer), + ) - protocol.add_output('absorbance', measure.output_pin('measurements')) + protocol.add_output("absorbance", measure.output_pin("measurements")) ######################################## # Validate and write the document - print('Validating and writing protocol') + print("Validating and writing protocol") v = doc.validate() - assert len(v) == 0, "".join(f'\n {e}' for e in v) + assert len(v) == 0, "".join(f"\n {e}" for e in v) - doc.write(self.paml_file, self.paml_format) - print(f'Wrote file as {self.paml_file}') + doc.write(self.labop_file, self.labop_format) + print(f"Wrote file as {self.labop_file}") -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() - diff --git a/test/generation/test_LUDOX_time_protocol.py b/test/generation/test_LUDOX_time_protocol.py index 5341803..67ba682 100644 --- a/test/generation/test_LUDOX_time_protocol.py +++ b/test/generation/test_LUDOX_time_protocol.py @@ -3,41 +3,44 @@ import unittest import filecmp import sbol3 -import paml -import paml_time as pamlt +import labop +import labop_time as labopt import tyto + class TestLUDOXTime(unittest.TestCase): - paml_file = os.path.join(os.getcwd(), 'test/resources/paml', 'igem_ludox_time_draft.ttl') - paml_format = sbol3.TURTLE + labop_file = os.path.join( + os.getcwd(), "test/resources/labop", "igem_ludox_time_draft.ttl" + ) + labop_format = sbol3.TURTLE - # @unittest.skipIf(os.path.isfile(paml_file), + # @unittest.skipIf(os.path.isfile(labop_file), # "skipped due to local cache") def test_create_protocol(self): ############################################# # set up the document - print('Setting up document') + print("Setting up document") doc = sbol3.Document() - sbol3.set_namespace('https://bbn.com/scratch/') + sbol3.set_namespace("https://bbn.com/scratch/") ############################################# # Import the primitive libraries - print('Importing libraries') - paml.import_library('liquid_handling') - print('... Imported liquid handling') - paml.import_library('plate_handling') - print('... Imported plate handling') - paml.import_library('spectrophotometry') - print('... Imported spectrophotometry') - paml.import_library('sample_arrays') - print('... Imported sample arrays') + print("Importing libraries") + labop.import_library("liquid_handling") + print("... Imported liquid handling") + labop.import_library("plate_handling") + print("... Imported plate handling") + labop.import_library("spectrophotometry") + print("... Imported spectrophotometry") + labop.import_library("sample_arrays") + print("... Imported sample arrays") ############################################# # Create the protocol - print('Creating protocol') - protocol = paml.Protocol('iGEM_LUDOX_OD_calibration_2018') + print("Creating protocol") + protocol = labop.Protocol("iGEM_LUDOX_OD_calibration_2018") protocol.name = "iGEM 2018 LUDOX OD calibration protocol" - protocol.description = ''' + protocol.description = """ With this protocol you will use LUDOX CL-X (a 45% colloidal silica suspension) as a single point reference to obtain a conversion factor to transform absorbance (OD600) data from your plate reader into a comparable OD600 measurement as would be obtained in a spectrophotometer. This conversion is necessary because plate @@ -47,69 +50,113 @@ def test_create_protocol(self): Therefore this conversion calculation can transform OD600 measurements from a plate reader (i.e. absorbance at 600 nm, the basic output of most instruments) into comparable OD600 measurements. The LUDOX solution is only weakly scattering and so will give a low absorbance value. - ''' + """ doc.add(protocol) # create the materials to be provisioned - ddh2o = sbol3.Component('ddH2O', 'https://identifiers.org/pubchem.substance:24901740') - ddh2o.name = 'Water, sterile-filtered, BioReagent, suitable for cell culture' # TODO get via tyto + ddh2o = sbol3.Component( + "ddH2O", "https://identifiers.org/pubchem.substance:24901740" + ) + ddh2o.name = "Water, sterile-filtered, BioReagent, suitable for cell culture" # TODO get via tyto doc.add(ddh2o) - ludox = sbol3.Component('LUDOX', 'https://identifiers.org/pubchem.substance:24866361') - ludox.name = 'LUDOX(R) CL-X colloidal silica, 45 wt. % suspension in H2O' + ludox = sbol3.Component( + "LUDOX", "https://identifiers.org/pubchem.substance:24866361" + ) + ludox.name = ( + "LUDOX(R) CL-X colloidal silica, 45 wt. % suspension in H2O" + ) doc.add(ludox) # actual steps of the protocol # get a plate - plate = protocol.primitive_step('EmptyContainer', specification=tyto.NCIT.get_uri_by_term('Microplate')) # replace with container ontology + plate = protocol.primitive_step( + "EmptyContainer", + specification=tyto.NCIT.get_uri_by_term("Microplate"), + ) # replace with container ontology # put ludox and water in selected wells - c_ddh2o = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A1:D1') - provision_ludox = protocol.primitive_step('Provision', resource=ludox, destination=c_ddh2o.output_pin('samples'), - amount=sbol3.Measure(100, tyto.OM.microliter)) + c_ddh2o = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A1:D1", + ) + provision_ludox = protocol.primitive_step( + "Provision", + resource=ludox, + destination=c_ddh2o.output_pin("samples"), + amount=sbol3.Measure(100, tyto.OM.microliter), + ) - c_ludox = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A2:D2') - provision_ddh2o = protocol.primitive_step('Provision', resource=ddh2o, destination=c_ludox.output_pin('samples'), - amount=sbol3.Measure(100, tyto.OM.microliter)) + c_ludox = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A2:D2", + ) + provision_ddh2o = protocol.primitive_step( + "Provision", + resource=ddh2o, + destination=c_ludox.output_pin("samples"), + amount=sbol3.Measure(100, tyto.OM.microliter), + ) # measure the absorbance - c_measure = protocol.primitive_step('PlateCoordinates', source=plate.output_pin('samples'), coordinates='A1:D2') - measure = protocol.primitive_step('MeasureAbsorbance', samples=c_measure.output_pin('samples'), - wavelength=sbol3.Measure(600, tyto.OM.nanometer)) + c_measure = protocol.primitive_step( + "PlateCoordinates", + source=plate.output_pin("samples"), + coordinates="A1:D2", + ) + measure = protocol.primitive_step( + "MeasureAbsorbance", + samples=c_measure.output_pin("samples"), + wavelength=sbol3.Measure(600, tyto.OM.nanometer), + ) - protocol.add_output('absorbance', measure.output_pin('measurements')) + protocol.add_output("absorbance", measure.output_pin("measurements")) # Set protocol timepoints # protocol starts at time 0 - protocol_start_time = pamlt.startTime(protocol, 0, units=tyto.OM.hour) - provision_ludox_duration = pamlt.duration(provision_ludox, 60, units=tyto.OM.second) - provision_ddh2o_duration = pamlt.duration(provision_ddh2o, 60, units=tyto.OM.second) - execute_measurement_duration = pamlt.duration(measure, 60, units=tyto.OM.minute) - ludox_before_ddh2o_constraint = pamlt.precedes(provision_ludox, [10, 15], provision_ddh2o, units=tyto.OM.hour) - - time_constraints = pamlt.TimeConstraints("ludox_protocol_constraints", - constraints=[pamlt.And([ - protocol_start_time, - provision_ludox_duration, - provision_ddh2o_duration, - execute_measurement_duration, - ludox_before_ddh2o_constraint - ])], - protocols = [protocol] + protocol_start_time = labopt.startTime(protocol, 0, units=tyto.OM.hour) + provision_ludox_duration = labopt.duration( + provision_ludox, 60, units=tyto.OM.second + ) + provision_ddh2o_duration = labopt.duration( + provision_ddh2o, 60, units=tyto.OM.second + ) + execute_measurement_duration = labopt.duration( + measure, 60, units=tyto.OM.minute + ) + ludox_before_ddh2o_constraint = labopt.precedes( + provision_ludox, [10, 15], provision_ddh2o, units=tyto.OM.hour + ) + + time_constraints = labopt.TimeConstraints( + "ludox_protocol_constraints", + constraints=[ + labopt.And( + [ + protocol_start_time, + provision_ludox_duration, + provision_ddh2o_duration, + execute_measurement_duration, + ludox_before_ddh2o_constraint, + ] + ) + ], + protocols=[protocol], ) doc.add(time_constraints) ######################################## # Validate and write the document - print('Validating and writing protocol') + print("Validating and writing protocol") v = doc.validate() - assert len(v) == 0, "".join(f'\n {e}' for e in v) + assert len(v) == 0, "".join(f"\n {e}" for e in v) - doc.write(self.paml_file, self.paml_format) - print(f'Wrote file as {self.paml_file}') + doc.write(self.labop_file, self.labop_format) + print(f"Wrote file as {self.labop_file}") -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() - diff --git a/test/resources/paml/igem_ludox_draft.ttl b/test/resources/paml/igem_ludox_draft.ttl index 874c53e..c375325 100644 --- a/test/resources/paml/igem_ludox_draft.ttl +++ b/test/resources/paml/igem_ludox_draft.ttl @@ -3,7 +3,7 @@ @prefix sbol: . @prefix xsd: . - a , + a , sbol:TopLevel ; ns1:edge , , @@ -339,371 +339,371 @@ is only weakly scattering and so will give a low absorbance value. ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 0 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue1" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type sbol:Component ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "resource" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 1 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "destination" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 2 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue3" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type om:Measure ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "amount" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 3 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue4" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type om:Measure ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "dispenseVelocity" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 0 ; sbol:displayId "LiteralInteger2" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - ; + ns1:ownedParameter , + ; sbol:description "Allocate a sample array with size and type based on an empty container" ; sbol:displayId "EmptyContainer" ; - sbol:hasNamespace . + sbol:hasNamespace . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 0 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue1" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type sbol:Identified ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "specification" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 1 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:out ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "samples" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 0 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue1" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "source" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 1 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type ns1:ValueSpecification ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "coordinates" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 2 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue3" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:out ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "samples" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - , - , - ; + ns1:ownedParameter , + , + , + ; sbol:description "Measure absorbance at a given wavelength from a set of samples" ; sbol:displayId "MeasureAbsorbance" ; - sbol:hasNamespace . + sbol:hasNamespace . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 0 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue1" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "samples" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 1 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type om:Measure ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "wavelength" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 2 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue3" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type xsd:integer ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "numFlashes" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 0 ; sbol:displayId "LiteralInteger2" . - a ns1:OrderedPropertyValue, + a ns1:OrderedPropertyValue, sbol:Identified ; ns1:indexValue 3 ; - ns1:propertyValue ; + ns1:propertyValue ; sbol:displayId "OrderedPropertyValue4" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:out ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "measurements" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . @@ -824,15 +824,15 @@ is only weakly scattering and so will give a low absorbance value. sbol:displayId "Parameter1" ; sbol:name "absorbance" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - , - , - ; + ns1:ownedParameter , + , + , + ; sbol:description "Place a measured amount (mass or volume) of a specified component into a location, where it may then be used in executing the protocol." ; sbol:displayId "Provision" ; - sbol:hasNamespace . + sbol:hasNamespace . a ns1:ActivityParameterNode, sbol:Identified ; @@ -841,14 +841,14 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input ; ns1:output ; sbol:displayId "CallBehaviorAction1" . a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -856,7 +856,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , , @@ -865,7 +865,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -873,7 +873,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , , @@ -882,7 +882,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -890,21 +890,21 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , ; ns1:output ; sbol:displayId "CallBehaviorAction7" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - , - ; + ns1:ownedParameter , + , + ; sbol:description "Select only the samples with specified row/column combination from a sample collection" ; sbol:displayId "PlateCoordinates" ; - sbol:hasNamespace . + sbol:hasNamespace . a ns1:ForkNode, sbol:Identified ; diff --git a/test/resources/paml/igem_ludox_dual_draft.ttl b/test/resources/paml/igem_ludox_dual_draft.ttl index 05e4c01..d7217c1 100644 --- a/test/resources/paml/igem_ludox_dual_draft.ttl +++ b/test/resources/paml/igem_ludox_dual_draft.ttl @@ -3,7 +3,7 @@ @prefix sbol: . @prefix xsd: . - a , + a , sbol:TopLevel ; ns1:edge , , @@ -44,7 +44,7 @@ is only weakly scattering and so will give a low absorbance value. sbol:hasNamespace ; sbol:name "iGEM 2018 LUDOX OD calibration protocol A" . - a , + a , sbol:TopLevel ; ns1:edge , , @@ -631,275 +631,275 @@ is only weakly scattering and so will give a low absorbance value. ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type sbol:Component ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "resource" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter2" ; sbol:name "destination" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type om:Measure ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter3" ; sbol:name "amount" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type om:Measure ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter4" ; sbol:name "dispenseVelocity" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 0 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type sbol:Identified ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "specification" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:out ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter2" ; sbol:name "samples" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "source" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type ns1:ValueSpecification ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter2" ; sbol:name "coordinates" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:out ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter3" ; sbol:name "samples" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "samples" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type om:Measure ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter2" ; sbol:name "wavelength" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type xsd:integer ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter3" ; sbol:name "numFlashes" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 0 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:out ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter4" ; sbol:name "measurements" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . @@ -981,7 +981,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , ; @@ -1064,7 +1064,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , ; @@ -1082,34 +1082,34 @@ is only weakly scattering and so will give a low absorbance value. sbol:Identified ; sbol:displayId "InitialNode1" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - ; + ns1:ownedParameter , + ; sbol:description "Allocate a sample array with size and type based on an empty container" ; sbol:displayId "EmptyContainer" ; - sbol:hasNamespace . + sbol:hasNamespace . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - , - , - ; + ns1:ownedParameter , + , + , + ; sbol:description "Measure absorbance at a given wavelength from a set of samples" ; sbol:displayId "MeasureAbsorbance" ; - sbol:hasNamespace . + sbol:hasNamespace . a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input ; ns1:output ; sbol:displayId "CallBehaviorAction1" . a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1117,7 +1117,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , , @@ -1126,7 +1126,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1134,7 +1134,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , , @@ -1143,7 +1143,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1151,14 +1151,14 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input ; ns1:output ; sbol:displayId "CallBehaviorAction1" . a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1166,7 +1166,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , , @@ -1175,7 +1175,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1183,7 +1183,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , , @@ -1192,21 +1192,21 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; sbol:displayId "CallBehaviorAction6" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - , - , - ; + ns1:ownedParameter , + , + , + ; sbol:description "Place a measured amount (mass or volume) of a specified component into a location, where it may then be used in executing the protocol." ; sbol:displayId "Provision" ; - sbol:hasNamespace . + sbol:hasNamespace . a ns1:ForkNode, sbol:Identified ; @@ -1216,12 +1216,12 @@ is only weakly scattering and so will give a low absorbance value. sbol:Identified ; sbol:displayId "ForkNode1" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - , - ; + ns1:ownedParameter , + , + ; sbol:description "Select only the samples with specified row/column combination from a sample collection" ; sbol:displayId "PlateCoordinates" ; - sbol:hasNamespace . + sbol:hasNamespace . diff --git a/test/resources/paml/igem_ludox_dual_time_draft.ttl b/test/resources/paml/igem_ludox_dual_time_draft.ttl index 8582aaf..4171502 100644 --- a/test/resources/paml/igem_ludox_dual_time_draft.ttl +++ b/test/resources/paml/igem_ludox_dual_time_draft.ttl @@ -1,5 +1,5 @@ @prefix ns1: . -@prefix ns2: . +@prefix ns2: . @prefix om: . @prefix sbol: . @prefix xsd: . @@ -1218,275 +1218,275 @@ ns1:indexValue 1 ; sbol:displayId "ReferencedOrderedPropertyValue2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type sbol:Component ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "resource" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter2" ; sbol:name "destination" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type om:Measure ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter3" ; sbol:name "amount" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type om:Measure ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter4" ; sbol:name "dispenseVelocity" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 0 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type sbol:Identified ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "specification" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:out ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter2" ; sbol:name "samples" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "source" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type ns1:ValueSpecification ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter2" ; sbol:name "coordinates" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:out ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter3" ; sbol:name "samples" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "samples" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type om:Measure ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter2" ; sbol:name "wavelength" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type xsd:integer ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter3" ; sbol:name "numFlashes" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 0 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:out ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter4" ; sbol:name "measurements" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . @@ -1503,7 +1503,7 @@ sbol:name "Water, sterile-filtered, BioReagent, suitable for cell culture" ; sbol:type . - a , + a , sbol:TopLevel ; ns1:edge , , @@ -1618,7 +1618,7 @@ is only weakly scattering and so will give a low absorbance value. sbol:Identified ; sbol:displayId "InitialNode1" . - a , + a , sbol:TopLevel ; ns1:edge , , @@ -1733,34 +1733,34 @@ is only weakly scattering and so will give a low absorbance value. sbol:Identified ; sbol:displayId "InitialNode1" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - ; + ns1:ownedParameter , + ; sbol:description "Allocate a sample array with size and type based on an empty container" ; sbol:displayId "EmptyContainer" ; - sbol:hasNamespace . + sbol:hasNamespace . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - , - , - ; + ns1:ownedParameter , + , + , + ; sbol:description "Measure absorbance at a given wavelength from a set of samples" ; sbol:displayId "MeasureAbsorbance" ; - sbol:hasNamespace . + sbol:hasNamespace . a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input ; ns1:output ; sbol:displayId "CallBehaviorAction1" . a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1768,7 +1768,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1776,7 +1776,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1784,7 +1784,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , ; @@ -1793,14 +1793,14 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input ; ns1:output ; sbol:displayId "CallBehaviorAction1" . a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1808,7 +1808,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1816,7 +1816,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1824,26 +1824,26 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , ; ns1:output ; sbol:displayId "CallBehaviorAction7" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - , - , - ; + ns1:ownedParameter , + , + , + ; sbol:description "Place a measured amount (mass or volume) of a specified component into a location, where it may then be used in executing the protocol." ; sbol:displayId "Provision" ; - sbol:hasNamespace . + sbol:hasNamespace . a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , , @@ -1852,7 +1852,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , , @@ -1865,7 +1865,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , , @@ -1874,7 +1874,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , , @@ -1885,12 +1885,12 @@ is only weakly scattering and so will give a low absorbance value. sbol:Identified ; sbol:displayId "ForkNode1" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - , - ; + ns1:ownedParameter , + , + ; sbol:description "Select only the samples with specified row/column combination from a sample collection" ; sbol:displayId "PlateCoordinates" ; - sbol:hasNamespace . + sbol:hasNamespace . diff --git a/test/resources/paml/igem_ludox_time_draft.ttl b/test/resources/paml/igem_ludox_time_draft.ttl index cac7ebd..b2c509e 100644 --- a/test/resources/paml/igem_ludox_time_draft.ttl +++ b/test/resources/paml/igem_ludox_time_draft.ttl @@ -1,5 +1,5 @@ @prefix ns1: . -@prefix ns2: . +@prefix ns2: . @prefix om: . @prefix sbol: . @prefix xsd: . @@ -628,298 +628,298 @@ ns1:indexValue 1 ; sbol:displayId "ReferencedOrderedPropertyValue2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type sbol:Component ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "resource" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter2" ; sbol:name "destination" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type om:Measure ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter3" ; sbol:name "amount" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type om:Measure ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter4" ; sbol:name "dispenseVelocity" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 0 ; sbol:displayId "LiteralInteger2" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - ; + ns1:ownedParameter , + ; sbol:description "Allocate a sample array with size and type based on an empty container" ; sbol:displayId "EmptyContainer" ; - sbol:hasNamespace . + sbol:hasNamespace . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type sbol:Identified ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "specification" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:out ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter2" ; sbol:name "samples" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "source" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type ns1:ValueSpecification ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter2" ; sbol:name "coordinates" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:out ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter3" ; sbol:name "samples" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - , - , - ; + ns1:ownedParameter , + , + , + ; sbol:description "Measure absorbance at a given wavelength from a set of samples" ; sbol:displayId "MeasureAbsorbance" ; - sbol:hasNamespace . + sbol:hasNamespace . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter1" ; sbol:name "samples" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type om:Measure ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter2" ; sbol:name "wavelength" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:in ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; + ns1:lowerValue ; ns1:type xsd:integer ; - ns1:upperValue ; + ns1:upperValue ; sbol:displayId "Parameter3" ; sbol:name "numFlashes" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 0 ; sbol:displayId "LiteralInteger2" . - a ns1:Parameter, + a ns1:Parameter, sbol:Identified ; ns1:direction ns1:out ; ns1:isOrdered true ; ns1:isUnique true ; - ns1:lowerValue ; - ns1:type ; - ns1:upperValue ; + ns1:lowerValue ; + ns1:type ; + ns1:upperValue ; sbol:displayId "Parameter4" ; sbol:name "measurements" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger1" . - a ns1:LiteralInteger, + a ns1:LiteralInteger, sbol:Identified ; ns1:integerValue 1 ; sbol:displayId "LiteralInteger2" . - a , + a , sbol:TopLevel ; ns1:edge , , @@ -1034,26 +1034,26 @@ is only weakly scattering and so will give a low absorbance value. sbol:Identified ; sbol:displayId "InitialNode1" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - , - , - ; + ns1:ownedParameter , + , + , + ; sbol:description "Place a measured amount (mass or volume) of a specified component into a location, where it may then be used in executing the protocol." ; sbol:displayId "Provision" ; - sbol:hasNamespace . + sbol:hasNamespace . a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input ; ns1:output ; sbol:displayId "CallBehaviorAction1" . a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1061,7 +1061,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1069,7 +1069,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , ; ns1:output ; @@ -1077,25 +1077,25 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , ; ns1:output ; sbol:displayId "CallBehaviorAction7" . - a , + a , sbol:TopLevel ; - ns1:ownedParameter , - , - ; + ns1:ownedParameter , + , + ; sbol:description "Select only the samples with specified row/column combination from a sample collection" ; sbol:displayId "PlateCoordinates" ; - sbol:hasNamespace . + sbol:hasNamespace . a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , , @@ -1104,7 +1104,7 @@ is only weakly scattering and so will give a low absorbance value. a ns1:CallBehaviorAction, sbol:Identified ; - ns1:behavior ; + ns1:behavior ; ns1:input , , , diff --git a/test/test_generate_constraints.py b/test/test_generate_constraints.py index ffedbe2..4b3775f 100644 --- a/test/test_generate_constraints.py +++ b/test/test_generate_constraints.py @@ -1,33 +1,27 @@ -from paml_check.activity_graph import ActivityGraph -from paml_check.schedule import Schedule +from labop_check.activity_graph import ActivityGraph +from labop_check.schedule import Schedule import os import sbol3 import tempfile -import paml -import paml_check.paml_check as pc +import labop +import labop_check.labop_check as pc import pytest -timed_targets = [ - 'igem_ludox_time_draft.ttl', - 'igem_ludox_dual_time_draft.ttl' -] -untimed_targets = [ - 'igem_ludox_draft.ttl', - 'igem_ludox_dual_draft.ttl' -] +timed_targets = ["igem_ludox_time_draft.ttl", "igem_ludox_dual_time_draft.ttl"] +untimed_targets = ["igem_ludox_draft.ttl", "igem_ludox_dual_draft.ttl"] all_targets = timed_targets + untimed_targets -def get_doc_from_file(paml_file): +def get_doc_from_file(labop_file): doc = sbol3.Document() - sbol3.set_namespace('https://bbn.com/scratch/') - doc.read(paml_file, 'turtle') + sbol3.set_namespace("https://bbn.com/scratch/") + doc.read(labop_file, "turtle") return doc def get_doc_for_target(target): - paml_file = os.path.join(os.getcwd(), 'test/resources/paml', target) - return get_doc_from_file(paml_file) + labop_file = os.path.join(os.getcwd(), "test/resources/labop", target) + return get_doc_from_file(labop_file) @pytest.mark.parametrize("target", timed_targets) diff --git a/test/test_hand_coded.py b/test/test_hand_coded.py index 165f8b4..be33df1 100644 --- a/test/test_hand_coded.py +++ b/test/test_hand_coded.py @@ -2,9 +2,12 @@ Test a hand-coded temporal problem """ import pysmt.shortcuts -import paml_check.paml_check as pc -from paml_check.constraints import binary_temporal_constraint, join_constraint, \ - unary_temporal_constaint +import labop_check.labop_check as pc +from labop_check.constraints import ( + binary_temporal_constraint, + join_constraint, + unary_temporal_constaint, +) def test_ludox_check_direct(): @@ -22,64 +25,90 @@ def test_ludox_check_direct(): "t_M", "t_MA_s", "t_MA_e", - "t_N" + "t_N", ] t_inf = 10000.0 t_epsilon = 0.0001 # num_happenings = 10 - timepoint_vars = {t: pysmt.shortcuts.Symbol(t, pysmt.shortcuts.REAL) - for t in timepoints} + timepoint_vars = { + t: pysmt.shortcuts.Symbol(t, pysmt.shortcuts.REAL) for t in timepoints + } - timepoint_var_domains = [pysmt.shortcuts.And(pysmt.shortcuts.GE(t, pysmt.shortcuts.Real(0.0)), - pysmt.shortcuts.LE(t, pysmt.shortcuts.Real(t_inf))) - for _, t in timepoint_vars.items()] + timepoint_var_domains = [ + pysmt.shortcuts.And( + pysmt.shortcuts.GE(t, pysmt.shortcuts.Real(0.0)), + pysmt.shortcuts.LE(t, pysmt.shortcuts.Real(t_inf)), + ) + for _, t in timepoint_vars.items() + ] time_constraints = [ - binary_temporal_constraint(timepoint_vars["t_0"], [ - [0, 0]], timepoint_vars["t_F"]), - binary_temporal_constraint(timepoint_vars["t_F"], [ - [0, t_inf]], timepoint_vars["t_P1_s"]), - binary_temporal_constraint(timepoint_vars["t_F"], [ - [0, t_inf]], timepoint_vars["t_P2_s"]), - binary_temporal_constraint(timepoint_vars["t_P1_s"], [ - [t_epsilon, t_inf]], timepoint_vars["t_P1_e"]), - binary_temporal_constraint(timepoint_vars["t_P2_s"], [ - [t_epsilon, t_inf]], timepoint_vars["t_P2_e"]), - binary_temporal_constraint(timepoint_vars["t_P1_e"], [ - [0, t_inf]], timepoint_vars["t_M"]), - binary_temporal_constraint(timepoint_vars["t_P2_e"], [ - [0, t_inf]], timepoint_vars["t_M"]), - binary_temporal_constraint(timepoint_vars["t_M"], [ - [t_epsilon, t_inf]], timepoint_vars["t_MA_s"]), - binary_temporal_constraint(timepoint_vars["t_MA_s"], [ - [t_epsilon, t_inf]], timepoint_vars["t_MA_e"]), - binary_temporal_constraint(timepoint_vars["t_MA_e"], [ - [0, 0]], timepoint_vars["t_N"]), + binary_temporal_constraint( + timepoint_vars["t_0"], [[0, 0]], timepoint_vars["t_F"] + ), + binary_temporal_constraint( + timepoint_vars["t_F"], [[0, t_inf]], timepoint_vars["t_P1_s"] + ), + binary_temporal_constraint( + timepoint_vars["t_F"], [[0, t_inf]], timepoint_vars["t_P2_s"] + ), + binary_temporal_constraint( + timepoint_vars["t_P1_s"], + [[t_epsilon, t_inf]], + timepoint_vars["t_P1_e"], + ), + binary_temporal_constraint( + timepoint_vars["t_P2_s"], + [[t_epsilon, t_inf]], + timepoint_vars["t_P2_e"], + ), + binary_temporal_constraint( + timepoint_vars["t_P1_e"], [[0, t_inf]], timepoint_vars["t_M"] + ), + binary_temporal_constraint( + timepoint_vars["t_P2_e"], [[0, t_inf]], timepoint_vars["t_M"] + ), + binary_temporal_constraint( + timepoint_vars["t_M"], + [[t_epsilon, t_inf]], + timepoint_vars["t_MA_s"], + ), + binary_temporal_constraint( + timepoint_vars["t_MA_s"], + [[t_epsilon, t_inf]], + timepoint_vars["t_MA_e"], + ), + binary_temporal_constraint( + timepoint_vars["t_MA_e"], [[0, 0]], timepoint_vars["t_N"] + ), ] join_constraints = [ - join_constraint(timepoint_vars["t_M"], - [ - timepoint_vars["t_P2_e"], - timepoint_vars["t_P1_e"] - ]) + join_constraint( + timepoint_vars["t_M"], + [timepoint_vars["t_P2_e"], timepoint_vars["t_P1_e"]], + ) ] durations = [ - binary_temporal_constraint(timepoint_vars["t_P1_s"], [ - [3, 3]], timepoint_vars["t_P1_e"]), - binary_temporal_constraint(timepoint_vars["t_P2_s"], [ - [3, 3]], timepoint_vars["t_P2_e"]), - binary_temporal_constraint(timepoint_vars["t_MA_s"], [ - [10, 10]], timepoint_vars["t_MA_e"]), - binary_temporal_constraint(timepoint_vars["t_0"], [ - [0, 100]], timepoint_vars["t_N"]) + binary_temporal_constraint( + timepoint_vars["t_P1_s"], [[3, 3]], timepoint_vars["t_P1_e"] + ), + binary_temporal_constraint( + timepoint_vars["t_P2_s"], [[3, 3]], timepoint_vars["t_P2_e"] + ), + binary_temporal_constraint( + timepoint_vars["t_MA_s"], [[10, 10]], timepoint_vars["t_MA_e"] + ), + binary_temporal_constraint( + timepoint_vars["t_0"], [[0, 100]], timepoint_vars["t_N"] + ), ] events = [ unary_temporal_constaint(timepoint_vars["t_0"], [[1, 3]]), - unary_temporal_constaint(timepoint_vars["t_N"], [[15, 16]]) + unary_temporal_constaint(timepoint_vars["t_N"], [[15, 16]]), ] # happenings = [pysmt.shortcuts.Symbol( @@ -89,16 +118,17 @@ def test_ludox_check_direct(): # timepoint_vars, happenings) given_constraints = pysmt.shortcuts.And( - timepoint_var_domains + time_constraints + join_constraints) + timepoint_var_domains + time_constraints + join_constraints + ) hand_coded_constraints = pysmt.shortcuts.And(durations + events) formula = pysmt.shortcuts.And( given_constraints, hand_coded_constraints, - # happening_timepoint_mappings + # happening_timepoint_mappings ) result = pc.check(formula) if result: - #timeline = Timeline(result, timepoint_vars, happenings) + # timeline = Timeline(result, timepoint_vars, happenings) # print(timeline) print("SAT") else: @@ -106,56 +136,61 @@ def test_ludox_check_direct(): assert result + def test_decision_merge(): """ Test encoding of decision and merge nodes :return: """ - timepoints = [ - "decision", - "act1", - "act2", - "merge" - ] + timepoints = ["decision", "act1", "act2", "merge"] t_inf = 10000.0 t_epsilon = 0.0001 - timepoint_vars = {t: pysmt.shortcuts.Symbol(t, pysmt.shortcuts.REAL) - for t in timepoints} + timepoint_vars = { + t: pysmt.shortcuts.Symbol(t, pysmt.shortcuts.REAL) for t in timepoints + } - timepoint_var_domains = [pysmt.shortcuts.And(pysmt.shortcuts.GE(t, pysmt.shortcuts.Real(0.0)), - pysmt.shortcuts.LE(t, pysmt.shortcuts.Real(t_inf))) - for _, t in timepoint_vars.items()] + timepoint_var_domains = [ + pysmt.shortcuts.And( + pysmt.shortcuts.GE(t, pysmt.shortcuts.Real(0.0)), + pysmt.shortcuts.LE(t, pysmt.shortcuts.Real(t_inf)), + ) + for _, t in timepoint_vars.items() + ] - timepoint_happens = { t : pysmt.shortcuts.Symbol(f"happens({t})") - for t in timepoints - } + timepoint_happens = { + t: pysmt.shortcuts.Symbol(f"happens({t})") for t in timepoints + } condition = pysmt.shortcuts.Symbol("D") # A timepoint happens if its ancestors happen happens_constraints = [ - timepoint_happens['decision'], - timepoint_happens['merge'], - pysmt.shortcuts.Implies(timepoint_happens["act1"], - pysmt.shortcuts.And(timepoint_happens["decision"], - condition)), - pysmt.shortcuts.Implies(timepoint_happens["act2"], - pysmt.shortcuts.And(timepoint_happens["decision"], - pysmt.shortcuts.Not(condition))), - pysmt.shortcuts.Implies(timepoint_happens["merge"], - pysmt.shortcuts.Or(timepoint_happens["act1"], - timepoint_happens["act2"])), + timepoint_happens["decision"], + timepoint_happens["merge"], + pysmt.shortcuts.Implies( + timepoint_happens["act1"], + pysmt.shortcuts.And(timepoint_happens["decision"], condition), + ), + pysmt.shortcuts.Implies( + timepoint_happens["act2"], + pysmt.shortcuts.And( + timepoint_happens["decision"], pysmt.shortcuts.Not(condition) + ), + ), + pysmt.shortcuts.Implies( + timepoint_happens["merge"], + pysmt.shortcuts.Or( + timepoint_happens["act1"], timepoint_happens["act2"] + ), + ), ] - formula = pysmt.shortcuts.And( - timepoint_var_domains + \ - happens_constraints + - [ - pysmt.shortcuts.Not(condition) - ] + timepoint_var_domains + + happens_constraints + + [pysmt.shortcuts.Not(condition)] ) result = pc.check(formula) @@ -166,4 +201,4 @@ def test_decision_merge(): else: print("UNSAT") - assert result \ No newline at end of file + assert result diff --git a/test/test_read_paml.py b/test/test_read_paml.py index a276b51..94548ac 100644 --- a/test/test_read_paml.py +++ b/test/test_read_paml.py @@ -1,10 +1,13 @@ import os import sbol3 -import paml +import labop -def test_read_paml(): - paml_file = os.path.join(os.getcwd(), 'test/resources/paml', 'igem_ludox_draft.ttl') + +def test_read_labop(): + labop_file = os.path.join( + os.getcwd(), "test/resources/labop", "igem_ludox_draft.ttl" + ) doc = sbol3.Document() - doc.read(paml_file, 'ttl') - protocols = doc.find_all(lambda obj: isinstance(obj, paml.Protocol)) - assert(protocols) + doc.read(labop_file, "ttl") + protocols = doc.find_all(lambda obj: isinstance(obj, labop.Protocol)) + assert protocols diff --git a/test/test_subprotocol.py b/test/test_subprotocol.py index 08e2892..a6bb896 100644 --- a/test/test_subprotocol.py +++ b/test/test_subprotocol.py @@ -1,27 +1,29 @@ -import paml +import labop import sbol3 -import paml_check.paml_check as pc +import labop_check.labop_check as pc + def _make_dummy_protocol(id, doc): - subprotocol1 = paml.Protocol(id, name=id) + subprotocol1 = labop.Protocol(id, name=id) doc.add(subprotocol1) - action1 = paml.Primitive(f"action1_{id}") + action1 = labop.Primitive(f"action1_{id}") doc.add(action1) subprotocol1.primitive_step(f"action1_{id}") return subprotocol1 + def test_subprotocol_simple(): ############################################# # set up the document - print('Setting up document') + print("Setting up document") doc = sbol3.Document() - sbol3.set_namespace('https://bbn.com/scratch/') + sbol3.set_namespace("https://bbn.com/scratch/") ############################################# ############################################# # Create the protocol - print('Creating protocol') - protocol = paml.Protocol('top_protocol') + print("Creating protocol") + protocol = labop.Protocol("top_protocol") protocol.name = "simple subprotocol" ############################################# @@ -33,14 +35,13 @@ def test_subprotocol_simple(): subprotocol2 = _make_dummy_protocol("subprotocol2", doc) sub_invocation2 = protocol.primitive_step(subprotocol2) - doc.add(protocol) ######################################## # Validate and write the document - print('Validating and writing protocol') + print("Validating and writing protocol") v = doc.validate() - assert len(v) == 0, "".join(f'\n {e}' for e in v) + assert len(v) == 0, "".join(f"\n {e}" for e in v) schedule, graph = pc.check_doc(doc) assert schedule @@ -49,15 +50,15 @@ def test_subprotocol_simple(): def test_subprotocol_nested(): ############################################# # set up the document - print('Setting up document') + print("Setting up document") doc = sbol3.Document() - sbol3.set_namespace('https://bbn.com/scratch/') + sbol3.set_namespace("https://bbn.com/scratch/") ############################################# ############################################# # Create the protocol - print('Creating protocol') - protocol = paml.Protocol('top_protocol') + print("Creating protocol") + protocol = labop.Protocol("top_protocol") protocol.name = "nested subprotocol" ############################################# @@ -69,14 +70,13 @@ def test_subprotocol_nested(): subprotocol2 = _make_dummy_protocol("subprotocol2", doc) sub_invocation2 = subprotocol1.primitive_step(subprotocol2) - doc.add(protocol) ######################################## # Validate and write the document - print('Validating and writing protocol') + print("Validating and writing protocol") v = doc.validate() - assert len(v) == 0, "".join(f'\n {e}' for e in v) + assert len(v) == 0, "".join(f"\n {e}" for e in v) schedule, graph = pc.check_doc(doc) assert schedule