maboss_test API

In the maboss_test module,

class maboss_test.MaBoSSTestCase.MaBoSSTestCase(sim, verbose=True)[source]

MaBoSSTestCase is the class used to verify model validity. It contains several methods to test various conditions

assertNodesDependencies(mutations, condition, nodes_expected)[source]

Assert that all states satisfying a condition on some given nodes also present the expected value for some other nodes.

Parameters:
  • mutations (dict) – The mutations to apply to the model
  • condition (dict) – A list of nodes with a specifc value assigned (0:inactive or 1:active) that a state has to respect in order to be selected
  • nodes_expected (dict) – A list of nodes with a specifc value assigned (0:inactive or 1:active) that all the selected states have to respect

This function will simulate the model with the given mutations. It will then extract the stable states of the model in which the activity of the nodes in condition is satisfied. It will then check that, for each selected state, the values of the nodes in nodes_expected is satisfied. If not correct, this test will fail by raising an exception.

assertStableStateProbability(mutations, state, direction, reference_prob=0, digits=4)[source]

Assert the evolution of the probability of a given stable state after applying a mutation.

Parameters:
  • mutations (dict) – The mutations to apply to the model
  • state (dict) – The state to evaluate
  • direction (string) – The direction of the evolution of the given state, it may be: ‘increase’, ‘decrease’ or ‘stable’ :param float reference_prob: The probability that will be compared with the probability to obtain “state” :param int digits: The number of digits you want to keep during the comparison

This function will simulate the model with the given mutations. It will then compare simulation results with reference_prob, and check if the given stable state is evolving in the indicated direction. If not correct, this test will fail by raising an exception.

assertStableStateProbabilityEvolution(mutations, I_C, state, direction, digits=4)[source]

Assert the evolution of the probability of a given stable state after applying a mutation.

Parameters:
  • mutations (dict) – The mutations to apply to the model
  • I_C – Initial conditions with which to simulate the model, it may be a list or a dictionary
  • state (dict) – The state to evaluate
  • direction (string) – The direction of the evolution of the given state, it may be: ‘increase’, ‘decrease’ or ‘stable’
  • digits (int) – The number of digits you want to keep during the comparison

This function will simulate the wild type model and the model with the given mutations, both with the initial conditions I_C. It will then compare simulation results and check if the given stable state is evolving in the indicated direction. If not correct, this test will fail by raising an exception.

assertStateProbabilityEvolution(mutations, I_C, state, direction, digits=4)[source]

Assert the evolution of the probability of a given state after applying a mutation.

Parameters:
  • mutations (dict) – The mutations to apply to the model
  • I_C – Initial conditions with which to simulate the model, it may be a list or a dictionary
  • state (dict) – The state to evaluate
  • direction (string) – The direction of the evolution of the given state, it may be: ‘increase’, ‘decrease’ or ‘stable’
  • digits (int) – The number of digits you want to keep during the comparison

This function will simulate the wild type model and the model with the given mutations, both with the initial conditions I_C. It will then compare simulation results and check if the given state is evolving in the indicated direction. If not correct, this test will fail by raising an exception.

getLastNodesProbabilities(mutations, I_C)[source]

Return a dictionary with the final activation probabily of every node in the model.

param dict mutations:
 The mutations to apply to the model
Parameters:I_C (dict) – Initial conditions with which to simulate the model, it may be a list or a dictionary

This function will simulate the model with the given mutations and initial conditions. It will then return the activation probability of each node in a form that can be used as initial condition for the assert functions.