Analysis Settings

The script a.py in the Araudia repo can be used to perform general data analysis on a completed simulation. The various analysis settings and tools available are explained below.

output_dir

The directory where the simulation output files to be analysed are stored. By starting the path with a slash, you can specify an absolute directory path e.g. /Users/myuser/simdata/. If the directory does not start with a slash e.g. _output/, then its is assumed to be relative to the Araudia directory. So, in this case, araudia/_output/.

significant mutants only

Setting to True makes some of the plots described below show only “significant mutants”. These are daughter variants which survive long enough in the chemostat to produce another variant, and are hence most “significant” to the evolutionary trajectory of the system.

Hence this option allows to remove some “noise” from e.g. population dynamics plots, or ecological relationship graphs, as many ephemeral protocell types in the chemostat are not shown.

ODE check

Setting to True makes all segments of a completed simulation undergo deterministic solution via Ordinary Differential Equations (ODEs), before any data is graphed. This option is useful to prove that the trajectories of the stochastic simulation are approximately correct. At the beginning of every simulation segment, the deterministic solver starts at the same state as the stochastic system.

The deterministic solution is shown as a black dotted line over the top of the stochastic trajectory on all graphs.

course dynamics

A list specifying what type of simulation dynamics to graph (in a ‘coarse-grain’ way):

  • “chemicals” The chemicals inside the chemostat

  • “protocells” The population levels of the protocell types in the chemostat

  • “enzymes” The enzyme levels inside the protocell types in the chemostat

For example, ["chemicals", "enzymes"] will display a graph of the chemical levels inside the chemostat, and a graph of the enzyme levels inside all protocell types.

Dynamics are ‘coarse’ because data points are only plotted at the beginning and end of simulation segments (not in-between). This is the best option for plotting the dynamics of simulations over 100k time steps.

If the significant mutants only setting above is True then only significant mutants are shown on the “protocells” and “enzymes” plots.

superimpose feeds

A list specifying which nutrient feed concentrations to super-impose over the top of dynamics plots. For example, ["c0", "c1"] will display the feed concentrations of nutrients 0 and 1 (assuming that they are in the feed). Nutrient feed concentrations are displayed on a second y-axis. If the list is empty [], no nutrient feeds are displayed.

lineage tree

A tuple specifying which evolutionary lineage tree should be drawn for the simulation. For example, (23, (40000, 200000)) specifies that the tree should start with protocell type p23 at time t=40000 and that the lineage branches should be drawn to time t=200000. Note that protocell type p23 must exist in the chemostat at time t=40000: this can be first checked by the protocell types at time t command below. Note that the lineage tree is simplified and shows only “significant” mutant types when the significant mutants only option is True.

If None is specified instead of a tuple, this option is skipped and no lineage tree is drawn.

protocell types at time t

A time point at which protocell types in the chemostat will be listed. For example 40000. Protocell types in the list marked by “*” are significant mutants. If None is specified, this option is skipped.

state param at time t

(Used for debugging). Gives the state of all stochastic state variables are parameters at the specified time. If None is specified, this option is skipped.

ecology at time t

Draws an ecology diagram of cross-feeding relationships inside the chemostat at the time point specified, e.g. 100000. The same ecology graph is displayed several times using different layout algorithms, such that a non-overlapping diagram can obtained. If the significant mutants only setting above is True then the ecology diagram is simplified to show only significant mutants and their relationships. If None is specified, this option is skipped.

ecology at end time

If True, the ecology diagram at the end time of the simulation (whatever that may be) is drawn. If False, this option is skipped.

diversity over time

If True, a diversity over time diagram is drawn showing how many protocell types (both significant mutants, and all mutants) exist over time in the reactor. If False, this option is skipped.

detailed dynamics

A list specifying what type of simulation dynamics to graph in a detailed event-by-event way:

  • “chemicals” The chemicals inside the chemostat

  • “protocells” The population levels of the protocell types in the chemostat

  • “enzymes” The enzyme levels inside the protocell types in the chemostat

For example, ["chemicals", "protocells"] will display a graph of the chemical levels inside the chemostat, and a graph of the protocell population sizes.

Note that this option requires that the simulation be run beforehand with the "record_trajectories" flag set to True (see the Simulation Settings page). Before drawing the detailed dynamics graphs, it can take some time to convert simulation trajectories into “particles versus time” (pvt) format, before the graphs are displayed. This option is useful for analysing the dynamics of short (less than 100k time steps) simulations in detail. Otherwise, course dynamics should be used.

file info

When True, returns some basic statistics about the simulation, based on the number of data files generated:

  • The total number of simulation segments

  • The total number of protocell types created

These statistic exist even if a simulation was quit prematurely (using e.g. ctrl-C).