Porthmeus / MeMoMe

Metabolic Model Merging - a semiautomated way to merge genome scale metabolic models
Apache License 2.0
0 stars 0 forks source link

Jan/feature/137 #142

Closed Porthmeus closed 4 months ago

Porthmeus commented 4 months ago

Implements the a new rule to finding the optimal inchi string, if several databases annotate the same metabolite and prefers now inchi strings which match in charge with the charge given in the SBML/Model.

Porthmeus commented 4 months ago

fixes #137

Porthmeus commented 4 months ago

For some reason, the counter for the annotation is wrong again. It says it does not annotate any inchis, but it does:

from pathlib import Path
from src.MeMoMetabolite import MeMoMetabolite
from src.MeMoModel import MeMoModel

this_directory = Path("tests/")
dat = this_directory.joinpath("dat")
mod_path = dat.joinpath("e_coli_core.xml")
mod = MeMoModel.fromPath(mod_path)
len([x for x in mod.metabolites if x._inchi_string != None])
# -> 0
mod.annotate()
len([x for x in mod.metabolites if x._inchi_string != None])
# -> 54

Output

In [35]: mod.annotate()
BiGG: Annotated inchis 0, annotated dbs 0, annotated names 0
ChEBI: Annotated inchis 0, annotated dbs 0, annotated names 0
ModelSEED: Annotated inchis 1, annotated dbs 54, annotated names 54
Total: Annotated inchis 1, annotated dbs 54, annotated names 54

relates to #132