optForceGAMS

exportInputsMustOrder2ToGAMS(model, minFluxesW, maxFluxesW, constrOpt, excludedRxns, mustSetFirstOrder, inputFolder)

This function exports all the inputs needed to run the GAMS functions to find second order Must Sets (MustUU, MustLL, MustUL). The inputs will be stored in inputFolder. Some inputs will be exported using GDXMRW and others will be exported as simple .txt files.

USAGE:

exportInputsMustOrder2ToGAMS(model, minFluxesW, maxFluxesW, constrOpt, excludedRxns, mustSetFirstOrder, inputFolder)

INPUTS:
model: (structure) a metabolic model with at least

the following fields:

  • .rxns - Reaction IDs in the model

  • .mets - Metabolite IDs in the model

  • .S - Stoichiometric matrix (sparse)

  • .b - RHS of Sv = b (usually zeros)

  • .c - Objective coefficients

  • .lb - Lower bounds for fluxes

  • .ub - Upper bounds for fluxes

minFluxesW: (double array of size n_rxns x 1) minimum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce e.g.: minFluxesW = [-90; -56];

maxFluxesW: (double array of size n_rxns x 1) maximum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce e.g.: maxFluxesW = [90; 56];

constrOpt: (structure) Structure containing additional

contraints. Include here only reactions whose flux is fixed, i.e., reactions whose lower and upper bounds have the same value. Do not include here reactions whose lower and upper bounds have different values. Such contraints should be defined in the lower and upper bounds of the model. The structure has the following fields:

  • .rxnList - Reaction list (cell array)

  • .values - Values for constrained reactions (double array). E.g.: struct(‘rxnList’, {{‘EX_gluc’, ‘R75’, ‘EX_suc’}}, ‘values’, [-100, 0, 155.5]’);

excludedRxns: (cell array) Reactions to be excluded to the

MustUL set. This could be used to avoid finding transporters or exchange reactions in the set. Default: empty.

mustSetFirstOrder: (cell array) Reactions that belong to MustU

and MustL (first order sets). Default: empty.

inputFolder: (string) Folder where inputs for GAMS

function will be stored

OUTPUTS:
Reactions.txt: (file) File containing the

identifiers for reactions

Metabolites.txt: (file) File containing the

identifiers for metabolites

Constrains.txt: (file) File containing the

identifiers for constrained reactions

Excluded.txt: (file) File containing the

identifiers for excluded reactions. These reactions will not be considered in when running findMustXX.gms (XX = UU or LL or UL depending on the case)

MustSetFirstOrder.txt: (file) File containing the

identifiers for reactions in MustL and MustU

MtoG.gdx: (file) File containing the

parameters which will be read by GAMS (lower bounds, upper bounds, stoichiometrix matrix S, minimum and maximun fluxes for each reaction in the previous step of FVA, and the values for contrained reactions)

exportInputsMustToGAMS(model, minFluxesW, maxFluxesW, constrOpt, inputFolder)

This function export all the inputs needed to run the GAMS functions to find first order Must Sets (MustU, MustL). The inputs will be stored in inputFolder. Some inputs will be exported using GDXMRW and others will be exported as simple .txt files.

USAGE:

exportInputsMustToGAMS(model, minFluxesW, maxFluxesW, constrOpt, inputFolder)

INPUTS:
model: (structure) a metabolic model with at least the

following fields:

  • .rxns - Reaction IDs in the model

  • .mets - Metabolite IDs in the model

  • .S - Stoichiometric matrix (sparse)

  • .b - RHS of Sv = b (usually zeros)

  • .c - Objective coefficients

  • .lb - Lower bounds for fluxes

  • .ub - Upper bounds for fluxes

minFluxesW: (double array of size n_rxns x 1) minimum fluxes

for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce. E.g.: minFluxesW = [-90; -56];

maxFluxesW: (double array of size n_rxns x 1) maximum fluxes

for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce. E.g.: maxFluxesW = [90; 56];

constrOpt: (structure) structure containing additional

contraints. Include here only reactions whose flux is fixed, i.e., reactions whose lower and upper bounds have the same value. Do not include here reactions whose lower and upper bounds have different values. Such contraints should be defined in the lower and upper bounds of the model. The structure has the following fields:

  • .rxnList - Reaction list (cell array)

  • .values - Values for constrained reactions (double array). E.g.: struct(‘rxnList’, {{‘EX_gluc’, ‘R75’, ‘EX_suc’}}, ‘values’, [-100, 0, 155.5]’);

inputFolder: (string) Folder where inputs for GAMS function

will be stored

OUTPUTS:
Reactions.txt: (file) File containing the identifiers for

reactions

Metabolites.txt: (file) File containing the identifiers for

metabolites

Constrains.txt: (file) File containing the identifiers for

constrained reactions

MtoG.gdx: (file) File containing the parameters which

will be read by GAMS (lower bounds, upper bounds, stoichiometrix matrix S, minimum and maximun fluxes for each reaction in the previous step of FVA, and the values for contrained reactions)

exportInputsOptForceToGAMS(model, targetRxn, mustU, mustL, minFluxesW, maxFluxesW, minFluxesM, maxFluxesM, k, n_sets, constrOpt, excludedURxns, excludedLRxns, excludedKRxns, inputFolder)

