gMCSpy.calculateMCS module
- calculateMCS(cobraModel: Model, MAX_MCS: int, MAX_LENGTH_MCS: int, solver_params: dict | None = None, rxnSubset: List[str] | None = None, rxnKnockOut: List[str] | None = None, targetB=0.001, timelimit=60, forceLength=True, numWorkers=0, verbose=0, useIndicators=True, solver: str = 'gurobi', **kwargs)[source]
Calculates the Minimal Cut Sets (MCS) of a metabolic network. Calculates the MCS of a metabolic network using a mixed integer linear programming (MILP) formulation. Among all reactions or with a given subset of reactions, the function finds the minimal set of reactions to stop biomass production.
- Required arguments:
cobraModel: A metabolic model in cobrapy format. See cobra models.
MAX_MCS: Maximum number of MCS to be found.
MAX_LENGTH_MCS: Maximum length of MCS to be found. (i.e. number of reactions in the MCS)
- Optional arguments:
rxnToForce: List of reactions to be considered in the MCS problem. The list is expected to be of reaction names. Default value is an empty list, which means that all reactions will be considered. e.g. rxnToForce = [“R1”, “R2”, “R3”] will only consider reactions R1, R2 and R3 as possible intervention points. Only [“R1”], [“R2”], [“R3”], [“R1”, “R2”], [“R1”, “R3”], [“R2”, “R3”] and [“R1”, “R2”, “R3”] could be solutions.
rxnToKnockOut: List of reactions that you want to be part of the MCS solutions. The list is expected to be of reaction names. Default value is an empty list, which means that no reactions will be forced to be part of the MCS solutions. e.g. rxnToKnockOut = [“R1”, “R2”, “R3”] will force the MCS solutions to contain at leat one reaction from the list.
targetB: Desired activity level of the metabolic task to be disrupted. Default value is 1e- 3.
timelimit: Maximum time allowed for the solver to find a solution. Default value is 1e75.
forceLength: If True, the solver will find MCS of length 1, 2, 3, …, MAX_LENGTH_MCS. If False, the solver will find MCS of length MAX_LENGTH_MCS. Default value is True.
numWorkers: Number of workers to be used for parallel processing. Default value is 0. The solvers cplex and gurobi already use parallel processing.
verbose: If 0, the solver will not print any information. Verbose = 1, log will be printed into the console. Verbose = 2, log will be printed into the console and a log file will be created. Default value is 0.
useIndicators: If True, the solver will use binary variables to indicate if a reaction is part of the MCS.
solver: Solver to be used. Current compatibility includes cplex, gurobi, pulp and optlang_gurobi, optlang_cplex. Default value is cplex.