EnsembleResult

EnsembleResult

This is the results class of the EnsembleMaBoSS API, used to get easy access to the results. This object is returned by the run() method of the Ensemble class.

class maboss.ensemble.EnsembleResult(simulation, workdir=None, overwrite=False, prefix='res')[source]
filterEnsembleByCluster(output_directory, cluster)[source]
Build an sub-ensemble from a list of list of models
Parameters:
  • output_directory – directory in which to write the new ensemble

  • cluster – list of models to include in the new ensemble

filterEnsembleByCondition(output_directory, node_filter=None, state_filter=None)[source]
Build an sub-ensemble from a condition on node or state distributions
Parameters:
  • output_directory – directory in which to write the new ensemble

  • node_filter – (optional) condition on the node distributions

  • node_filter – (optional) condition on the state distributions

getByCondition(node_filter=None, state_filter=None)[source]
Filter the ensemble by condition on the node or state distribution
Parameters:
  • node_filter – (optional) condition on the node distributions

  • node_filter – (optional) condition on the state distributions

getKMeans(clusters=0)[source]
Perform a k-means clustering on the nodes distributions of each individual result
Parameters:

clusters – number of clusters

Returns:

(dict associating cluster id to a list of models, labels of the clusters)

getStatesKMeans(clusters=0)[source]
Perform a k-means clustering on the state distributions of each individual result
Parameters:

clusters – number of clusters

Returns:

(dict associating cluster id to a list of models, labels of the clusters)

get_entropy_trajectory()

Returns the entropy vs time, as a pandas dataframe.

get_entropy_trajectory_error()

Returns the entropy error vs time, as a pandas dataframe.

get_fptable()

Return the content of fp.csv as a pandas dataframe.

get_individual_nodes_probtraj(filter=None, cluster=None)[source]
Get a Panda Dataframe with the nodes final probability of each model
Parameters:
  • filter – (optional) condition on the node distributions

  • cluster – (optional) only get the result of a specified cluster, a list of ids

get_individual_states_probtraj(filter=None, cluster=None)[source]
Get a Panda Dataframe with the states final probability of each model
Parameters:
  • filter – (optional) condition on the node distributions

  • cluster – (optional) only get the result of a specified cluster, a list of ids

get_last_nodes_probtraj(nodes=None, as_series=False)

Returns the asymptotic node probability, as a pandas dataframe.

get_last_states_probtraj(as_series=False)

Returns the asymptotic state probability, as a pandas dataframe.

get_nodes_probtraj(nodes=None, prob_cutoff=None)

Returns the node probability vs time, as a pandas dataframe.

Parameters:

prob_cutoff (float) – returns only the nodes with proba > cutoff

get_nodes_probtraj_error()

Returns the node probability error vs time, as a pandas dataframe.

get_states_probtraj(prob_cutoff=None)

Returns the state probability vs time, as a pandas dataframe.

Parameters:

prob_cutoff (float) – returns only the states with proba > cutoff

get_states_probtraj_errors()

Returns the state probability error vs time, as a pandas dataframe.

plotStates3D(dims, figsize=(20, 12), compare=None, ax=None, **args)[source]
Plots the distribution of the ensemble individual results as a 3D object, for 3 given states.
Parameters:
  • dims – list of the three states to plot

  • figsize – (optional) tuple containing the size of the figure

  • compare – (optional) other ensemble result for comparison

  • ax – (optional) axes to plot on

plotSteadyStatesDistribution(compare=None, labels=None, alpha=1, single_out=None, single_out_mutant=None, nil_label=None, compare_labels=None, **args)[source]
Plots the distribution of the ensemble individual results in PCA space
Parameters:
  • compare – (optional) other ensemble simulation result, for comparison

  • labels – (optional) list of colors to use for each model

  • alpha – (optional) transparency of markers

  • single_out – (optional) index of a model to highlight

  • single_out_mutant – (optional) index of a model to highlight in the other ensemble simulation result

  • nil_label – (optional) label for renaming the <nil> state

  • compare_labels – (optional) labels to use in the legend

plotSteadyStatesNodesDistribution(compare=None, labels=None, alpha=1, **args)[source]
Plots the nodes distribution of the ensemble individual results in PCA space
Parameters:
  • compare – (optional) other ensemble simulation result, for comparison

  • labels – (optional) list of colors to use for each model

  • alpha – (optional) transparency of markers

plotTSNESteadyStatesDistribution(node_filter=None, state_filter=None, clusters={}, perplexity=50, n_iter=2000, **args)[source]
Plots the states distribution of the ensemble individual results in T-SNE space
Parameters:
  • node_filter – (optional) filter in node distribution to highlight a sub-ensemble of models

  • node_filter – (optional) filter in state distribution to highlight a sub-ensemble of models

  • cluster – (optional) dict with, for each model, the id of the cluster if belongs to

  • perplexity – (optional) hyper-parameter of T-SNE (default=50)

  • n_iter – (optional) default parameter of T-SNE (default=2000)

plotTSNESteadyStatesNodesDistribution(node_filter=None, state_filter=None, clusters={}, perplexity=50, n_iter=2000, **args)[source]
Plots the nodes distribution of the ensemble individual results in T-SNE space
Parameters:
  • node_filter – (optional) filter in node distribution to highlight a sub-ensemble of models

  • node_filter – (optional) filter in state distribution to highlight a sub-ensemble of models

  • cluster – (optional) dict with, for each model, the id of the cluster if belongs to

  • perplexity – (optional) hyper-parameter of T-SNE (default=50)

  • n_iter – (optional) default parameter of T-SNE (default=2000)

plot_entropy_trajectory(until=None, axes=None)

Plot the evolution of the (transition) entropy over time.

Parameters:

until (float) – plot only up to time=`until`.

plot_fixpoint(axes=None)

Plot the probability distribution of fixed point.

plot_node_trajectory(until=None, legend=True, error=False, prob_cutoff=None, axes=None)

Plot the probability of each node being up over time.

Parameters:

until (float) – plot only up to time=`until`.

plot_piechart(embed_labels=False, autopct=4, prob_cutoff=0.01, axes=None, legend=True, nil_label=None)

Plot the states probability distribution of last time point.

Parameters:
  • prob_cutoff (float) – states with a probability below this cut-off are grouped as “Others”

  • embed_labels (bool) – if True, the labels are displayed within the pie

  • autopct (float or bool) – display pourcentages greater than autopct within the pie (defaults to 4 if it is a Boolean)

plot_trajectory(legend=True, until=None, error=False, prob_cutoff=0.01, axes=None)

Plot the graph state probability vs time.

Parameters:
  • until (float) – plot only up to time=`until`

  • legend (bool) – display legend