cobratoolbox icon indicating copy to clipboard operation
cobratoolbox copied to clipboard

Excel Import Example doesn't work

Open hbsmith opened this issue 3 years ago • 3 comments

Please include a short description of problem here I'm trying to figure out how to correctly load an excel file into and cobra model, so I checked the documentation here: https://opencobra.github.io/cobratoolbox/stable/modules/base/io/utilities/index.html?highlight=parseSBMLAnnotationField#src.base.io.utilities.xls2model

Both that documentation, and this page on the excel formatting (https://github.com/opencobra/cobratoolbox/blob/master/docs/source/notes/ExcelModelFileDefinition.md) direct to this example excel spreadsheet: https://github.com/opencobra/cobratoolbox/tree/master/docs/source/examples

However, when trying to import that excel spreadsheet, one gets the error: Error using xls2model (line 320) Not all metabolites could be matched

However, the cobra_import_toy_model.xlsx found in the tests (https://github.com/opencobra/cobratoolbox/tree/master/test/verifiedTests/base/testXls2Model) works.

This appears to be an issue with the documentation and example.

I hereby confirm that I have:

  • [x ] Tried to solve the issue on my own
  • [x ] Retried to run my code with the latest version of The COBRA Toolbox
  • [x ] Checked that a similar issue has not already been opened

(Note: You may replace [ ] with [X] to check the box)

hbsmith avatar May 11 '21 07:05 hbsmith

Hi, The example file is just for for the headers. Yes, this file does not load since it is missing Metabolites, and thus the model cannot be created properly, but it contains all the information on how the file has to be formatted (i.e. what kind of fields/headers) are allowed. If you want it to load you can simply add: atp[c] adp[c] dhap[c] fdp[c] g3p[c] g6p[c] h[c] in the first column of the Metabolites sheet (after the glucose). Then the file loads but the model will only have proper annotations/information on glucose.

tpfau avatar May 11 '21 09:05 tpfau

Hi @tpfau , thanks, I realize that it contains the possible headers, but nonetheless find it confusing that the example file referenced in the docs would be invalid by the function referencing it. I would simply suggest that those metabolites be added to the example file for others like me who might be looking for a working example when trying to troubleshoot their own issues loading models.

hbsmith avatar May 11 '21 10:05 hbsmith

Dear Ms/Mr Smith,

might I suggest that you open up a pull request with a revised xlsx file so that the function model = xls2model('ExcelExample.xlsx'); runs without issue?

It would be nice to see end users contributing more, once they identify an issue needing improvement.

Regards,

Ronan

On Tue, 11 May 2021 at 11:17, hbsmith @.***> wrote:

Hi @tpfau , thanks, I realize that it contains the possible headers, but nonetheless find it confusing that the example file referenced in the docs would be invalid by the function referencing it. I would simply suggest that those metabolites be added to the example file for others like me who might be looking for a working example when trying to troubleshoot their own issues loading models.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

--

Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.

Assistant Professor, Division of Systems Biomedicine and Pharmacology, Leiden Academic Centre for Drug Research, Faculty of Science, Leiden University. https://www.universiteitleiden.nl/en/staffmembers/ronan-fleming & H2020 Project Coordinator, Systems Medicine of Mitochondrial Parkinson’s Disease, http://sysmedpd.eu & Senior Lecturer, School of Medicine, National University of Ireland, Galway.

Peer-reviewed publications: https://goo.gl/FZPG23 Mobile: +353 852 109 806 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.)

rmtfleming avatar May 11 '21 10:05 rmtfleming