This function export the inputs required by GAMS to run optForce. Some inputs will be exported to plain text (.txt files) and others will be exported using GDXMRW. Inputs will be stored in inputFolder

USAGE:

exportInputsOptForceToGAMS(model, targetRxn, mustU, mustL, minFluxesW, maxFluxesW, minFluxesM, maxFluxesM, k, nSets, constrOpt, excludedURxns, excludedLRxns, excludedKRxns, inputFolder)

INPUTS:
model: (structure) a metabolic model with at least the

following fields:

  • .rxns - Reaction IDs in the model

  • .mets - Metabolite IDs in the model

  • .S - Stoichiometric matrix (sparse)

  • .b - RHS of Sv = b (usually zeros)

  • .c - Objective coefficients

  • .lb - Lower bounds for fluxes

  • .ub - Upper bounds for fluxes

targetRxn: (string) string containing the ID for the

reaction whose flux is intented to be increased. For example, if the production of succionate is desired to be increased, ‘EX_suc’ should be chosen as the target reaction. E.g.: targetRxn = ‘EX_suc’;

mustU: (cell array) List of reactions in the MustU set

This input can be obtained by running the script findMustU.m. E.g.: mustU = {‘R21_f’;’R22_f’};

mustL: (cell array) List of reactions in the MustL set

This input can be obtained by running the script findMustL.m. E.g.: mustL = {‘R11_f’;’R26_f’};

minFluxesW: (double array of size n_rxns x 1) minimum fluxes

for each reaction in the model for wild-type strain. E.g.: minFluxesW = [-90; -56];

maxFluxesW: (double array of size n_rxns x 1) maximum fluxes

for each reaction in the model for wild-type strain. E.g.: maxFluxesW = [92; -86];

minFluxesM: (double array of size n_rxns x 1)

Description: Minimum fluxes for each reaction in the model for mutant strain E.g.: minFluxesW = [-90; -56];

maxFluxesM: (double array of size n_rxns x 1) maximum fluxes

for each reaction in the model for mutant strain. E.g.: maxFluxesW = [92; -86];

k: (double) number of intervations to be found nSets: (double) maximum number of force sets returned

by optForce.

constrOpt: (Structure) structure containing additional

contraints. Include here only reactions whose flux is fixed, i.e., reactions whose lower and upper bounds have the same value. Do not include here reactions whose lower and upper bounds have different values. Such contraints should be defined in the lower and upper bounds of the model. The structure has the following fields:

  • .rxnList - Reaction list (cell array)

  • .values - Values for constrained reactions (double array). E.g.: struct(‘rxnList’, {{‘EX_gluc’, ‘R75’, ‘EX_suc’}}, ‘values’, [-100, 0, 155.5]’);

excludedURxns: (cell array) Reactions to be excluded from

upregulations

excludedLRxns: (cell array) Reactions to be excluded from

downregulations

excludedKRxns: (cell array) Reactions to be excluded from

knockouts

inputFolder: (string) folder where inputs will be stored.

Just the name of the folder, not the full path.

OUTPUTS:
Reactions.txt: (file) File containing the identifiers for

reactions

Metabolites.txt: (file) File containing the identifiers for

metabolites

Constrains.txt: (file) File containing the identifiers for

constrained reactions

Excluded_U.txt: (file) File containing the identifiers for

excluded reactions. These reactions will not be considered for upregulations when running optForce.gms

Excluded_L.txt: (file) File containing the identifiers for

excluded reactions. These reactions will not be considered for downregulations when running optForce.gms

Excluded_K.txt: (file) File containing the identifiers for

excluded reactions. These reactions will not be considered for knowckouts when running optForce.gms

MustU.txt: (file) File containing the identifiers for

upregulated reactions find in MustU, MustUU and MustUL

MustU.txt: (file) File containing the identifiers for

downregulated reactions find in MustL, MustLL and MustUL

MtoG.gdx: (file) File containing the parameters which

will be read by GAMS (lower bounds, upper bounds, stoichiometrix matrix S, minimum and maximun fluxes for each reaction in the previous step of FVA, and the values for contrained reactions)

exportSetToGAMS(set, fileName)

This function exports the information in “set” to a .txt file which can be read by GAMS. “set” must be a cell array of strings.

USAGE:

[] = exportSetToGAMS(set, fileName)

INPUTS:
set: (cell array of strings) cell array containing

identifiers for certain set of elements (reactions, metabolites, etc).

fileName: (string) Name of the file in which the

information will be stored. It is recomended to add the extension of the file.

OUTPUTS:
fileName.txt: (file) File of name “fileName” containing

the set of elements, one for row.

Example

exportSetToGAMS(model.rxns, ‘Reactions.txt’) %This, will export the list of elements in model.rxns to a file called Reactions.txt

findMustLLWithGAMS(model, minFluxesW, maxFluxesW, constrOpt, excludedRxns, mustSetFirstOrder, solverName, runID, outputFolder, outputFileName, printExcel, printText, printReport, keepInputs, keepGamsOutputs, verbose)

