vivarium.library.cobra_fba module

class vivarium.library.cobra_fba.CobraFBA(config={})[source]

Bases: object

This class provides an interface to cobra FBA. It can load in BiGG models (http://bigg.ucsd.edu/models) if provided a model_path to a saved JSON BiGG model, or load in a novel model specified by stoichiometry, reversibility, and objective.

TODO (Eran) – MOMA option is provided, but has not yet been tested.

cobra_configuration
constrain_flux(bounds={})[source]

add externally imposed constraints

constrain_reaction_bounds(bounds={})[source]
external_reactions()[source]
get_reaction_bounds(reactions=[])[source]
get_reactions(reactions=[])[source]
internal_reactions()[source]
objective_value()[source]
optimize()[source]
reaction_ids()[source]
read_exchange_fluxes()[source]

removes the prefix from exchange reactions keys, leaving only the external molecule id

read_exchange_reactions()[source]

leaves the prefix in exchange reactions keys

read_fluxes(molecules)[source]
read_internal_fluxes()[source]
regulate_flux(reactions)[source]

regulate flux based on True/False activity values for each id in reactions dictionary

set_exchange_bounds(bounds={})[source]

apply new_bounds for the defined molecules. reset unincluded molecules to their exchange_bounds.

class vivarium.library.cobra_fba.JsonFBA(path)[source]

Bases: object

vivarium.library.cobra_fba.build_model(stoichiometry, reversible, objective, external_molecules, default_upper_bound=1000)[source]
vivarium.library.cobra_fba.extract_model(model)[source]

TODO – where do demands and sinks go? demands = model.demands sinks = model.sinks

# boundary reactions include exchanges, demands, sinks boundary = model.boundary boundary_reactions = [reaction.id for reaction in boundary]

vivarium.library.cobra_fba.swap_synonyms(model)[source]
vivarium.library.cobra_fba.test_canonical()[source]
vivarium.library.cobra_fba.test_demo()[source]
vivarium.library.cobra_fba.test_fba()[source]
vivarium.library.cobra_fba.test_minimal()[source]