'''
    To create config ini file from SBML file in folder
    Reading the data inside the xml file to a variable 
    data 
    '''
    config_output_path  = Path.cwd()
    Model_name          = "Repressilator_TestModel"
    antimony_str        = te.sbmlToAntimony(onlinemodelstr)
    
    system_type         = 'Test_Model, Repressilator'
    tspan               = '[0, 600, 601]' 
    #Name the Tspan to be simulated [x, y ,z] x = start time, y = end time, z = number of points inbetween

    inicomplete, settings_database = onlinegen.sbmltoconfig(onlinemodelstr, system_type, tspan, Model_name, config_output_path)
    #Returns the config file statement and the nested dictionary of the settings  
    #Change onlinemodelstr to localmodelstr to convert local xml file 
    
    
    
    '''
    To plot based on Tutorial 2 Simulation 
    Refer to Tutorial 2 for in detail explaination 
    of each line
    '''
    
    #Add model to database; refer to Tutorial 1 Part 2
    filename        = 'Repressilator_TestModel_coremodel.ini' #Enter config to be added to database
    sim_system_type = mh.config_to_database(filename)
    
Esempio n. 2
0
    "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 = '''
        // Reactions:
          Reaction1: X => ; kd_mRNA*X;