This function runs the second step of optForce, that is to solve a bilevel mixed integer linear programming problem to find a second order MustLL set.

USAGE:

[mustLL, pos_mustLL, mustLL_linear, pos_mustLL_linear] = findMustLLWithGAMS(model, minFluxesW, maxFluxesW, varargin)

INPUTS:
model: (structure) a metabolic model with at least

the following fields:

  • .rxns - Reaction IDs in the model

  • .mets - Metabolite IDs in the model

  • .S - Stoichiometric matrix (sparse)

  • .b - RHS of Sv = b (usually zeros)

  • .c - Objective coefficients

  • .lb - Lower bounds for fluxes

  • .ub - Upper bounds for fluxes

minFluxesW: (double array of size n_rxns x 1) minimum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce. E.g.: minFluxesW = [-90; -56];

maxFluxesW: (double array of size n_rxns x 1) maximum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVA_optForce. E.g.: maxFluxesW = [90; 56];

OPTIONAL INPUTS:
constrOpt: (Structure) structure containing

additional contraints. Include here only reactions whose flux is fixed, i.e., reactions whose lower and upper bounds have the same value. Do not include here reactions whose lower and upper bounds have different values. Such contraints should be defined in the lower and upper bounds of the model. The structure has the following fields:

  • .rxnList - Reaction list (cell array)

  • .values - Values for constrained reactions (double array) E.g.: struct(‘rxnList’, {{‘EX_gluc’, ‘R75’, ‘EX_suc’}}, ‘values’, [-100, 0, 155.5]’);

excludedRxns: (cell array) Reactions to be excluded to

the MustLL set. This could be used to avoid finding transporters or exchange reactions in the set. Default = empty.

mustSetFirstOrder: (cell array) Reactions that belong to MustU

and MustL (first order sets). Default = empty.

solverName: (string) Name of the solver used in

GAMS. Default = ‘cplex’.

runID: (string) ID for identifying this run.

Default = [‘run’ date hour].

outputFolder: (string) name for folder in which

results will be stored. Default = ‘OutputsFindMustLL’.

outputFileName: (string) name for files in which

results will be stored. Default = ‘MustLLSet’.

printExcel: (double) boolean to describe wheter

data must be printed in an excel file or not. Default = 1

printText: (double) boolean to describe wheter

data must be printed in an plaint text file or not. Default = 1

printReport: (double) 1 to generate a report in a

plain text file. 0 otherwise. Default = 1

keepInputs: (double) 1 to mantain folder with

inputs to run findMustLL.gms. 0 otherwise. Default = 1

keepGamsOutputs: (double) 1 to mantain files returned by

findMustLL.gms. 0 otherwise. Default = 1

verbose: (double) 1 to print results in console.

0 otherwise. Default = 0

OUTPUTS:
mustLL: (cell array of size number of sets found X

2). Cell array containing the reactions IDs which belong to the MustLL set. Each row contain a couple of reactions that must decrease their flux.

pos_mustLL: (double array of size number of sets found

X 2). Double array containing the positions of each reaction in mustLL with regard to model.rxns

mustLL_linear: (cell array of size number of unique

reactions found X 1) Cell array containing the unique reactions ID which belong to the MustLL Set

pos_mustLL_linear: (double array of size number of unique

reactions found X 1) double array containing positions for reactions in mustLL_linear. with regard to model.rxns

outputFileName.xls: (file) File containing one column

array with identifiers for reactions in MustLL. This file will only be generated if the user entered printExcel = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName.txt: (file) File containing one column

array with identifiers for reactions in MustLL. This file will only be generated if the user entered printText = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName_Info.xls: (file) File containing one column

array. In each row the user will find a couple of reactions. Each couple of reaction was found in one iteration of FindMustLL.gms. This file will only be generated if the user entered printExcel = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName_Info.txt: (file) File containing one column

array. In each row the user will find a couple of reactions. Each couple of reaction was found in one iteration of FindMustLL.gms. This file will only be generated if the user entered printText = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

findMustLL.lst: (file) file autogenerated by GAMS. It

contains information about equations, variables, parameters as well as information about the running (values at each iteration). This file only will be saved in the output folder if the user entered keepGamsOutputs = 1

GtoMLL.gdx: (file) file containing values for

variables, parameters, etc. which were found by GAMS when solving findMustLL.gms. This file only will be saved in the output folder if the user entered keepInputs = 1

Note

This function is based in the GAMS files written by Sridhar Ranganathan which were provided by the research group of Costas D. Maranas. For a detailed description of the optForce procedure, please see: Ranganathan S, Suthers PF, Maranas CD (2010) OptForce: An Optimization Procedure for Identifying All Genetic Manipulations Leading to Targeted Overproductions. PLOS Computational Biology 6(4): e1000744. https://doi.org/10.1371/journal.pcbi.1000744

findMustLWithGAMS(model, minFluxesW, maxFluxesW, varargin)

This function runs the second step of optForce, that is to solve a bilevel mixed integer linear programming problem to find a first order MustL set.

USAGE:

[mustLSet, posMustL] = findMustLWithGAMS(model, minFluxesW, maxFluxesW, varargin)

