unable to load a model in excel into matlab cobratoolbox

352 views
Skip to first unread message

are

unread,
May 9, 2018, 7:52:19 AM5/9/18
to COBRA Toolbox
Dear All, 

I am trying to load into Matlab CobraToolbox a model that I gathered in excel format. 
Enclosed you might find the two excel files reporting respectively the reaction and metabolite lists. 
I included also the single file excel containing the two aforementioned sheets. 

The headers of the sheets respect the example files I found in Github documentation.

I tried to use the following functions: 

model = xls2model('Rxns.xls','Mets.xls');
model = xlsread('Stoichiometric_model_according_to_guidelines.xls');
model = readCbModel('Stoichiometric_model_according_to_guidelines.xls');
model = readCbModel('Stoichiometric_model_according_to_guidelines.xls','fileType','Excel');

All these options failed. The error message states: 
Excel is installed.

Error using fprintf
Invalid file identifier.  Use fopen to generate a valid file identifier.

Error in xls2model (line 102)
        fprintf(strrep(sheets, '\', '\\'));


I am using R2017b on Windows.

I can't understand how to load the reconstruction into a model Might you kindly suggest solutions plaese?

Thank you
Best regards
Angela




Mets.xls
Rxns.xls
Stoichiometric_model_according_to_guidelines.xlsx

Laurent Heirendt

unread,
May 9, 2018, 10:34:19 AM5/9/18
to COBRA Toolbox
Hi Angela,

It seems as if the model format is not correct. You do not have 2 sheets as required, but 2 files. The correct format is given here: https://github.com/opencobra/cobratoolbox/blob/master/docs/source/examples/ExcelExample.xlsx

Please find attached the one for your specific model, which you can import using:

>> readCbModel('20180509_model_forum.xlsx')

Not all metabolites could be matched, so you may want to have a look at that.

Best,

Laurent
20180509_model_forum.xlsx
Reply all
Reply to author
Forward
0 new messages