Microbiome Modelling Toolbox

85 views
Skip to first unread message

Andrea Dell'Olio

unread,
Jul 27, 2022, 5:24:35 AM7/27/22
to COBRA Toolbox
Dear all, 

I was trying to follow the tutorial "microbeMicrobeInteractions" but I encountered an Issue when I try to run the following function:

joinModelsPairwiseFromList(modelList,modPath,'pairwiseModelFolder', resPath,'c',c,'u',u,'mergeGenesFlag',mergeGenes,'numWorkers',numWorkers);

This is the error output I got 

Error using readtable (line 216)
Reading failed at line 7921. All lines of a text file must have the same number of delimiters. Line 7921 has 18 delimiters, while preceding lines have 12.

Note: readtable detected the following parameters:
'HeaderLines', 0, 'Format', '%q%q%q%q%f%q%f%f%q%q%q%D%q'

Error in createMultipleSpeciesModel (line 145)
metaboliteDatabase = readtable('MetaboliteDatabase.txt', 'Delimiter', 'tab','TreatAsEmpty',['UND. -60001','UND. -2011','UND. -62011'], 'ReadVariableNames', false);

Error in joinModelsPairwiseFromList (line 123)
parfor k = i + 1:size(modelList, 1)

Do you have any suggestion on what might cause the problem? I installed all the required packages in Matlab and I have both Gurobi and IBM_CPLEX as available solvers. 

Thanks in advance, 
Kind regards, Andrea. 


Almut Heinken

unread,
Jul 27, 2022, 7:22:29 AM7/27/22
to cobra-...@googlegroups.com
Hi Andrea,
may you check if the COBRA.papers repository is up to date in your installation? The problem is the 'MetaboliteDatabase.txt' file in the papers folder. How did you clone the COBRA Toolbox?
Best regards,
Almut

--

---
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-toolbox/de819045-4ce2-4eee-9f12-3387b59c9698n%40googlegroups.com.

Andrea Dell'Olio

unread,
Jul 27, 2022, 8:05:37 AM7/27/22
to cobra-...@googlegroups.com
Hi Almut! 

Thank you for the swift answer, how can I check if the repo is updated? I just (re) installed cobra toolbox yesterday via git as described in the installation protocol of the cobra website. 

Thanks in advance, regards Andrea 

You received this message because you are subscribed to a topic in the Google Groups "COBRA Toolbox" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cobra-toolbox/SSEYFjyD5bo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cobra-toolbo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-toolbox/CAKy8DrwR%3DA2ukQLpSOnX_9SqPb6E2hXqiKfvszBFvJkULXJJjg%40mail.gmail.com.

Almut Heinken

unread,
Jul 27, 2022, 10:08:27 AM7/27/22
to cobra-...@googlegroups.com
Hi Andrea,
what is the output if you run initCobraToolbox?
You could try navigating to COBRA.papers directly via git and do a git pull.
Best regards,
Almut

Andrea Dell'Olio

unread,
Jul 27, 2022, 10:13:05 AM7/27/22
to cobra-...@googlegroups.com
This is the output of initCobraToolbox. I find strange the last part
in which there is "removing" with folders related to analysis:
Do you think it is related to the issue I encountered?

Kind regards, Andrea.