INPUTS:
model: (structure) a metabolic model with at least

the following fields:

  • .rxns - Reaction IDs in the model

  • .mets - Metabolite IDs in the model

  • .S - Stoichiometric matrix (sparse)

  • .b - RHS of Sv = b (usually zeros)

  • .c - Objective coefficients

  • .lb - Lower bounds for fluxes

  • .ub - Upper bounds for fluxes

minFluxesW: (double array of size n_rxns x 1) minimum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce e.g.: minFluxesW = [-90; -56];

maxFluxesW: (double array of size n_rxns x 1) maximum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce e.g.: maxFluxesW=[90; 56];

OPTIONAL INPUTS:
constrOpt: (structure) structure containing additional

contraints. Include here only reactions whose flux is fixed, i.e., reactions whose lower and upper bounds have the same value. Do not include here reactions whose lower and upper bounds have different values. Such contraints should be defined in the lower and upper bounds of the model. The structure has the following fields:

  • .rxnList - Reaction list (cell array)

  • .values - Values for constrained reactions (double array) e.g.: struct(‘rxnList’,{{‘EX_gluc’, ‘R75’, ‘EX_suc’}}, ‘values’, [-100,0,155.5]’);

solverName: (string) Name of the solver used in GAMS.

Default = ‘cplex’

runID: (string) ID for identifying this run outputFolder: (string) name for folder in which

results will be stored

outputFileName: (string) name for files in which results

will be stored

printExcel: (double) boolean to describe wheter data

must be printed in an excel file or not

printText: (double) boolean to describe wheter data

must be printed in an plaint text file or not

printReport: (double) 1 to generate a report in a

plain text file. 0 otherwise.

keepInputs: (double) 1 to mantain folder with inputs

to run findMustUU.gms. 0 otherwise.

keepGamsOutputs: (double) 1 to mantain files returned by

findMustUU.gms. 0 otherwise.

verbose: (double) 1 to print results in console.

0 otherwise.

OUTPUTS:
mustLSet: (cell array of size number of reactions

found X 1) Cell array containing the reactions ID which belong to the Must_U Set

posMustL: (double array of size number of reactions

found X 1) double array containing the positions of reactions in the model.

outputFileName.xls: (file) File containing one column array

with identifiers for reactions in MustL. This file will only be generated if the user entered printExcel = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName.txt: (file) File containing one column array

with identifiers for reactions in MustL. This file will only be generated if the user entered printText = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName_Info.xls: (file) File containing five column

arrays.

  • C1: identifiers for reactions in MustL

  • C2: min fluxes for reactions according to FVA

  • C3: max fluxes for reactions according to FVA

  • C4: min fluxes achieved for reactions, according to findMustL.gms

  • C5: max fluxes achieved for reactions, according to findMustL.gms

This file will only be generated if the user entered printExcel = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName_Info.txt: (file) File containing five column

arrays.

  • C1: identifiers for reactions in MustL

  • C2: min fluxes for reactions according to FVA

  • C3: max fluxes for reactions according to FVA

  • C4: min fluxes achieved for reactions, according to findMustL.gms

  • C5: max fluxes achieved for reactions, according to findMustL.gms

This file will only be generated if the user entered printText = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

findMustL.lst: (file) file autogenerated by GAMS. It

contains information about equations, variables, parameters as well as information about the running (values at each iteration). This file only will be saved in the output folder is the user entered keepGamsOutputs = 1

GtoML.gdx: (file) file containing values for

variables, parameters, etc. which were found by GAMS when solving findMustL.gms. This file only will be saved in the output folder is the user entered keepInputs = 1

Note

This function is based in the GAMS files written by Sridhar Ranganathan which were provided by the research group of Costas D. Maranas. For a detailed description of the optForce procedure, please see: Ranganathan S, Suthers PF, Maranas CD (2010) OptForce: An Optimization Procedure for Identifying All Genetic Manipulations Leading to Targeted Overproductions. PLOS Computational Biology 6(4): e1000744. https://doi.org/10.1371/journal.pcbi.1000744

findMustULWithGAMS(model, minFluxesW, maxFluxesW, constrOpt, excludedRxns, mustSetFirstOrder, solverName, runID, outputFolder, outputFileName, printExcel, printText, printReport, keepInputs, keepGamsOutputs, verbose)

This function runs the second step of optForce, that is to solve a bilevel mixed integer linear programming problem to find a second order MustUL set.

USAGE:

[mustUL, pos_mustUL, mustUL_linear, pos_mustUL_linear] = findMustULWithGAMS(model, minFluxesW, maxFluxesW, varargin)

INPUTS:
model: (structure) a metabolic model with at

least the following fields:

  • .rxns - Reaction IDs in the model

  • .mets - Metabolite IDs in the model

  • .S - Stoichiometric matrix (sparse)

  • .b - RHS of Sv = b (usually zeros)

  • .c - Objective coefficients

  • .lb - Lower bounds for fluxes

  • .ub - Upper bounds for fluxes

minFluxesW: (double array of size n_rxns x 1) minimum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce. E.g.: minFluxesW = [-90; -56];

