Errors using SteadyCom

68 views
Skip to first unread message

MI

unread,
Dec 17, 2018, 4:26:59 AM12/17/18
to COBRA Toolbox
I have created a community model and want to run SteadyCom functions on it.. When I use

[sol, result] = SteadyComCplex(modelCom, []);

I get the errors as such (using ibm_cplex ver 12.8 with matab R2018a):

Error using sparse
Index into matrix must be positive.

Error in SteadyComCplex>updateLPcom (line 1129)
    S_gr = sparse([1:nSp 1:nSp]', [modelCom.indCom.spBm(:) (n + 1:n + nSp)'],...

Error in SteadyComCplex>constructLPcom (line 831)
A = updateLPcom(modelCom, 0, GRfx, BMcon, [], BMgdw);

Error in SteadyComCplex (line 153)
    [LP,indLP] = constructLPcom(modelCom, options, solverParam);
 

I have also tried this with an older version of ibm_cplex 12.7 and the errors remain the same.. Any help if this is a solver parameter issue??

Siu Hung Joshua Chan

unread,
Dec 20, 2018, 7:49:13 AM12/20/18
to COBRA Toolbox
Hi,

Have you checked modelCom.indCom.spBm? Is there some zeros in there? This probably means that the biomass reaction for some organism is not properly specified. You can add the reaction indices by:

rxnBiomass = (names of the biomass reactions)

rxnBiomassId = findRxnIDs(EcCom, rxnBiomass); % get rxn ids

modelCom.infoCom.spBm = rxnBiomass;
modelCom.indCom.spBm = rxnBiomassId;

See if that works. You can look at the tutorial here:
https://opencobra.github.io/cobratoolbox/stable/tutorials/tutorialSteadyCom.html

MI

unread,
Dec 21, 2018, 2:57:26 AM12/21/18
to COBRA Toolbox
Thankyou that was exactly the mistake.. after adding appropriate biomass reaction IDs it works!
Reply all
Reply to author
Forward
0 new messages