Open shumantov opened 3 years ago
I am pretty sure you have invalid SBML identifiers in your model. Identifiers are not allowed which start with numbers. So the 5drib_c
is very likely an invalid identifier. You could try to read the model without replacements of identifiers, i.e. set the argument f_replace = None
in the read_sbml_model
.
You can validate the model using other tools such as sbmlutils
. Just let me know if you need support here.
Hi matthiaskoenig, Thank you for your response!
What exactly does it mean that my Identifiers are invalid? Does this related exclusively to the tool generating the models? And, is there a way to remove those identifiers, or to modify them, so they will be valid?
I've tried setting f_replace = None, and the key error is different, yet still present: KeyError: 'M_5drib_c'
instead of:
KeyError: '5drib_c'
The rest is similar:
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 http://sbml.org/validator .
(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 .
So it still doesn't work.
I would love some support!
Do you see a way I can make this particular community model to be read?
Or maybe do you know a different tool, for the creation of community models? Again, I've been using carveme, which is OK as far as I know, but I'm open for other ideas if you have any, since this is quite crucial for my work.
Thank you again.
Alon
SBML identifiers must follow a certain syntax, e.g. are not allowed to start with numbers or have special characters.
This has many advantages, among others they can be used as variable names. Often these conditions are not fullfilled so tools are doing replacements on the identifiers (e.g. adding M_
prefixes to the identifiers) to get valid identifiers.
Some people thought it is a good idea to try to do back-replacements on the SBML import in cobrapy, e.g. removing prefixes and replacing special characters. I am strongly opposed to that because it breaks things all over the place. Basically half the issues on the cobrapy issue tracker are due to the replacements on model import! This includes things like invalid CPLEX and GUROBI variable names up to completely confused users who cannot find there SBML species because the ids changed. If I had one wish free for cobrapy it would be stopping id replacements on import/export.
In your case your model is most likely invalid and misses certain elements. I would run the SBML validation on it to see what is broken in the model.
Did you figure out to resolve this issue?
Hi all,
I've created a community model for 156 genomes using carveme, and it's not being read by cobra. This is the error I get:
This model is too big for sbml validator to validate, and also the cobra validation does not work (throws the same error), so I'm not sure whether there is something wrong with the model itself, maybe its size, or with cobra trying to read it. any ideas for how should I handle this?
Your help regarding this issue would be much appreciated!
Alon