maxFluxesW: (double array of size n_rxns x 1) maximum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce. E.g.: maxFluxesW = [90; 56];

OPTIONAL INPUTS:
constrOpt: (Structure) structure containing

additional contraints. Include here only reactions whose flux is fixed, i.e., reactions whose lower and upper bounds have the same value. Do not include here reactions whose lower and upper bounds have different values. Such contraints should be defined in the lower and upper bounds of the model. The structure has the following fields:

  • .rxnList - Reaction list (cell array)

  • .values - Values for constrained reactions (double array) E.g.: struct(‘rxnList’, {{‘EX_gluc’, ‘R75’, ‘EX_suc’}}, ‘values’, [-100, 0, 155.5]’);

excludedRxns: (cell array) Reactions to be excluded to

the MustUL set. This could be used to avoid finding transporters or exchange reactions in the set. Default = empty.

mustSetFirstOrder: (cell array) Reactions that belong to

MustU and MustL (first order sets). Default = empty.

solverName: (string) Name of the solver used in

GAMS. Default = ‘cplex’.

runID: (string) ID for identifying this run.

Default = [‘run’ date hour].

outputFolder: (string) name for folder in which

results will be stored. Default = ‘OutputsFindMustUL’.

outputFileName: (string) name for files in which

results. will be stored Default = ‘MustULSet’.

printExcel: (double) boolean to describe wheter

data must be printed in an excel file or not. Default = 1

printText: (double) boolean to describe wheter

data must be printed in an plaint text file or not. Default = 1

printReport: (double) 1 to generate a report in a

plain text file. 0 otherwise. Default = 1

keepInputs: (double) 1 to mantain folder with

inputs to run findMustUL.gms. 0 otherwise. Default = 1

keepGamsOutputs: (double) 1 to mantain files returned by

findMustUL.gms. 0 otherwise. Default = 1

verbose: (double) 1 to print results in console.

0 otherwise. Default = 0

OUTPUTS:
mustUL: (cell array of size number of sets found X

2) Cell array containing the reactions IDs which belong to the MustUL set. Each row contain a couple of reactions that must decrease their flux.

pos_mustUL: (double array of size number of sets found

X 2) double array containing the positions of each reaction in mustUL with regard to model.rxns

mustUL_linear: (cell array of size number of unique

reactions found X 1) Cell array containing the unique reactions ID which belong to the MustUL Set

pos_mustUL_linear: (double array of size number of unique

reactions found X 1) double array containing positions for reactions in mustUL_linear. with regard to model.rxns

outputFileName.xls: (file) File containing one column

array with identifiers for reactions in MustUL. This file will only be generated if the user entered printExcel = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName.txt: (file) File containing one column

array with identifiers for reactions in MustUL. This file will only be generated if the user entered printText = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName_Info.xls: (file) File containing one column

array. In each row the user will find a couple of reactions. Each couple of reaction was found in one iteration of FindMustUL.gms. This file will only be generated if the user entered printExcel = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName_Info.txt: (file) File containing one column

array. In each row the user will find a couple of reactions. Each couple of reaction was found in one iteration of FindMustUL.gms. This file will only be generated if the user entered printText = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

findMustUL.lst: (file) file autogenerated by GAMS. It

contains information about equations, variables, parameters as well as information about the running (values at each iteration). This file only will be saved in the output folder is the user entered keepGamsOutputs = 1

GtoMUL.gdx: (file) file containing values for

variables, parameters, etc. which were found by GAMS when solving findMustUL.gms. This file only will be saved in the output folder is the user entered keepInputs = 1

Note

This function is based in the GAMS files written by Sridhar Ranganathan which were provided by the research group of Costas D. Maranas. For a detailed description of the optForce procedure, please see: Ranganathan S, Suthers PF, Maranas CD (2010) OptForce: An Optimization Procedure for Identifying All Genetic Manipulations Leading to Targeted Overproductions. PLOS Computational Biology 6(4): e1000744. https://doi.org/10.1371/journal.pcbi.1000744

findMustUUWithGAMS(model, minFluxesW, maxFluxesW, constrOpt, excludedRxns, mustSetFirstOrder, solverName, runID, outputFolder, outputFileName, printExcel, printText, printReport, keepInputs, keepGamsOutputs, verbose)

This function runs the second step of optForce, that is to solve a bilevel mixed integer linear programming problem to find a second order MustUU set.

USAGE:

[mustUU, pos_mustUU, mustUU_linear, pos_mustUU_linear] = findMustUUWithGAMS(model, minFluxesW, maxFluxesW, varargin)

INPUTS:
model: (structure) a metabolic model with at

least the following fields:

  • .rxns - Reaction IDs in the model

  • .mets - Metabolite IDs in the model

  • .S - Stoichiometric matrix (sparse)

  • .b - RHS of Sv = b (usually zeros)

  • .c - Objective coefficients

  • .lb - Lower bounds for fluxes

  • .ub - Upper bounds for fluxes

minFluxesW: (double array of size n_rxns x 1) minimum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce. E.g.: minFluxesW = [-90; -56];

maxFluxesW: (double array of size n_rxns x 1) maximum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce. E.g.: maxFluxesW = [90; 56];

