Error importing KBase SBML model in COBRA Toolbox

10 views
Skip to first unread message

Panji Ilahi Halomoan Banurea

unread,
Oct 26, 2025, 10:38:27 PM (4 days ago) Oct 26
to COBRA Toolbox

Hello everyone,

I am new to MATLAB and COBRA Toolbox, and I am trying to load an SBML model

exported from KBase into COBRA.

Here is the code I used:

>>initCobraToolbox(false);

changeCobraSolver('gurobi','LP',1);

 

>>fileName = 'D:\Shared\Lab\Methylocystis_NC52PC_rumen.gbk_genome.mdl.xml';

modelOri = readCbModel(fileName)

 

But I am getting the following error message:
Error using  :
Colon operands must be real scalars.

Error in
getDefinedFieldProperties (line 90)
        for i = 1:size(relarray)
                 ^
Error in
getDatabaseMappings (line 38)
mappings = getDefinedFieldProperties('Database',true);
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in
mapAnnotationsToFields (line 46)
knownMappings = getDatabaseMappings(field);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in
readSBML (line 122)
        model = mapAnnotationsToFields(model,databases,identifiers,qualifiers,'met');
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in
readCbModel (line 211)
        model = readSBML(fileName,defaultBound);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

My setup:

- MATLAB R2025b

- COBRA Toolbox 0.30.0

- Windows 11

 

I’m not sure what I did wrong. I would really appreciate any guidance or suggestions.

Best regards,
Banurea

Farid Zare

unread,
Oct 29, 2025, 11:26:48 AM (yesterday) Oct 29
to cobra-...@googlegroups.com
Dear Panji,
Please send me the SBML model that you are working on so that I can reproduce the error and see what the problem is.
Regards,
Farid
--
Farid Zare MSc
-----------------------------------------------------
Ph.D. Student at the University of Galway, Ireland
LinkedIn: farid-zare
GitHub: farid-zare
GitLab: farid-zare


--

---
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 visit https://groups.google.com/d/msgid/cobra-toolbox/aac82b53-fc2e-4de0-991c-e3128f6a458bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages