readCbModel()
verifyModel()
[vSparse, sparseRxnBool, essentialRxnBool] = sparseFBA(model,'max',1,1,'all',1)
>> feasTol = getCobraSolverParams('LP', 'feasTol')
feasTol =
1.0000e-09
>> minInf = -1000;maxInf = 1000;printConstraints(model, minInf, maxInf);MinConstraints:EX_xyl__D_e -1EX_ac_e -3maxConstraints:>> osenseStr='max';>> minNorm='zero'
minNorm =
zero
>> sparseFBAsolution = optimizeCbModel(model, osenseStr, minNorm)
sparseFBAsolution =
struct with fields:
full: [115×1 double] obj: 3.3333 rcost: [] dual: [] slack: [92×1 double] solver: 'gurobi' algorithm: 'default' stat: 1 origStat: 'OPTIMAL' time: 0.0400 basis: [1×1 struct] f: 3.3333 x: [115×1 double] v: [115×1 double] w: [] y: [] s: [92×1 double]
>> v = sparseFBAsolution.v
v =
0 0 0 0 0 0 -1.0000 1.0000 0 1.0000 1.0000 0 -0.3333 -0.3333 0.3333 0.3333 0.3333 0 0 0 0 0 0 0.6667 0.6667 0.6667 1.6667 -1.6667 -1.6667 1.6667 1.6667 0 0 0 0 0.5556 -0.5556 0 1.6667 0.5556 0.5556 0.5556 0.5556 0 0 0 0 0 0.5556 0.5556 0.5556 0.5556 0 0 0 0 0 0.5556 0.5556 0.5556 0.5556 0 0 0.5556 -0.5556 0.5556 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3.3333 1.6667 -1.6667 1.6667 0 0 -1.6667 1.6667 3.3333
>> nonZeroFlag = 1;printFluxVector(model, v, nonZeroFlag);EX_xyl__D_e -1XYLt 1XYLI1 1XYLK 1RPE -0.3333RPI -0.3333TKT1 0.3333TALA 0.3333TKT2 0.3333PFK 0.6667FBA 0.6667TPI 0.6667GAPD 1.667PGK -1.667PGM -1.667ENO 1.667PYK 1.667ACtr 0.5556EX_ac_e -0.5556PFOR 1.667ACACT1r 0.5556HACD1 0.5556ECOAH1 0.5556EBACD1 0.5556ACACT2 0.5556HACD2 0.5556ECOAH2 0.5556EBACD2 0.5556ACACT3 0.5556HACD3 0.5556ECOAH3 0.5556EBACD3 0.5556CoATC8 0.5556octat -0.5556EX_octa_e 0.5556RNF1 3.333ATPS4r 1.667H2Ot -1.667EX_h2o_e 1.667co2t -1.667EX_co2_e 1.667ATP_Hydrolysis 3.333>> fprintf('%u%s\n',nnz(v),' active reactions in the sparse flux balance analysis solution.');42 active reactions in the sparse flux balance analysis solution.>> [c,S,b,lb,ub,csense] = deal(model.c,model.S,model.b,model.lb,model.ub,model.csense);[m,n] = size(S);LPproblem = struct('c',c,'osense',-1,'A',S,'csense',csense,'b',b,'lb',lb,'ub',ub);>> LPsolution = solveCobraLP(LPproblem);if LPsolution.stat == 1vFBA = LPsolution.full(1:n);elsevFBA = [];error('FBA problem error!')end>> fprintf('%u%s\n',nnz(vFBA),' active reactions in the flux balance analysis solution.')38 active reactions in the flux balance analysis solution.>> approximations = {'cappedL1','exp','log','SCAD','lp-','lp+'};>> constraint.A = [S ; c'];constraint.b = [b ; c'*vFBA];constraint.csense = [csense;'E'];constraint.lb = lb;constraint.ub = ub;>> bestResult = n;bestAprox = '';for i=1:length(approximations)solution = sparseLP(char(approximations(i)),constraint);if solution.stat == 1nnzSol=nnz(abs(solution.x)>feasTol);fprintf('%u%s%s',nnzSol,' active reactions in the sparseFBA solution with ', char(approximations(i)));if bestResult > nnzSolbestResult=nnzSol;bestAprox = char(approximations(i));solutionL0 = solution;endendendError using sparseLP (line 95)Error:LHS matrix is not defined
Error using sparseLP (line 95)Error:LHS matrix is not defined
--
---
You received this message because you are subscribed to the Google Groups "COBRA Toolbox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cobra-toolbo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.