OPTIONAL INPUTS:
constrOpt: (Structure) structure containing

additional contraints. Include here only reactions whose flux is fixed, i.e., reactions whose lower and upper bounds have the same value. Do not include here reactions whose lower and upper bounds have different values. Such contraints should be defined in the lower and upper bounds of the model. The structure has the following fields:

  • .rxnList - Reaction list (cell array)

  • .values - Values for constrained reactions (double array) E.g.: struct(‘rxnList’, {{‘EX_gluc’, ‘R75’, ‘EX_suc’}}, ‘values’, [-100, 0, 155.5]’);

excludedRxns: (cell array) Reactions to be excluded to

the MustUU set. This could be used to avoid finding transporters or exchange reactions in the set. Default = empty.

mustSetFirstOrder: (cell array) Reactions that belong to

MustU and MustL (first order sets). Default = empty.

solverName: (string) Name of the solver used in

GAMS. Default = ‘cplex’.

runID: (string) ID for identifying this run.

Default = [‘run’ date hour].

outputFolder: (string) name for folder in which

results will be stored. Default = ‘OutputsFindMustUU’.

outputFileName: (string) name for files in which

results. will be stored Default = ‘MustUUSet’.

printExcel: (double) boolean to describe wheter

data must be printed in an excel file or not. Default = 1

printText: (double) boolean to describe wheter

data must be printed in an plaint text file or not. Default = 1

printReport: (double) 1 to generate a report in a

plain text file. 0 otherwise. Default = 1

keepInputs: (double) 1 to mantain folder with

inputs to run findMustUU.gms. 0 otherwise. Default = 1

keepGamsOutputs: (double) 1 to mantain files returned by

findMustUU.gms. 0 otherwise. Default = 1

verbose: (double) 1 to print results in console.

0 otherwise. Default = 0

OUTPUTS:
mustUU: (cell array of size number of sets found X

2) Cell array containing the reactions IDs which belong to the MustUU set. Each row contain a couple of reactions that must decrease their flux.

pos_mustUU: (double array of size number of sets found

X 2) double array containing the positions of each reaction in mustUU with regard to model.rxns

mustUU_linear: (cell array of size number of unique

reactions found X 1) Cell array containing the unique reactions ID which belong to the MustUU Set

pos_mustUU_linear: (double array of size number of unique

reactions found X 1) double array containing positions for reactions in mustUU_linear. with regard to model.rxns

outputFileName.xls: (file) File containing one column

array with identifiers for reactions in MustUU. This file will only be generated if the user entered printExcel = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName.txt: (file) File containing one column

array with identifiers for reactions in MustUU. This file will only be generated if the user entered printText = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName_Info.xls: (file) File containing one column

array. In each row the user will find a couple of reactions. Each couple of reaction was found in one iteration of FindMustUU.gms. This file will only be generated if the user entered printExcel = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName_Info.txt: (file) File containing one column

array. In each row the user will find a couple of reactions. Each couple of reaction was found in one iteration of FindMustUU.gms. This file will only be generated if the user entered printText = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

findMustUU.lst: (file) file autogenerated by GAMS. It

contains information about equations, variables, parameters as well as information about the running (values at each iteration). This file only will be saved in the output folder is the user entered keepGamsOutputs = 1

GtoMUU.gdx: (file) file containing values for

variables, parameters, etc. which were found by GAMS when solving findMustUU.gms. This file only will be saved in the output folder is the user entered keepInputs = 1

Note

This function is based in the GAMS files written by Sridhar Ranganathan which were provided by the research group of Costas D. Maranas. For a detailed description of the optForce procedure, please see: Ranganathan S, Suthers PF, Maranas CD (2010) OptForce: An Optimization Procedure for Identifying All Genetic Manipulations Leading to Targeted Overproductions. PLOS Computational Biology 6(4): e1000744. https://doi.org/10.1371/journal.pcbi.1000744

findMustUWithGAMS(model, minFluxesW, maxFluxesW, varargin)

This function runs the second step of optForce, that is to solve a bilevel mixed integer linear programming problem to find a first order MustU set.

USAGE:

[mustUSet, posMustU] = findMustUWithGAMS(model, minFluxesW, maxFluxesW, varargin)

INPUTS:
model: (structure) a metabolic model with at

least the following fields:

  • .rxns - Reaction IDs in the model

  • .mets - Metabolite IDs in the model

  • .S - Stoichiometric matrix (sparse)

  • .b - RHS of Sv = b (usually zeros)

  • .c - Objective coefficients

  • .lb - Lower bounds for fluxes

  • .ub - Upper bounds for fluxes

minFluxesW: (double array of size n_rxns x 1) minimum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce e.g.: minFluxesW = [-90; -56];

maxFluxesW: (double array of size n_rxns x 1) maximum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce e.g.: maxFluxesW = [90; 56];

OPTIONAL INPUTS:
constrOpt: (Structure) structure containing

