randomObjFBASol

PURPOSE ^

randomObjFBASol Solves an FBA problem with a random objective function

SYNOPSIS ^

function x0 = randomObjFBASol(model,initArgs)

DESCRIPTION ^

randomObjFBASol Solves an FBA problem with a random objective function

 x0 = randomObjSol(model,initArgs)

INPUTS
 model             COBRA model structure
 initArgs          Cell array containing the following data:
   {1}osenseStr      Maximize ('max')/minimize ('min')
   {2}minObjFrac     Minimum initial objective fraction
   {3}minObjValue    Minimum initial objective value (opt)
                     (Default = minObjFrac*sol.f)

 Markus Herrgard

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function x0 = randomObjFBASol(model,initArgs)
0002 %randomObjFBASol Solves an FBA problem with a random objective function
0003 %
0004 % x0 = randomObjSol(model,initArgs)
0005 %
0006 %INPUTS
0007 % model             COBRA model structure
0008 % initArgs          Cell array containing the following data:
0009 %   {1}osenseStr      Maximize ('max')/minimize ('min')
0010 %   {2}minObjFrac     Minimum initial objective fraction
0011 %   {3}minObjValue    Minimum initial objective value (opt)
0012 %                     (Default = minObjFrac*sol.f)
0013 %
0014 % Markus Herrgard
0015 
0016 osenseStr = initArgs{1};
0017 minObjFrac = initArgs{2};
0018 
0019 if (length(initArgs) < 3)
0020     solOpt = optimizeCbModel(model,osenseStr);
0021     model.lb(model.c==1) = minObjFrac*solOpt.f;
0022 else
0023     model.lb(model.c==1) = initArgs{3};
0024 end
0025 
0026 nRxns = length(model.rxns);
0027 
0028 model.c = rand(nRxns,1)-0.5;
0029 sol = optimizeCbModel(model,osenseStr);
0030 x0 = sol.x;

Generated on Thu 21-Jun-2012 15:39:23 by m2html © 2003