Shen/Howells model tests

[source]

This file contains a series of tests to ensure that the ODEs generated by the PySB version of each model exactly match those of the original publication. The procedure for validating the models (and creating the tests) was as follows:

  1. Generate the ODEs from the PySB model using pysb.bng.generate_equations
  2. Programmatically rename all parameters and species to use the names from the original publication.
  3. (For TestChenBiophysJ and TestHowells) Programmatically verify the values of all parameters against the values used in the original publication.
  4. Manually verify the transformed PySB ODEs against the ODEs from the original publication.
  5. Include the (verified) output in a test to ensure that the model continues to produce the correct output in the face of any future changes in macros, libraries, etc.

Note that the models in the earm.mito module, by default, have a zero initial condition for the activator species (Bid). To generate the ODEs used by the original publications, it is necessary to add an additional non-zero initial condition for Bid. This is accomplished in the setUp() method of each test.

Functions and Classes

earm.tests.test_shen_models.convert_odes(model, p_name_map, s_name_map_by_pattern)[source]

Substitutes species and parameter names using the given name mappings.

Parameters:

model : pysb.core.Model

The model to be converted.

p_name_map : dict

A dict where the keys are the parameter names of the PySB model and the values are the parameter names of the original model, e.g. {‘bind_BidT_Bcl2_kf’: ‘ka_tBid_Bcl2’}

s_name_map : dict

A dict where the keys are the string representations of the species from the PySB model, generated by calling str(species), and the values are the species names in the original model, e.g. {‘Bid(bf=None, state=T)’: ‘Act’}

Returns:

List of strings :

One string entry for each ODE in the model. Each ODE is represented as a string, e.g. “d[Act]/dt = ...”

earm.tests.test_shen_models.odes_match(generated_odes, validated_odes)[source]

Return True if the ODEs match.

Both args are dicts, where the key is the original species name, and the value is the string representation of the ODE.

earm.tests.test_shen_models.convert_parameters(model, p_name_map, original_units='micromolar')[source]

Convert the parameters from the PySB version of the model to have names and units that match the original publication.

Used to test that the nominal parameter values of the PySB model match those of the original publication.

Parameters:

model : pysb.core.Model

The model to be converted.

p_name_map : dict

A dict where the keys are the parameter names of the PySB model and the values are the parameter names of the original model, e.g. {‘bind_BidT_Bcl2_kf’: ‘ka_tBid_Bcl2’}

original_units: string, ‘micromolar’ or ‘nanomolar’ :

By convention, the units in the PySB versions of all models are expressed as numbers of molecules with a default volume V, specified in earm.shared. Convert parameters converts the parameter values from numbers of molecules back into concentration units that match the original publication (either micromolar or nanomolar).

class earm.tests.test_shen_models.TestChenBiophysJ(methodName='runTest')[source]

Test the PySB version of the model from [Chen2007biophysj].

Methods

test_odes()[source]

Check the generated ODEs against manually validated ODEs.

The ODEs generated by the PySB model match those of the paper with the following two caveats:

  1. In the equation for d[Bcl2]/dt, in the paper the authors group the terms

    • AcBaxBcl2*k4 + ActBcl2*k6’

    into the single term

    • k_Bcl2 * Bcl2_nonfree

    with the comment that “Bcl2_nonfree indicates the total concentration of Bcl2 associated with both activated Bax and Activator ([Bcl2_nonfree] = [AcBaxBcl2] + [ActBcl2]). We use k_bcl2 to represent the rate of non-free Bcl2 shifting to free Bcl2, assuming that free Bcl2 originates from both Bcl2 non-free forms at the same rate.”

    In addition, in the legend for Table 1 (which lists parameters) they state that: “We set k_bcl2 (the rate of non-free Bcl2 shifting to free Bcl2)... equal to k6 assuming that free Bcl2 originate [sic] from AcBaxBcl2 at the same rate with ActBcl2.”

    So, obviously this substitution of Bcl2_nonfree for AcBaxBcl2 and ActBcl2 works if k4 and k6 are equal, which they claim as an assumption; however, in their table of parameter values, they list k4 as having a value of 0.001 s^-1, and k6 as having a value of 0.04 s^-1.

  2. It should also be noted that the parameter for spontaneous pore formation, k9, has already been multiplied by 4 from its nominal value listed in the paper. This accounts for BNG’s (appropriate) addition of the coefficients of 0.25 to the Bax polymerization forward reaction, due to the reaction being a homomeric binding reaction.

  3. Because the rate of displacement of Bax from Bcl2 by tBid is set to 0 in the original model, this reaction and its associated rate parameter k8 have been eliminated from the model.

test_parameters()[source]

Check that the values of the parameters in the PySB model match those of the original.

The parameter values in the test below have been verified to match the values listed in Table 1 of [Chen2007biophysj].

class earm.tests.test_shen_models.TestChenFEBS_Indirect(methodName='runTest')[source]

Test the PySB version of the “indirect” model from [Chen2007febs].

Methods

test_odes()[source]

Check the generated ODEs against manually validated ODEs.

class earm.tests.test_shen_models.TestChenFEBS_Direct(methodName='runTest')[source]

Test the PySB version of the “direct” model from [Chen2007febs].

Methods

test_odes()[source]

Check the generated ODEs against manually validated ODEs.

class earm.tests.test_shen_models.TestCui_Direct(methodName='runTest')[source]

Test the PySB version of the “direct” model from [Cui2008].

Methods

test_odes()[source]

Check the generated ODEs against manually validated ODEs.

class earm.tests.test_shen_models.TestCui_Direct1(methodName='runTest')[source]

Test the PySB version of the “direct 1” model from [Cui2008].

Methods

test_odes()[source]

Check the generated ODEs against manually validated ODEs.

class earm.tests.test_shen_models.TestCui_Direct2(methodName='runTest')[source]

Test the PySB version of the “direct 2” model from [Cui2008].

Methods

test_odes()[source]

Check the generated ODEs against manually validated ODEs.

class earm.tests.test_shen_models.TestHowells(methodName='runTest')[source]

Test the PySB version of the model from [Howells2011].

Methods

test_odes()[source]

Check the generated ODEs against manually validated ODEs.

The ODEs shown in the code match the ODEs listed in the paper, with the note that the parameter for spontaneous pore formation, ka_Bak_poly, has already been multiplied by 4 from its nominal value listed in the paper. This accounts for BNG’s (appropriate) addition of the coefficients of 0.25 to the Bak polymerization forward reaction, due to the reaction being a homomeric binding reaction.

test_parameters()[source]

Check that the values of the parameters in the PySB model match those of the original.

The parameter values shown in the test below have been validated against the list in Table 1 of Howells et al.