additional contraints. Include here only reactions whose flux is fixed, i.e., reactions whose lower and upper bounds have the same value. Do not include here reactions whose lower and upper bounds have different values. Such contraints should be defined in the lower and upper bounds of the model. The structure has the following fields:

  • .rxnList - Reaction list (cell array)

  • .values - Values for constrained reactions (double array) e.g.: struct(‘rxnList’,{{‘EX_gluc’,’R75’,’EX_suc’}},’values’,[-100,0,155.5]’);

solverName: (string) Name of the solver used in GAMS.

Default = ‘cplex’

runID: (string) ID for identifying this run outputFolder: (string) name for folder in which

results will be stored

outputFileName: (string) name for files in which results

will be stored

printExcel: (double) boolean to describe wheter data

must be printed in an excel file or not

printText: (double) boolean to describe wheter data

must be printed in an plaint text file or not

printReport: (double) 1 to generate a report in a

plain text file. 0 otherwise.

keepInputs: (double) 1 to mantain folder with inputs

to run findMustUU.gms. 0 otherwise.

keepGamsOutputs: (double) 1 to mantain files returned by

findMustUU.gms. 0 otherwise.

verbose: (double) 1 to print results in console.

0 otherwise.

OUTPUTS:
mustUSet: (cell array of size number of reactions

found X 1) Cell array containing the reactions ID which belong to the Must_U Set

posMustU: (double array of size number of reactions

found X 1) double array containing the positions of reactions in the model.

outputFileName.xls: (file) File containing one column array

with identifiers for reactions in MustU. This file will only be generated if the user entered printExcel = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName.txt: (file) File containing one column array

with identifiers for reactions in MustU. This file will only be generated if the user entered printText = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName_Info.xls: (file) File containing five column

arrays.

  • C1: identifiers for reactions in MustU

  • C2: min fluxes for reactions according to FVA

  • C3: max fluxes for reactions according to FVA

  • C4: min fluxes achieved for reactions, according to findMustU.gms

  • C5: max fluxes achieved for reactions, according to findMustU.gms

This file will only be generated if the user entered printExcel = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

outputFileName_Info.txt: (file) File containing five column

arrays.

  • C1: identifiers for reactions in MustU

  • C2: min fluxes for reactions according to FVA

  • C3: max fluxes for reactions according to FVA

  • C4: min fluxes achieved for reactions, according to findMustU.gms

  • C5: max fluxes achieved for reactions, according to findMustU.gms

This file will only be generated if the user entered printText = 1. Note that the user can choose the name of this file entering the input outputFileName = ‘PutYourOwnFileNameHere’;

findMustU.lst: (file) file autogenerated by GAMS. It

contains information about equations, variables, parameters as well as information about the running (values at each iteration). This file only will be saved in the output folder is the user entered keepGamsOutputs = 1

GtoMU.gdx: (file) file containing values for

variables, parameters, etc. which were found by GAMS when solving findMustU.gms. This file only will be saved in the output folder is the user entered keepInputs = 1

Note

This function is based in the GAMS files written by Sridhar Ranganathan which were provided by the research group of Costas D. Maranas. For a detailed description of the optForce procedure, please see: Ranganathan S, Suthers PF, Maranas CD (2010) OptForce: An Optimization Procedure for Identifying All Genetic Manipulations Leading to Targeted Overproductions. PLOS Computational Biology 6(4): e1000744. https://doi.org/10.1371/journal.pcbi.1000744

optForceWithGAMS(model, targetRxn, mustU, mustL, minFluxesW, maxFluxesW, minFluxesM, maxFluxesM, k, nSets, constrOpt, excludedRxns, runID, outputFolder, outputFileName, solverName, printExcel, printText, printReport, keepInputs, keepGamsOutputs, verbose)

This function runs the third step of optForce that is to solve a bilevel mixed integer linear programming problem to find sets of interventions that lead to an increased production of a particular target

USAGE:

[optForceSets, posOptForceSets, typeRegOptForceSets, fluxOptForceSets] = optForceWithGAMS(model, targetRxn, mustU, mustL, minFluxesW, maxFluxesW, minFluxesM, maxFluxesM, varargin)

INPUTS:
model: (structure) a metabolic model with at least

the following fields:

  • .rxns - Reaction IDs in the model

  • .mets - Metabolite IDs in the model

  • .S - Stoichiometric matrix (sparse)

  • .b - RHS of Sv = b (usually zeros)

  • .c - Objective coefficients

  • .lb - Lower bounds for fluxes

  • .ub - Upper bounds for fluxes

targetRxn: (string) string containing the ID for the

reaction whose flux is intented to be increased. For E.g., if the production of succionate is desired to be increased, ‘EX_suc’ should be chosen as the target reaction E.g.: targetRxn = ‘EX_suc’;

mustU: (cell array) List of reactions in the MustU

set. This input can be obtained by running the script findMustU.m E.g. mustU = {‘R21_f’;’R22_f’};

mustL: (cell array) List of reactions in the MustL

set. This input can be obtained by running the script findMustL.m E.g. mustL = {‘R11_f’;’R26_f’};

minFluxesW: (double array of size n_rxns x 1) minimum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce. E.g.: minFluxesW = [-90; -56];

maxFluxesW: (double array of size n_rxns x 1) maximum

fluxes for each reaction in the model for wild-type strain. This can be obtained by running the function FVAOptForce. E.g.: maxFluxesW = [90; 56];

