Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when using optforce #62

Open
yut8920 opened this issue Nov 8, 2019 · 4 comments
Open

error when using optforce #62

yut8920 opened this issue Nov 8, 2019 · 4 comments

Comments

@yut8920
Copy link

yut8920 commented Nov 8, 2019

Dear all,
I want to find some interventions applied to a strain by using optforce.The model I used is iJO1366 of E.coli,and the objective is trptophan.It is successful.But when I change the objective to lysine,it shows some errors when I run '[mustLSet, pos_mustL] = findMustL(model, minFluxesW, maxFluxesW, 'constrOpt', constrOpt, 'runID', runID, 'outputFolder', 'OutputsFindMustL', 'outputFileName', 'MustL' , 'printExcel', 1, 'printText', 1, 'printReport', 1, 'keepInputs', 1, 'printLevel', 3)'.

The error is:

Operands to the || and && operators must be convertible to logical scalar values.

Error in changeObjective (line 39)
if (isempty(rxnID) || rxnID == 0)

Error in findMustL (line 297)
model2 = changeObjective(model, model.rxns(pos_actives));
I wonder what cause it?
Thanks!

@fromseto
Copy link

@yut8920 Can you provide more information for us to debug the issue?

  • What is the parameter "pos_actives" you defined in line 297?
  • What is the rxnID in changeObjective (line 39)?

@yut8920
Copy link
Author

yut8920 commented Nov 15, 2019

@fromseto I use optforce according to the tutorial in cobratoolbox.

  • The parameter "rxnID" can be found in changeObjective.m file and rxnID = findRxnIDs(model,rxnNameList).

  • The parameter "pos_actives" can be found in findMustL.m file and I never define it.The error happend due to there is no solution.Because the pos_actives = find(MustLSol.int) when there is a solution and the MustLSol = solveCobraMILP(bilevelMILPproblem, 'printLevel', printLevel).

I put my runing code and model file in supplyment.
supplyment.zip

@fromseto
Copy link

I ran your code just now and the no error occurred on my computer. I have attached the output folder. Can you use the file to compare with the files you generated to check the error?
Test_lys.zip

@yut8920
Copy link
Author

yut8920 commented Nov 15, 2019

I ran my code again,but the same error happend.
I compared these files just now and found there is no difference between the InputsMustU.But there are many differences between the two CobraMILPSolver files.I have attached the comparisonReport.I don't know what cause it.Maybe it is difficult to find the reason.
comparisonReport.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants