6.1.1.5.1.2. pytfa.redgem.lumpgem

6.1.1.5.1.2.1. Module Contents

6.1.1.5.1.2.1.1. Classes

FluxKO

Class to represent a variable attached to a reaction

UseOrKOInt

Class to represent a variable attached to a reaction

UseOrKOFlux

Class to represent a variable attached to a reaction

LumpGEM

A class encapsulating the LumpGEM algorithm

6.1.1.5.1.2.1.2. Functions

sum_reactions(rxn_dict, id_='summed_reaction', epsilon=1e-09)

Keys are reactions

6.1.1.5.1.2.1.3. Attributes

CPLEX

GUROBI

GLPK

DEFAULT_EPS

disambiguate

Lump

pytfa.redgem.lumpgem.CPLEX = optlang-cplex[source]
pytfa.redgem.lumpgem.GUROBI = optlang-gurobi[source]
pytfa.redgem.lumpgem.GLPK = optlang-glpk[source]
pytfa.redgem.lumpgem.DEFAULT_EPS = 1e-05[source]
pytfa.redgem.lumpgem.disambiguate[source]
pytfa.redgem.lumpgem.Lump[source]
exception pytfa.redgem.lumpgem.InfeasibleExcept(status, feasibility)[source]

Bases: Exception

Common base class for all non-exit exceptions.

exception pytfa.redgem.lumpgem.TimeoutExcept(time_limit)[source]

Bases: Exception

Common base class for all non-exit exceptions.

class pytfa.redgem.lumpgem.FluxKO(reaction, **kwargs)[source]

Bases: pytfa.optim.variables.ReactionVariable, pytfa.optim.variables.BinaryVariable

Class to represent a variable attached to a reaction

prefix = KO_[source]
class pytfa.redgem.lumpgem.UseOrKOInt(reaction, expr, **kwargs)[source]

Bases: pytfa.optim.constraints.ReactionConstraint

Class to represent a variable attached to a reaction

prefix = UKI_[source]
class pytfa.redgem.lumpgem.UseOrKOFlux(reaction, expr, **kwargs)[source]

Bases: pytfa.optim.constraints.ReactionConstraint

Class to represent a variable attached to a reaction

prefix = UKF_[source]
class pytfa.redgem.lumpgem.LumpGEM(tfa_model, additional_core_reactions, params)[source]

A class encapsulating the LumpGEM algorithm

init_params(self)[source]
_generate_usage_constraints(self)[source]

Generate carbon intake related constraints for each non-core reaction For each reaction rxn : rxn.forward_variable + rxn.reverse_variable + activation_var * C_uptake < C_uptake

get_cofactor_adjusted_stoich(self, rxn)[source]
_prepare_sinks(self)[source]

For each BBB (reactant of the biomass reactions), generate a sink, i.e an unbalanced reaction BBB -> of which purpose is to enable the BBB to be output of the GEM :return: the dict {BBB: sink} containing every BBB (keys) and their associated sinks

_generate_objective(self)[source]

Generate and add the maximization objective : set as many activation variables as possible to 1 When an activation variable is set to 1, the corresponding non-core reaction is deactivated

compute_lumps(self, force_solve=False, method='OnePerBBB')[source]

For each BBB (reactant of the biomass reaction), add the corresponding sink to the model, then optimize and lump the result into one lumped reaction :param force_solve: Indicates whether the computations must continue when one lumping yields a status “infeasible” :return: The dict {BBB: lump} containing every lumped reactions, associated to their BBBs

_lump_one_per_bbb(self, met_BBB, sink, force_solve)[source]
Parameters
  • met_BBB

  • sink

  • force_solve

Returns

_lump_min_plus_p(self, met_BBB, sink, p, force_solve)[source]
Parameters
  • met_BBB

  • sink

  • force_solve

Returns

_build_lump(self, met_BBB, sink)[source]

This function uses the current solution of self._tfa_model

Parameters
  • met_BBB

  • sink

Returns

pytfa.redgem.lumpgem.sum_reactions(rxn_dict, id_='summed_reaction', epsilon=1e-09)[source]

Keys are reactions Values are their multiplicative coefficient