minFluxesM: (double array of size n_rxns x 1) minimum

fluxes for each reaction in the model for mutant strain. This can be obtained by running the function FVAOptForce. E.g.: minFluxesM = [-90; -56];

maxFluxesM: (double array of size n_rxns x 1)

Description: Maximum fluxes for each reaction in the model for mutant strain. This can be obtained by running the function FVAOptForce. E.g.: maxFluxesM = [90; 56];

OPTIONAL INPUTS:
k: (double) number of intervations to be

found. Default k = 1;

nSets: (double) maximum number of force sets

returned by optForce. Default nSets = 1;

constrOpt: (Structure) structure containing

additional contraints. Include here only reactions whose flux is fixed, i.e., reactions whose lower and upper bounds have the same value. Do not include here reactions whose lower and upper bounds have different values. Such contraints should be defined in the lower and upper bounds of the model. The structure has the following fields:

  • .rxnList - Reaction list (cell array)

  • .values - Values for constrained reactions (double array) E.g.: struct(‘rxnList’, {{‘EX_gluc’, ‘R75’, ‘EX_suc’}}, ‘values’, [-100, 0, 155.5]’);

excludedRxns: (structure) Reactions to be excluded. This

structure has the following fields

  • .rxnList - Reaction list (cell array)

  • .typeReg - set from which reaction is excluded (char array) (U: Set of upregulared reactions, D: set of downregulared reations, K: set of knockout reactions)

E.g.: excludedRxns = struct(‘rxnList’, {{‘SUCt’, ‘R68_b’}}, ‘typeReg’, ‘UD’) In this E.g. ‘SUCt’ is prevented to appear in the set of upregulated reactions and ‘R68_b’ is prevented to appear in the downregulated set of reactions. Default = empty.

solverName: (string) Name of the solver used in

GAMS. Default = ‘cplex’.

runID: (string) ID for identifying this run.

Default = [‘run’ date hour].

outputFolder: (string) name for folder in which

results will be stored. Default = ‘OutputsFindMustLL’.

outputFileName: (string) name for files in which

results. will be stored Default = ‘MustLLSet’.

printExcel: (double) boolean to describe wheter

data must be printed in an excel file or not. Default = 1

printText: (double) boolean to describe wheter

data must be printed in an plaint text file or not. Default = 1

printReport: (double) 1 to generate a report in a

plain text file. 0 otherwise. Default = 1

keepInputs: (double) 1 to mantain folder with

inputs to run findMustLL.gms. 0 otherwise. Default = 1

keepGamsOutputs: (double) 1 to mantain files returned by

findMustLL.gms. 0 otherwise. Default = 1

verbose: (double) 1 to print results in console.

0 otherwise. Default = 0

OUTPUTS:
optForceSets: (cell array) cell array of size n x m, where

n = number of sets found and m = size of sets found (k). Element in position i, j is reaction j in set i. E.g.

rxn1

rxn2

set 1

R4

R2

set 2

R3

R1

posOptForceSets: (double array) double array of size n x m,

where n = number of sets found and m = size of sets found (k). Element in position i, j is the position of reaction in optForceSets(i, j) in model.rxns E.g.

rxn1

rxn2

set 1

4

2

set 2

3

1

typeRegOptForceSets: (cell array) cell array of size n x m, where

n = number of sets found and m = size of sets found (k). Element in position i, j is the kind of intervention for reaction in optForceSets(i,j) E.g.

rxn1

rxn2

set 1

upregulation

downregulation

set 2

upregulation

knockout

fluxOptForceSets: (double matrix) Matrix of size n + m, where

n = number of sets found and m = size of sets found (k). The number in (i,j) is the flux achieved for the reaction in optForceSets(i, j)

outputFileName.xls: (file) file containing 11 columns.

  • C1: Number of invervetions (k)

  • C2: Set Number

  • C3: Identifiers for reactions in the force set

  • C4: Type of regulations for each reaction in the force set

  • C5: min flux of each reaction in force set, according to FVA

  • C6: max flux of each reaction in force set, according to FVA

  • C7: achieved flux of each of the reactions in the force set after applying the inverventions

  • C8: objetive function achieved by OptForce.gms

  • C9: Minimum flux fot target when applying the interventions

  • C10: Maximum flux fot target when applying the interventions

  • C11: Maximum growth rate when applying the interventions.

In the rows, the user can see each of the optForce sets found.

outputFileName.txt: Same as outputFileName.xls but in a .txt file,

separated by tabs.

optForce.lst: (file) file generated automatically by

GAMS when running optForce. Contains information about the running.

GtoMOF.gdx: (file) file generated by GAMS containing

variables, parameters and equations of the optForce problem.

Note

This function is based in the GAMS files written by Sridhar Ranganathan which were provided by the research group of Costas D. Maranas. For a detailed description of the optForce procedure, please see: Ranganathan S, Suthers PF, Maranas CD (2010) OptForce: An Optimization Procedure for Identifying All Genetic Manipulations Leading to Targeted Overproductions. PLOS Computational Biology 6(4): e1000744. https://doi.org/10.1371/journal.pcbi.1000744