Пример #1
0
 def test_output_with_abcsysbio_syntax(self):
     """ We should be able to echo experiments with the ABC-SysBio
         syntax. """
     exp1 = Experiment([1, 2, 3, 4], [.1, .2, .3, .4], '')
     exp2 = Experiment([1, 2, 3, 4], [.2, .4, .6, .8], '')
     exps = ExperimentSet()
     exps.add(exp1)
     exps.add(exp2)
     out = exps.get_as_abcsysbio_syntax()
     expected = '<var1> 0.1 0.2 0.3 0.4 </var1>' + \
                '<var2> 0.2 0.4 0.6 0.8 </var2>'
     space_re = re.compile('\s|\n', re.MULTILINE)
     self.assertEqual(space_re.sub('', out), space_re.sub('', expected))
Пример #2
0
odes = sbml_to_odes (sbml)
time = [30, 60, 180, 300, 900, 1800]


# Simple experiment: run final_model simulations adding a Gaussian noise
values = odes.evaluate_exp_on ('MAPK_PP + MAPK_P', time)
experiment_set = ExperimentSet ()
for i in range (3):
    noised_values = list (values)
    add_noise (noised_values)
    experiment = Experiment (time, noised_values, 
            'MAPK_PP + MAPK_P')
    experiment_set.add (experiment)
experiment_set.save_to_file ('gauss_noise.data')
with open ('gaus_noise_abcsysbio.data', 'w') as f:
    f.write (experiment_set.get_as_abcsysbio_syntax ())
    f.close ()


# More complex experiment: run final_model with perturbations on 
# catalytic constants
perturbation_exp = ExperimentSet ()

# First perturbation experiments
theta = odes.get_all_parameters ()
changed_param = ''
changed_param_value = 0
for p in theta:
    original_name = sbml.get_original_param_name (p)
    # kcat9 is ERK dephosphorylation catalytic constant
    if original_name == 'kcat9':