_____ _____ _____ _____ _____ |
/ ___| / _ \ | _ \ | _ \ / ___ \ | COnstraint-Based
Reconstruction and Analysis
| | | | | | | |_| | | |_| | | |___| | | The COBRA Toolbox - 2022
| | | | | | | _ { | _ / | ___ | |
| |___ | |_| | | |_| | | | \ \ | | | | | Documentation:
\_____| \_____/ |_____/ |_| \_\ |_| |_| |
http://opencobra.github.io/cobratoolbox
|

> Checking if git is installed ... Done (version: 2.37.1).
> Checking if the repository is tracked using git ... Done.
> Checking if curl is installed ... Done.
> Checking if remote can be reached ... Done.
> Initializing and updating submodules (this may take a while)... Done.
> Adding all the files of The COBRA Toolbox ... Done.
> Define CB map output... set to svg.
> TranslateSBML is installed and working properly.
> Configuring solver environment variables ...
- [*---] ILOG_CPLEX_PATH: C:\Program
Files\ibm\ILOG\CPLEX_Studio1210\cplex\matlab\x64_win64
- [*---] GUROBI_PATH: C:\gurobi912\win64\matlab
- [----] TOMLAB_PATH: --> set this path manually after installing
the solver ( see instructions )
- [----] MOSEK_PATH: --> set this path manually after installing
the solver ( see instructions )
Done.
> Checking available solvers and solver interfaces ... 0

0

Check osense*c - A'*lam - w = 0 (stationarity):
0
0


> [gurobi] Primal optimality condition in solveCobraLP satisfied.
> [gurobi] Dual optimality condition in solveCobraLP satisfied.
Version identifier: 12.10.0.0 | 2019-11-26 | 843d4de2ae
CPXPARAM_Output_WriteLevel 3
CPXPARAM_Output_CloneLog -1
Found incumbent of value 0.000000 after 0.00 sec. (0.00 ticks)

Root node processing (before b&c):
Real time = 0.00 sec. (0.00 ticks)
Parallel b&c, 8 threads:
Real time = 0.00 sec. (0.00 ticks)
Sync time (average) = 0.00 sec.
Wait time (average) = 0.00 sec.
------------
Total (root+branch&cut) = 0.00 sec. (0.00 ticks)
Could not find installation of tomlab_cplex, so it cannot be tested
Original LP has 1 row, 2 columns, 1 non-zero
Objective value = 0
OPTIMAL SOLUTION FOUND BY LP PRESOLVER

> [glpk] Primal optimality condition in solveCobraLP satisfied.Could
not find installation of mosek, so it cannot be tested

> [matlab] Primal optimality condition in solveCobraLP satisfied.
--------------------------------------------------------
pdco.m Version pdco5 of 15 Jun 2018
Primal-dual barrier method to minimize a convex function
subject to linear constraints Ax + r = b, bl <= x <= bu

Michael Saunders SOL and ICME, Stanford University
Contributors: Byunggyoo Kim (SOL), Chris Maes (ICME)
Santiago Akle (ICME), Matt Zahr (ICME)
Aekaansh Verma (ME)
--------------------------------------------------------

The objective is linear
The matrix A is an explicit sparse matrix

m = 1 n = 2 nnz(A) = 1
max |b | = 0 max |x0| = 1.0e+00 xsize = 1.0e+00
max |y0| = 1 max |z0| = 1.0e+00 zsize = 1.0e+00

x0min = 1 featol = 1.0e-06 d1max = 1.0e-04
z0min = 1 opttol = 1.0e-06 d2max = 5.0e-04
mu0 = 1.0e-01 steptol = 0.99 bigcenter= 1000

LSMR/MINRES:
atol1 = 1.0e-10 atol2 = 1.0e-15 btol = 0.0e+00
conlim = 1.0e+12 itnlim = 10 show = 0

Method = 2 (1 or 11=chol 2 or 12=QR 3 or 13=LSMR 4 or
14=MINRES 21=SQD(LU) 22=SQD(MA57))
Eliminating dy before dx


Bounds:
[0,inf] [-inf,0] Finite bl Finite bu Two bnds Fixed Free
0 0 0 0 0 2 0
[0, bu] [bl, 0] excluding fixed variables
0 0

Itn mu stepx stepz Pinf Dinf Cinf Objective nf center QR
0 -6.6 -99.0 -Inf 1.2500000e-07 1.0
1 -1.0 1.000 1.000 -99.0 -99.0 -Inf 0.0000000e+00 1 1.0 1
2 -3.0 1.000 1.000 -99.0 -99.0 -Inf 0.0000000e+00 1 1.0
3 -5.0 1.000 1.000 -99.0 -99.0 -Inf 0.0000000e+00 1 1.0
4 -7.0 1.000 1.000 -99.0 -99.0 -Inf 0.0000000e+00 1 1.0
Converged

max |x| = 0.000 max |y| = 0.000 max |z| = 0.000 scaled
max |x| = 0.000 max |y| = 0.000 max |z| = 0.000 unscaled
max |x| and max |z| exclude fixed variables
PDitns = 4 QRitns = 0 cputime = 0.0

Distribution of vector x z
[ 1, 10 ) 0 2
[ 0.1, 1 ) 0 0
[ 0.01, 0.1 ) 0 0
[ 0.001, 0.01 ) 0 0
[ 0.0001, 0.001 ) 0 0
[ 1e-05, 0.0001 ) 0 0
[ 1e-06, 1e-05 ) 0 0
[ 1e-07, 1e-06 ) 0 0
[ 1e-08, 1e-07 ) 0 0
[ 0, 1e-08 ) 2 0
Elapsed time is 0.051388 seconds.

> [pdco] Primal optimality condition in solveCobraLP satisfied.
> [pdco] Dual optimality condition in solveCobraLP satisfied.
Could not find installation of quadMinos, so it cannot be tested
Could not find installation of dqqMinos, so it cannot be tested
Could not find installation of cplex_direct, so it cannot be tested

> [cplexlp] Primal optimality condition in solveCobraLP satisfied.
> [cplexlp] Dual optimality condition in solveCobraLP satisfied.
Could not find installation of tomlab_snopt, so it cannot be tested
Done.
> Setting default solvers ...Could not find installation of mosek, so
it cannot be tested
Done.
> Saving the MATLAB path ... Done.
- The MATLAB path was saved in the default location.

> Summary of available solvers and solver interfaces

Support LP MILP QP MIQP NLP EP
------------------------------------------------------------------------------
gurobi active 1 1 1 1 - -
ibm_cplex active 1 1 1 1 - -
tomlab_cplex active 0 0 0 0 - -
glpk active 1 1 - - - -
mosek active 0 - 0 - - 0
matlab active 1 - - - 1 -
pdco active 1 - 1 - - 1
quadMinos active 0 - - - - -
dqqMinos active 0 - 0 - - -
cplex_direct active 0 0 0 - - -
cplexlp active 1 - - - - -
qpng passive - - 1 - - -
tomlab_snopt passive - - - - 0 -
lp_solve legacy 1 - - - - -
------------------------------------------------------------------------------
Total - 7 3 4 2 1 1

+ Legend: - = not applicable, 0 = solver not compatible or not
installed, 1 = solver installed.


> You can solve LP problems using: 'gurobi' - 'ibm_cplex' - 'glpk' -
'matlab' - 'pdco' - 'cplexlp'
> You can solve MILP problems using: 'gurobi' - 'ibm_cplex' - 'glpk'
> You can solve QP problems using: 'gurobi' - 'ibm_cplex' - 'pdco'
> You can solve MIQP problems using: 'gurobi' - 'ibm_cplex'
> You can solve NLP problems using: 'matlab'
> You can solve EP problems using: 'pdco'

> Checking for available updates ...
> remote.origin.url = https://github.com/opencobra/cobratoolbox.git
.
> currentBranch = master.
> The COBRA Toolbox is up-to-date.
removing: C:\cobratoolbox\src\analysis\thermo\componentContribution\new
removing: C:\cobratoolbox\src\analysis\thermo\groupContribution\new
removing: C:\cobratoolbox\src\analysis\thermo\inchi\new
removing: C:\cobratoolbox\src\analysis\thermo\molFiles\new
removing: C:\cobratoolbox\src\analysis\thermo\protons\new
removing: C:\cobratoolbox\src\analysis\thermo\trainingModel\new

Il giorno mer 27 lug 2022 alle ore 16:08 Almut Heinken
> To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-toolbox/CAKy8DrwVfSUGDZw-WRRKSW_3iE1ehaArHDin0rNooymScudkJA%40mail.gmail.com.

Almut Heinken

unread,
Jul 27, 2022, 10:27:06 AM7/27/22
to cobra-...@googlegroups.com
Hi Andrea,
it seems to be updating the submodules so that looks fine. I am not completely sure though.
Could you try running the command that caused the issue separately:
metaboliteDatabase = readtable('MetaboliteDatabase.txt', 'Delimiter', 'tab','TreatAsEmpty',['UND. -60001','UND. -2011','UND. -62011'], 'ReadVariableNames', false);

Almut Heinken

unread,
Jul 27, 2022, 10:50:37 AM7/27/22
to cobra-...@googlegroups.com
Hi Andrea,
could you try running initCobraToolbox again and then loading the file?
Thanks,
Almut

Andrea Dell'Olio

unread,
Jul 27, 2022, 11:11:37 AM7/27/22
to cobra-...@googlegroups.com
Hi Almut,

There is now a new error:

Error using joinModelsPairwiseFromList (line 103)
Model to load not found in folder!

Actually, I saw that something was uploaded from you since the output of the InitCobraToolbox changed saying that there were some changes.

Kind regards, Andrea



Almut Heinken

unread,
Jul 27, 2022, 11:19:27 AM7/27/22
to cobra-...@googlegroups.com
Hi Andrea,
did you run the tutorial inside the Cobra Toolbox folder? If so, then you probably deleted the saved copy of AGORA by updating. So you have to run the tutorial from the start.
Best regards,
Almut

Andrea Dell'Olio

unread,
Jul 27, 2022, 11:27:13 AM7/27/22
to cobra-...@googlegroups.com
No, I did not run it inside the same folder. I will try to run it again but I can ensure that the agorà folder is in another directory. What I found strange Is that I tried to clone the cobra toolbox in another directory of my computer (without deleting the  first I cloned) and the paper folder is completely empty. Do you have any clue why this happen? By the way I will run it again and let you know the outcome. 

Kind regards, Andrea. 



Almut Heinken

unread,
Jul 27, 2022, 11:33:45 AM7/27/22
to cobra-...@googlegroups.com
Hi Andrea,
the papers folder should get populated when the submodules are updated through initCobraToolbox. I hope everything will work now.
Best regards,
Almut

Andrea Dell'Olio

unread,
Jul 27, 2022, 11:35:17 AM7/27/22
to cobra-...@googlegroups.com
Ok clear. Should I also reclone the agorà folder? Because for now I’m skipping this passage since I though the folder was the same. 

Kind regards, Andrea. 

Andrea Dell'Olio

unread,
Jul 27, 2022, 11:50:11 AM7/27/22
to cobra-...@googlegroups.com
Update: Now the problem looks solved since the algorithm is proceeding
further not giving the previous error. Thank you so much for you
effort and help. Have a good evening.
(I will update you if I can finish the tutorial smoothly)


Kind regards, Andrea.

Il giorno mer 27 lug 2022 alle ore 17:33 Almut Heinken
> To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-toolbox/CAKy8DrzbX66WLWpbQi-oe6HjXd7MqreUsN98ZJpFt8LHZH0q5w%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages