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

Metabolite mismatching for databases that use numerical IDs #6

Open
VictorShima opened this issue Oct 31, 2024 · 1 comment
Open

Metabolite mismatching for databases that use numerical IDs #6

VictorShima opened this issue Oct 31, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@VictorShima
Copy link

Hello, I stumbled on a surprising interaction that I wanted to show.

I'm using a model generated with AutoKeggRec and the way the model is constructed leads to mergem to consider a H2O metabolite as "calcein am".

AutoKeggRec constructs a model where metabolites have names like "C00001[c]" (notice the KEGG ID with compartments in square brackets). In addition to this ID, the metabolites usually contain a single annotation for pubchem.

For water, the annotation is {pubchem:"3303"} which overlaps with another notation from chebi, chebi:3303, leading to a bad ID matching.

# Code to reproduce it.
# I tried to narrow it down as much as possible to show how AutoKeggRec creates the metabolite.
# The exchange reaction was added just to get a minimal model.

from cobra import Model, Reaction, Metabolite
import mergem

met = Metabolite("C00001[c]", name="H2O; Water", compartment="c")
met.annotation["pubchem"] = "3303"

reac = Reaction("EX_h2o", name="Water Source")
reac.add_metabolites({ met: +1 })

model = Model('mini')
model.add_reactions([ reac ])

mr = mergem.merge( input_models=[model], extend_annot=True )
print( mr["merged_model"].name )
print( mr["merged_model"].metabolites[0].annotation )

# Mergem of mini (mergem v1.1.0)
# {'pubchem': '3303', 'kegg.compound': 'C11257', 'metanetx.chemical': 'MNXM45204', 'seed.compound': 'cpd08120', 'chebi': 'CHEBI:3303', 'inchikey': ['BQRGNLJZBFXNCZ-UHFFFAOYSA-N'], 'sbo': 'SBO:0000247'}

Just wanted to bring this to attention as this affects models generated with AutoKeggRec. It's a pretty narrow edge case due to how AutoKeggRec writes their compartment inside the ID and due to having a pubchem annotation.

@dnlobo
Copy link
Member

dnlobo commented Oct 31, 2024

Hi Victor,

Thank you for reporting this. We are working on improving the compartment handling in mergem and we will make sure this case also works. We'll keep you posted when it is fixed.

@dnlobo dnlobo added the bug Something isn't working label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants