예제 #1
0
    def test_configpossiblechecker(self):
        #Test is SBML string can be converted with this module
        #Checker is at the start of sbmltoconfig function
        Biomodels_ID = 'BIOMD0000000012'  #Represillator Model

        onlinemodelstr = onlinegen.get_online_biomodel(Biomodels_ID)
        onlinegen.configpossiblechecker(onlinemodelstr)
import BMSS.models.setup_sim        as sm
import BMSS.simulation       as sim

    
if __name__ == '__main__':
    
    '''
    Use following function to create SBML from BIOModel online database
    Outputs both the sbmlstring and the XML file
    '''
    
    Biomodels_ID    = 'BIOMD0000000012' 
    #Input biomodels ID number
    SBMLfilename    = 'Repressilator_TestModel_SBML.xml' #Name the XML file
    outputpath      = str(Path.cwd()/SBMLfilename)
    onlinemodelstr  = onlinegen.get_online_biomodel(Biomodels_ID, outputfile=outputpath)
    antimony_str        = te.sbmlToAntimony(onlinemodelstr)
    
    
    '''
    Use the following function to create SBML from local folder.
    XML file must be in same folder as this Tutorial
    '''
    
    inputpath       = str(Path.cwd()/'Repressilator_TestModel_SBML_1.xml')
    with open(inputpath, 'r', encoding='utf8', errors='ignore') as f:
        localmodelstr = f.read()
    
      
    '''
    To create config ini file from SBML file in folder
예제 #3
0
    def test_configpossiblechecker_fail(self):
        #SBML string is too complex for module
        Biomodels_ID = 'MODEL1606100000'  #Model too complicated to convert

        onlinemodelstr = onlinegen.get_online_biomodel(Biomodels_ID)
        onlinegen.configpossiblechecker(onlinemodelstr)
예제 #4
0
    "description": description_store,
    "reference": reference_store,
    "species_parameter_descriptions": species_parameter_descriptions
}

eqn_sample = [
    '', '  dPX = +(k_tl*X) -(kd_prot*PX)', '  dPY = +(k_tl*Y) -(kd_prot*PY)',
    '  dPZ = +(k_tl*Z) -(kd_prot*PZ)',
    '  dX = +(a0_tr + a_tr*KM**n/(KM**n + PZ**n)) -(kd_mRNA*X)',
    '  dY = +(a0_tr + a_tr*KM**n/(KM**n + PX**n)) -(kd_mRNA*Y)',
    '  dZ = +(a0_tr + a_tr*KM**n/(KM**n + PY**n)) -(kd_mRNA*Z)'
]

Biomodels_ID = 'BIOMD0000000012'  #Represillator Model
output_path = tempfile.gettempdir()
onlinemodelstr = onlinegen.get_online_biomodel(Biomodels_ID)
sampleconfig, settings_sample = onlinegen.sbmltoconfig(onlinemodelstr,
                                                       system_type, tspan,
                                                       Model_name, output_path)


class TestConfigGen:
    def test_makesampleconfig(self):
        testconfig = onlinegen.gen_config(settings_test, system_type, tspan)

        assert testconfig == sampleconfig, 'Config Statements are not the same'

    def test_compare_equations(self):
        #Tests whether reactions pertaining to the same species are combined
        global eqn_sample
        antimony_str_test = '''