Closed Porthmeus closed 4 months ago
fixes #137
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
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.