Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] I can not open validated model for pseudomonas putida #1430

Open
1 task done
AnnyMais03 opened this issue Mar 14, 2025 · 6 comments
Open
1 task done

[BUG] I can not open validated model for pseudomonas putida #1430

AnnyMais03 opened this issue Mar 14, 2025 · 6 comments
Labels
needs information Lacks requires information or a reproducible example to be addressed.

Comments

@AnnyMais03
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

No response

Code sample

Code run:

```import cobra

model = cobra.io.read_sbml_model('pathtomodell/iJN1462.xml')  
Traceback:

```text

Environment

Anything else?

No response

@AnnyMais03 AnnyMais03 added the bug label Mar 14, 2025
@AnnyMais03
Copy link
Author

I can not open the pseudomonas model found in this publication : https://pmc.ncbi.nlm.nih.gov/articles/PMC7078882/#sec15

@Midnighter
Copy link
Member

I have personally used that model so I know it's possible.

Please provide more information like the error so that we can help you diagnose the problem.

@Midnighter Midnighter added needs information Lacks requires information or a reproducible example to be addressed. and removed bug labels Mar 14, 2025
@AnnyMais03
Copy link
Author


CobraSBMLError Traceback (most recent call last)
File c:\Users\s233539\AppData\Local\anaconda3\envs\hemicellulosumAnnie\lib\site-packages\cobra\io\sbml.py:458, in read_sbml_model(filename, number, f_replace, **kwargs)
457 doc = _get_doc_from_filename(filename)
--> 458 return _sbml_to_model(doc, number=number, f_replace=f_replace, **kwargs)
459 except IOError as e:

File c:\Users\s233539\AppData\Local\anaconda3\envs\hemicellulosumAnnie\lib\site-packages\cobra\io\sbml.py:655, in _sbml_to_model(doc, number, f_replace, set_missing_bounds, **kwargs)
652 for (
653 compartment
654 ) in model.getListOfCompartments(): # noqa: E501 type: libsbml.Compartment
--> 655 cid = _check_required(compartment, compartment.getIdAttribute(), "id")
656 compartments[cid] = compartment.getName()

File c:\Users\s233539\AppData\Local\anaconda3\envs\hemicellulosumAnnie\lib\site-packages\cobra\io\sbml.py:1607, in _check_required(sbase, value, attribute)
1606 msg += f" with metaId '{sbase.getName()}'"
-> 1607 raise CobraSBMLError(msg)
1608 if attribute == "id" and not libsbml.SyntaxChecker.isValidSBMLSId(value):

CobraSBMLError: Required attribute 'id' cannot be found or parsed in ''.

The above exception was the direct cause of the following exception:

CobraSBMLError Traceback (most recent call last)
Cell In[7], line 4
1 import cobra
3 # Load your model (replace 'path_to_your_model.xml' with the actual model file path)
----> 4 model = cobra.io.read_sbml_model('O:/Public/Marauders-Map/Anny Mais - project/Master Thesis/Model/iJN1462.xml')

File c:\Users\s233539\AppData\Local\anaconda3\envs\hemicellulosumAnnie\lib\site-packages\cobra\io\sbml.py:472, in read_sbml_model(filename, number, f_replace, **kwargs)
462 except Exception as original_error:
463 cobra_error = CobraSBMLError(
464 "Something went wrong reading the SBML model. Most likely the SBML"
465 " model is not valid. Please check that your model is valid using "
(...)
470 "at https://github.com/opencobra/cobrapy/issues ."
471 )
--> 472 raise cobra_error from original_error

CobraSBMLError: Something went wrong reading the SBML model. Most likely the SBML model is not valid. Please check that your model is valid using the cobra.io.sbml.validate_sbml_model function or via the online validator at https://sbml.org/validator_servlet/ .
(model, errors) = validate_sbml_model(filename)
If the model is valid and cannot be read please open an issue at https://github.com/opencobra/cobrapy/issues .

@Midnighter
Copy link
Member

Sorry, I must have worked with a previous version of the model. I get the following SBML errors with the model:

E0 (Error): SBML component consistency (fbc, L32551); Charge must be integer; The value of attribute 'fbc:charge' on SBML object must be of the data type integer.

E1 (Error): SBML component consistency (fbc, L32562); Charge must be integer; The value of attribute 'fbc:charge' on SBML object must be of the data type integer.

E2 (Error): SBML component consistency (fbc, L32573); Charge must be integer; The value of attribute 'fbc:charge' on SBML object must be of the data type integer.

E3 (Error): SBML component consistency (fbc, L32584); Charge must be integer; The value of attribute 'fbc:charge' on SBML object must be of the data type integer.

E4 (Error): SBML component consistency (fbc, L32595); Charge must be integer; The value of attribute 'fbc:charge' on SBML object must be of the data type integer.

E5 (Error): SBML component consistency (fbc, L32617); Charge must be integer; The value of attribute 'fbc:charge' on SBML object must be of the data type integer.

E6 (Error): SBML component consistency (core, L33325); Missing value for the 'compartment' attribute; The 'compartment' attribute in a is mandatory. A definition in a model must include a value for this attribute.
Reference: L3V1 Section 4.6.3
The with the id 'M_acmtsoxin_e' is missing the 'compartment' attribute.

E7 (Error): SBML component consistency (core, L33336); Missing value for the 'compartment' attribute; The 'compartment' attribute in a is mandatory. A definition in a model must include a value for this attribute.
Reference: L3V1 Section 4.6.3
The with the id 'M_acmtsoxin_p' is missing the 'compartment' attribute.

E8 (Error): SBML component consistency (core, L17); Invalid attribute found on Compartment object; A Compartment object must have the required attributes 'id' and 'constant', and may have the optional attributes 'metaid', 'sboTerm', 'name', 'spatialDimensions', 'size' and 'units'. No other attributes from the SBML Level 3 Core namespace are permitted on a Compartment object.
Reference: L3V1 Section 4.5
The required attribute 'id' is missing.

E9 (Error): SBML component consistency (core, L33105); Missing value for the 'compartment' attribute; The 'compartment' attribute in a is mandatory. A definition in a model must include a value for this attribute.
Reference: L3V1 Section 4.6.3
The with the id 'M_acmtsoxin_e' is missing the 'compartment' attribute.

E10 (Error): SBML component consistency (core, L33116); Missing value for the 'compartment' attribute; The 'compartment' attribute in a is mandatory. A definition in a model must include a value for this attribute.
Reference: L3V1 Section 4.6.3
The with the id 'M_acmtsoxin_p' is missing the 'compartment' attribute.

As well as one COBRApy error that you also discovered.

Required attribute 'id' cannot be found or parsed in ''.

And as the SBML error E8 also lists, there is indeed a missing id.

    <listOfCompartments>
      <compartment constant="true" id="Cytosol" name=""/>
      <compartment constant="true" id="Extra_organism" name=""/>
      <compartment constant="true" id="Periplasm" name=""/>
      <compartment constant="true" id="" name=""/>
    </listOfCompartments>

So at least the model file in the supplements is not valid SBML. I suggest that you contact the authors.

@matthiaskoenig
Copy link
Contributor

The model is not valid SBML, i.e. broken. The issues are easy to fix, but should probably be done by the authors and they should provide a valid model. Personally, I can't understand a publication called "High‐quality genome‐scale metabolic modelling of Pseudomonas putida" does not even provide a valid file.

Image

@AnnyMais03
Copy link
Author

Thank you both I will contact the authros

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs information Lacks requires information or a reproducible example to be addressed.
Projects
None yet
Development

No branches or pull requests

3 participants