diff --git a/bio_compose/__init__.py b/bio_compose/__init__.py index 646b4ed..df0168b 100644 --- a/bio_compose/__init__.py +++ b/bio_compose/__init__.py @@ -7,3 +7,36 @@ with open(version_file_path, 'r') as f: __version__ = f.read().strip() + +def run_simulation(*args, **kwargs): + # TODO: implement this + pass + + +def verify(*args, **kwargs): + import time + from bio_compose.verifier import Verifier + + verifier = Verifier() + simulators = kwargs.get('simulators') + run_sbml = False + for arg in args: + if isinstance(arg, int): + run_sbml = True + submission = None + if run_sbml: + submission = verifier.verify_sbml(*args, **kwargs) + else: + submission = verifier.verify_omex(*args, **kwargs) + job_id = submission.get('job_id') + output = None + if job_id is not None: + while True: + verification_result = verifier.get_output(job_id=job_id) + status = verification_result['content']['status'] + if not 'COMPLETED' in status: + time.sleep(1) + else: + output = verification_result + break + return output diff --git a/tests/fixtures/sbml-core/BIOMD0000000001_url.xml.psc b/tests/fixtures/sbml-core/BIOMD0000000001_url.xml.psc new file mode 100644 index 0000000..2815a5e --- /dev/null +++ b/tests/fixtures/sbml-core/BIOMD0000000001_url.xml.psc @@ -0,0 +1,154 @@ +# Generated by PySCeS 1.2.2 (2024-09-03 15:15) + +# Keywords +Description: Edelstein1996 - EPSP ACh event +Modelname: BIOMD0000000001 +Output_In_Conc: True +Species_In_Conc: True + +# GlobalUnitDefinitions +UnitSubstance: mole, 1.0, 0, 1 +UnitVolume: litre, 1.0, 0, 1 +UnitTime: second, 1.0, 0, 1 +UnitLength: metre, 1.0, 0, 1 +UnitArea: metre, 1.0, 0, 2 + +# Compartments +Compartment: comp1, 1.0, 3 + +# Reactions +React0@comp1: + B = BL + comp1*(kf_0*B-kr_0*BL) + +React1@comp1: + BL = BLL + comp1*(kf_1*BL-kr_1*BLL) + +React2@comp1: + BLL = ALL + comp1*(kf_2*BLL-kr_2*ALL) + +React3@comp1: + A = AL + comp1*(kf_3*A-kr_3*AL) + +React4@comp1: + AL = ALL + comp1*(kf_4*AL-kr_4*ALL) + +React5@comp1: + B = A + comp1*(kf_5*B-kr_5*A) + +React6@comp1: + BL = AL + comp1*(kf_6*BL-kr_6*AL) + +React7@comp1: + I = IL + comp1*(kf_7*I-kr_7*IL) + +React8@comp1: + IL = ILL + comp1*(kf_8*IL-kr_8*ILL) + +React9@comp1: + A = I + comp1*(kf_9*A-kr_9*I) + +React10@comp1: + AL = IL + comp1*(kf_10*AL-kr_10*IL) + +React11@comp1: + ALL = ILL + comp1*(kf_11*ALL-kr_11*ILL) + +React12@comp1: + D = DL + comp1*(kf_12*D-kr_12*DL) + +React13@comp1: + DL = DLL + comp1*(kf_13*DL-kr_13*DLL) + +React14@comp1: + I = D + comp1*(kf_14*I-kr_14*D) + +React15@comp1: + IL = DL + comp1*(kf_15*IL-kr_15*DL) + +React16@comp1: + ILL = DLL + comp1*(kf_16*ILL-kr_16*DLL) + +# Event definitions +Event: RemovalACh, _TIME_ > t2, delay=0.0, priority=None, persistent=True { + kf_0 = 0 + kf_3 = 0 + kf_7 = 0 + kf_12 = 0 + kf_1 = 0 + kf_4 = 0 + kf_8 = 0 + kf_13 = 0 + } + + +# Fixed species + +# Variable species +BLL@comp1 = 0.0 +IL@comp1 = 0.0 +AL@comp1 = 0.0 +A@comp1 = 0.0 +BL@comp1 = 0.0 +B@comp1 = 1.66057788110262e-05 +DLL@comp1 = 0.0 +D@comp1 = 0.0 +ILL@comp1 = 0.0 +DL@comp1 = 0.0 +I@comp1 = 0.0 +ALL@comp1 = 0.0 + +# Parameters +kf_0 = 3000.0 +kr_0 = 8000.0 +kf_1 = 1500.0 +kr_1 = 16000.0 +kf_2 = 30000.0 +kr_2 = 700.0 +kf_3 = 3000.0 +kr_3 = 8.64 +kf_4 = 1500.0 +kr_4 = 17.28 +kf_5 = 0.54 +kr_5 = 10800.0 +kf_6 = 130.0 +kr_6 = 2740.0 +kf_7 = 3000.0 +kr_7 = 4.0 +kf_8 = 1500.0 +kr_8 = 8.0 +kf_9 = 19.7 +kr_9 = 3.74 +kf_10 = 19.85 +kr_10 = 1.74 +kf_11 = 20.0 +kr_11 = 0.81 +kf_12 = 3000.0 +kr_12 = 4.0 +kf_13 = 1500.0 +kr_13 = 8.0 +kf_14 = 0.05 +kr_14 = 0.0012 +kf_15 = 0.05 +kr_15 = 0.0012 +kf_16 = 0.05 +kr_16 = 0.0012 +t2 = 20.0 + + diff --git a/tests/rmse_verification-bio_check-request-16f353d4-c621-416d-8ad9-9137ea4beddf-6f2afece-5fe7-40de-9857-beccae7da841.pdf b/tests/rmse_verification-bio_check-request-16f353d4-c621-416d-8ad9-9137ea4beddf-6f2afece-5fe7-40de-9857-beccae7da841.pdf new file mode 100644 index 0000000..42f9002 Binary files /dev/null and b/tests/rmse_verification-bio_check-request-16f353d4-c621-416d-8ad9-9137ea4beddf-6f2afece-5fe7-40de-9857-beccae7da841.pdf differ diff --git a/tests/rmse_verification-bio_check-request-6dfe02cf-9bdb-4872-9ee1-314433cee92c-850495e3-3d58-4636-a7a0-4a61dc9eb39b.pdf b/tests/rmse_verification-bio_check-request-6dfe02cf-9bdb-4872-9ee1-314433cee92c-850495e3-3d58-4636-a7a0-4a61dc9eb39b.pdf new file mode 100644 index 0000000..bf49425 Binary files /dev/null and b/tests/rmse_verification-bio_check-request-6dfe02cf-9bdb-4872-9ee1-314433cee92c-850495e3-3d58-4636-a7a0-4a61dc9eb39b.pdf differ diff --git a/tests/rmse_verification-bio_check-request-811a8269-2c92-4c79-a802-859afd2d60eb-88e12855-cf9b-4f59-8fe9-cd9e47587402.pdf b/tests/rmse_verification-bio_check-request-811a8269-2c92-4c79-a802-859afd2d60eb-88e12855-cf9b-4f59-8fe9-cd9e47587402.pdf new file mode 100644 index 0000000..003760a Binary files /dev/null and b/tests/rmse_verification-bio_check-request-811a8269-2c92-4c79-a802-859afd2d60eb-88e12855-cf9b-4f59-8fe9-cd9e47587402.pdf differ