Exporting the stoichiometric matrix

24 views
Skip to first unread message

Tiago Roseiro

unread,
Jun 1, 2017, 12:19:26 PM6/1/17
to COBRA Toolbox
Hello!

I was wondering if anyone knows how to easily export the stoichiometric matrix (model.S) to a txt file? I thought I could use the command 'writeCbModel(model.S, 'txt') ' but it doesn't work... 

Thank you very much,
Tiago 

Laurent Heirendt

unread,
Jun 1, 2017, 1:46:35 PM6/1/17
to COBRA Toolbox
Hi Tiago,

If you only want to print the stoichiometric matrix S to a text file, try:

printMatrix(full(model.S), '%6.4f\t', 'matrixS.txt')

Please let me know if this helps.

Best,

Laurent

Tiago Roseiro

unread,
Jun 1, 2017, 2:16:24 PM6/1/17
to COBRA Toolbox
Hi Laurent,

Thank you for your reply! The command does work and I'm able to print the stoichiometric matrix into a text file but I'm not sure it will work as input to the solver I'm using. Do you know what do I have to change in the command you wrote in order to get a similar result as the file I'm sending you attached?

Thank you!,
Tiago 
Smat_y.txt

Ronan M.T. Fleming

unread,
Jun 1, 2017, 2:31:17 PM6/1/17
to COBRA Toolbox
Hi Tiago,
what solver are you using? e.g. we already export to .mps format.
Regards,
Ronan

--

---
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-toolbox+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--
--
Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.
----------------------------------------------------------------------------
Senior research associate (EN) == Chercheur (FR),
Principal investigator,
Systems Biochemistry Group,
wwwen.uni.lu/lcsb/research/systems_biochemistry
Luxembourg Centre for Systems Biomedicine,
University of Luxembourg,
Campus Belval,
6, avenue du Swing,
L-4367 Belvaux.
&
National Centre of Excellence in Research on Parkinson’s disease
www.parkinson.lu
&
Adjunct Assistant Professor,
Division of Analytical Biosciences,
Leiden Academic Centre for Drug Research,
Faculty of Science,
University of Leiden.
http://analyticalbiosciences.leidenuniv.nl
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Mobile:  +352 621 175 112
Office: +352 466 644 5528
Skype: ronan.fleming
----------------------------------------------------------------------------
(This message is confidential and may contain privileged information. It is intended for the named recipient only. If you receive it in error please notify me and permanently delete the original message and any copies.)

Tiago Roseiro

unread,
Jun 1, 2017, 2:44:53 PM6/1/17
to COBRA Toolbox, ronan.mt...@uni.lu
Hi Ronan,

I'm using SCIP (PolySCIP) solver to perform a bi objetive optimization problem.

Best,
Tiago
To unsubscribe from this group and stop receiving emails from it, send an email to cobra-toolbo...@googlegroups.com.

Ronan M.T. Fleming

unread,
Jun 1, 2017, 2:51:20 PM6/1/17
to COBRA Toolbox
Hi Tiago,
SCIP is accessible via the opti interface, e.g, via
Regards,
Ronan

To unsubscribe from this group and stop receiving emails from it, send an email to cobra-toolbox+unsubscribe@googlegroups.com.

Tiago Roseiro

unread,
Jun 1, 2017, 4:38:39 PM6/1/17
to COBRA Toolbox, ronan.mt...@uni.lu
Hi Ronan,

I wasn't aware of that. I was able to export the matrix as I intended anyway. Nevertheless, thank you for the information!

Best,
Tiago

Tiago Roseiro

unread,
Jun 1, 2017, 4:39:39 PM6/1/17
to COBRA Toolbox
Hi Laurent,

I was able to export the matrix as I intend using the following command:

dlmwrite('matrixxx.txt',full(model.S),'delimiter',' ','newline', 'pc');

Nevertheless thank you very much for your help!

Best,
Tiago

quinta-feira, 1 de Junho de 2017 às 18:46:35 UTC+1, Laurent Heirendt escreveu:

Ronan M.T. Fleming

unread,
Jun 1, 2017, 5:03:41 PM6/1/17
to COBRA Toolbox
Hi Tiago,
I'd go via opti, because the code will also read the SCIP results back in when it is done.
Regards,
Ronan

--

---
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-toolbox+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages