-
Notifications
You must be signed in to change notification settings - Fork 54
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
refactor: remove prefix 'M_' and 'R_' in exprotModel/importModel functions #353
Comments
In principle I support this, but please note the following:
|
It appears that the COBRA function |
Yes, but when COBRA then reads such a model, it removes the prefixes. So when loaded in COBRA there are never such prefixes, but the SBML file can have such prefixes if required. With the proposed changes in Scenario 1: Scenario 2: While scenario 2 breaks compatibility between COBRA and RAVEN by design, as RAVEN will more strictly adhere to the libSBML desire not to use such prefixes as you rightly mentioned in your first page. Scenario 1 however, there you want to prevent writing the invalid SBML file in the first case. While something like |
@edkerk thanks for the detail explanations! I don't have an immediate solution the compatibility issue, and hope to get an ideal way through further discussion. IMHO:
|
This sounds a good idea.
My opinion leans toward not enabling the old behaviour (i.e. break the compatibility).
The idea of having |
To keep the discussion mostly here, I have the following comment on #356, where currently only What about
Above (#353), it was discussed to also deprecate the behaviour of
but also
So changing both
In addition, it would be good to have a |
Yes! My 2 cents: Cobra's design choice to modify the identifiers is not optimal and is affecting everyone, not just us. Rather than worrying about maintaining Raven's compatibility with Cobra, Cobra's design choice should be reported and corrected at source. |
I agree, so let's be consistent then and deprecate the identifier modifications by |
Agree to deprecate the identifier modifications both in
Besides |
We should also check This functionality seems to be a little bit out of scope from |
To my knowledge that would indeed cover all cases, I like the idea of incorporating it in Lines 11 to 12 in 53fe2b7
Lines 64 to 66 in 53fe2b7
|
As discussed in #353, this commit introduce regular expressions for checking whether the IDs are in compliance with libSBML specification.
A section for validating id format with regular expressions is added to Next is to enable |
Not sure if it is necessary for Will try out the new commit soon. |
A more recent concern I'm having is that many models use BiGG IDs that can start with digits. edit: cobrapy also uses prefixes with I/O of SBML files (although not with yml or JSON!). The prefix is really a COBRA-style SBML "feature". Now, if one would load a YML whose identifiers are BiGG IDs (e.g. 6pgc), this model cannot be exported to SBML as So, what if SBML files are still I/O in agreement with the COBRA-style prefixes? Meanwhile, I/O to yml and export to .txt or .xlsx do not add/remove prefixes. Now, the model in MATLAB has the same identifiers as in the yml, txt and xlsx files, while the SBML file is in COBRA-style. Now, the SBML file is handled identically by COBRA and cobrapy. |
There are many different options to handle the exceptions introduced by SBML.
We already know from MetaNetX that prefixed IDs in SBML when they are not needed is bad. Moving forward we would at least have to make this conditional. I'm tempted to go as far as completely dropping support for prefixing model components. For the cases when users need to have prefixes like in the aforementioned BiGG models, they could a) do this themselves or b) do the SBML export with cobratoolbox. |
We can then have default I/O behaviour to leave identifiers untouched, but include a Regardless, if we change the default behaviour of |
Instead of |
But how will it rename those identifiers to make them valid SBML? Will it add the prefixes? In that case, wouldn't it make more sense to then add these prefixes all metabolites/reactions/genes, and basically follow COBRA-style? Would be weird to end up with some hybrid version. What if |
I think this is a pragmatic solution to the long-hanging #360. The occurrence of IDs starting with number (e.g. BiGG met ids) is rather common, and has to be adapted to fit SBML scheme in order to improve the usability of |
…360) * fix: remove prefix 'M_' and 'R_' in exprotModel function (cherry picked from commit 202087d) * fix: remove prefix `c_` and remaining `R_` * feat: add id format check to function `checkModelStruct` As discussed in #353, this commit introduce regular expressions for checking whether the IDs are in compliance with libSBML specification. * refactor: fully runs `checkModelStruct` by default in `exportModel` - Enable throwing errors when running `checkModelStruct` in `exportModel` - Provide informative error message when reporting invalid ids * fix: checkModelStruct more informative warning if identifiers start with number * feat: exportModel COBRAstyle flag, and deprecate exportGeneComplexes flag * fix: exportModel only add G_ if not already there in all genes * feat: dispEM wrap text in command window * fix: importModel has COBRAstyle flag * fix: update tests to match code changes * fix: checkModelStruct rev warning only * doc: exportModel supressWarnings explanation * doc: checkModelStruct warning about met names * fix: exportModel COBRAstyle then checkModelStruct * fix: readYAMLmodel ec.rxnEnzMat empty last row * feat: importModel more detailed SBML error message * fix: checkModelStruct and exportForGit * fix: checkModelStruct metNames check as warning --------- Co-authored-by: Hao Wang <[email protected]> Co-authored-by: Mihail Anton <[email protected]>
Description of the issue:
M_
andR_
are added byexprotModel
function while exporting, and removed byimportModel
while importing. This was initially designed to follow the "yeast consensus network model", which however had been replaced byyeast-GEM
that is no longer exactly using these prefixes.I hereby confirm that I have:
The text was updated successfully, but these errors were encountered: