gMCSpy.ProblemDefinitions module
- buildDictionaryDossageNetwork(cobraModel: Model, forceLength: bool, compressedNodes: List[str], rxnToForce: List[str], verbose: int = 0, targetB: float = 0.001, cConstant: float = 0.001)[source]
Builds the dictionary that defines the MILP problem to be solved by the MCS algorithm in a Regulatory network.
- Parameters:
modelStruct – Cobra Model, the metabolic model to be operated on. Only Cobra models generated by expanded network are supported.
forceLength – boolean. If true, the length of the solution is forced to be off a given length each iteration, otherwise the length is not forced.
targetB – float. Desired activity level of the metabolic task to be disrupted.
cConstant – float. Used to activate w variable
rxnToForce – list of strings. Reactions to be forced to be part of the solution. Empty by default.
If the bounds are left as None they are ment to be infinity (None = Infinity), so each solver can interpret it as it is defined.
- Returns:
problemDict. Dictionary that defines the MILP problem to be solved by any solver defined in gMCSpy.
- buildDictionaryFBA(cobraModel: Model)[source]
Build FBA problem dictionary The basic idea of FBA is to use constraints based on the mass balance and stoichiometry of reactions to determine the steady-state fluxes through the metabolic network. The steady-state assumption assumes that the concentrations of metabolites do not change over time, which is reasonable for many metabolic systems.
- buildDictionaryFBAWithDeletions(cobraModel: Model, gMCS: List[str] | None = None, isoformSeparator: str | None = None)[source]
Build FBA problem dictionary The basic idea of FBA is to use constraints based on the mass balance and stoichiometry of reactions to determine the steady-state fluxes through the metabolic network. The steady-state assumption assumes that the concentrations of metabolites do not change over time, which is reasonable for many metabolic systems.
- buildDictionaryMCSGeneProblem(cobraModel: Model, gDict: dict, matrixG: csc_matrix, relationships: dict, maxKOLength: int, numberNewGenesByKO: dict, minKOLength: int = 0, forceLength: bool = False, verbose: int = 0, targetB: float = 0.001, cConstant: float = 0.001, logPath: str | None = None)[source]
Builds the dictionary that defines the MILP problem to be solved by the MCS algorithm.
- Parameters:
modelStruct – Cobra Model, the metabolic model to be operated on. Only Cobra models are supported.
forceLength – boolean. If true, the length of the solution is forced to be off a given length each iteration, otherwise the length is not forced.
targetB – float. Desired activity level of the metabolic task to be disrupted.
cConstant – float. Used to activate w variable
rxnToForce – list of strings. Reactions to be forced to be part of the solution. Empty by default.
If the bounds are left as None they are ment to be infinity (None = Infinity), so each solver can interpret it as it is defined.
- Returns:
problemDict. Dictionary that defines the MILP problem to be solved by any solver defined in gMCSpy.
- buildDictionaryMCSGeneTargetedProblem(cobraModel: Model, gDict: dict, matrixG: csc_matrix, relationships: dict, maxKOLength: int, numberNewGenesByKO: dict, geneSubset: list, targetKOs: list, minKOLength: int = 0, forceLength: bool = False, verbose: int = 0, targetB: float = 0.001, cConstant: float = 100)[source]
Builds the dictionary that defines the MILP problem to be solved by the MCS algorithm.
- Parameters:
modelStruct – Cobra Model, the metabolic model to be operated on. Only Cobra models are supported.
forceLength – boolean. If true, the length of the solution is forced to be off a given length each iteration, otherwise the length is not forced.
targetB – float. Desired activity level of the metabolic task to be disrupted.
cConstant – float. Used to activate w variable
rxnToForce – list of strings. Reactions to be forced to be part of the solution. Empty by default.
If the bounds are left as None they are meant to be infinity (None = Infinity), so each solver can interpret it as it is defined.
- Returns:
problemDict. Dictionary that defines the MILP problem to be solved by any solver defined in gMCSpy.
- buildDictionaryMCSProblem(cobraModel: Model, forceLength: bool, rxnToForce: List[str], verbose: int = 0, targetB: float = 0.001, cConstant: float = 0.001)[source]
Builds the dictionary that defines the MILP problem to be solved by the MCS algorithm.
- Parameters:
modelStruct – Cobra Model, the metabolic model to be operated on. Only Cobra models are supported.
forceLength – boolean. If true, the length of the solution is forced to be off a given length each iteration, otherwise the length is not forced.
targetB – float. Desired activity level of the metabolic task to be disrupted.
cConstant – float. Used to activate w variable
rxnToForce – list of strings. Reactions to be forced to be part of the solution. Empty by default.
If the bounds are left as None they are ment to be infinity (None = Infinity), so each solver can interpret it as it is defined.
- Returns:
problemDict. Dictionary that defines the MILP problem to be solved by any solver defined in gMCSpy.
- buildDictionaryMCSTargetedProblem(cobraModel: Model, forceLength: bool, rxnSubset: List[str], rxnKnockOut: List[str], verbose: int = 0, targetB: float = 0.001, cConstant: float = 0.001)[source]
Builds the dictionary that defines the MILP problem to be solved by the MCS algorithm.
- Parameters:
modelStruct – Cobra Model, the metabolic model to be operated on. Only Cobra models are supported.
forceLength – boolean. If true, the length of the solution is forced to be off a given length each iteration, otherwise the length is not forced.
targetB – float. Desired activity level of the metabolic task to be disrupted.
cConstant – float. Used to activate w variable
rxnToForce – list of strings. Reactions to be forced to be part of the solution. Empty by default.
If the bounds are left as None they are ment to be infinity (None = Infinity), so each solver can interpret it as it is defined in each solver.
- Returns:
problemDict. Dictionary that defines the MILP problem to be solved by any solver defined in gMCSpy.
- buildDictionaryReactionsFBAWithDeletions(cobraModel: Model, reactions: List[str] | None = None)[source]
Build FBA problem dictionary The basic idea of FBA is to use constraints based on the mass balance and stoichiometry of reactions to determine the steady-state fluxes through the metabolic network. The steady-state assumption assumes that the concentrations of metabolites do not change over time, which is reasonable for many metabolic systems.
- buildDictionaryRegNetwork(cobraModel: Model, forceLength: bool, compressedNodes: List[str], rxnToForce: List[str], verbose: int = 0, targetB: float = 0.001, cConstant: float = 0.001)[source]
Builds the dictionary that defines the MILP problem to be solved by the MCS algorithm in a Regulatory network.
- Parameters:
modelStruct – Cobra Model, the metabolic model to be operated on. Only Cobra models generated by expanded network are supported.
forceLength – boolean. If true, the length of the solution is forced to be off a given length each iteration, otherwise the length is not forced.
targetB – float. Desired activity level of the metabolic task to be disrupted.
cConstant – float. Used to activate w variable
rxnToForce – list of strings. Reactions to be forced to be part of the solution. Empty by default.
If the bounds are left as None they are ment to be infinity (None = Infinity), so each solver can interpret it as it is defined.
- Returns:
problemDict. Dictionary that defines the MILP problem to be solved by any solver defined in gMCSpy.