Closed uliebal closed 2 years ago
Hi @uliebal,
this is a known issue with cobrapy, please see discussion in https://github.com/opencobra/cobrapy/issues/609.
The only workaround for now is to use ids with <256 characters. So you should rename the affected id(s). As a side note, I highly recommend to do this, because many tools will fail with such long ids. If you need help finding the ids in questions let me know and provide the model.
Best Matthias
thanks @matthiaskoenig !
Due to the special characters in my reaction names the conversion to SBML generated long ids. While I did not find the culprits, I just replaced the very complex reaction names that contain /
with the one-liner below. Because the shortened ids are non-unique, I also added a reaction count to the end of the new id:
[setattr(my, 'id', my.id.split('/')[0]+str(idx)) for idx, my in enumerate(model.reactions) if '/' in my.id]
With that correction alone fbc_curation works.
Hi @uliebal,
this is a known issue with cobrapy, please see discussion in opencobra/cobrapy#609.
The only workaround for now is to use ids with <256 characters. So you should rename the affected id(s). As a side note, I highly recommend to do this, because many tools will fail with such long ids. If you need help finding the ids in questions let me know and provide the model.
Best Matthias
Hye Matthias,
I'm sorry to bother you, i've got the same problem than @uliebal
(first the same problem of invalid characters than #964 then i saw you advice in #955 so i read the model with f_replace={} but now it's the long ids problem's.)
I wanted to know how to find the ids in questions (cause i will have 2 model to "cure") but let me share you one of my model
model_41.zip
Thank you a lot for all the help that you provide here.
my model raises an cobra_error although the model works nicely in cobrapy and is valid SBML according to the validator (just 3722 warnings). cameo=0.13.6 and cobra=0.23.0. The fbc_curation tests and another of my models are fine.