diff --git a/cobra/io/__init__.py b/cobra/io/__init__.py index fac8edb8f..619bef45d 100644 --- a/cobra/io/__init__.py +++ b/cobra/io/__init__.py @@ -2,11 +2,12 @@ from __future__ import absolute_import +from cobra.io.schemata import MODEL_SCHEMA from cobra.io.dict import (model_from_dict, model_to_dict) from cobra.io.json import ( - to_json, from_json, load_json_model, save_json_model) + to_json, from_json, load_json_model, save_json_model, JSON_SPEC) from cobra.io.yaml import ( - to_yaml, from_yaml, load_yaml_model, save_yaml_model) + to_yaml, from_yaml, load_yaml_model, save_yaml_model, YAML_SPEC) from cobra.io.sbml3 import read_sbml_model, write_sbml_model from cobra.io.sbml import read_legacy_sbml from cobra.io.sbml import write_cobra_model_to_sbml_file as \ diff --git a/cobra/io/json.py b/cobra/io/json.py index d88709079..af6901456 100644 --- a/cobra/io/json.py +++ b/cobra/io/json.py @@ -1,20 +1,33 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import -from importlib_resources import open_text -try: - import simplejson as json -except ImportError: - import json +import json + from six import string_types +import cobra.io.schemata from cobra.io.dict import model_to_dict, model_from_dict -JSON_SPEC = "1" +JSON_SPEC = "1" -def to_json(model, sort=False, **kwargs): +JSON_FORMAT = { + True: { + "indent": 2, + "separators": (", ", ": "), + "sort_keys": True, + "allow_nan": False + }, + False: { + "separators": (",", ":"), + "sort_keys": False, + "allow_nan": False + } +} + + +def to_json(model, sort=False, pretty=False, **kwargs): """ Return the model as a JSON document. @@ -27,6 +40,10 @@ def to_json(model, sort=False, **kwargs): sort : bool, optional Whether to sort the metabolites, reactions, and genes or maintain the order defined in the model. + pretty : bool, optional + Whether to format the JSON more compactly (default) or in a more + verbose but easier to read fashion. Can be partially overwritten by the + ``kwargs``. Returns ------- @@ -37,10 +54,13 @@ def to_json(model, sort=False, **kwargs): -------- save_json_model : Write directly to a file. json.dumps : Base function. + """ obj = model_to_dict(model, sort=sort) obj[u"version"] = JSON_SPEC - return json.dumps(obj, allow_nan=False, **kwargs) + options = JSON_FORMAT[pretty] + options.update(kwargs) + return json.dumps(obj, **options) def from_json(document): @@ -60,6 +80,7 @@ def from_json(document): See Also -------- load_json_model : Load directly from a file. + """ return model_from_dict(json.loads(document)) @@ -89,25 +110,18 @@ def save_json_model(model, filename, sort=False, pretty=False, **kwargs): -------- to_json : Return a string representation. json.dump : Base function. + """ obj = model_to_dict(model, sort=sort) obj[u"version"] = JSON_SPEC - - if pretty: - dump_opts = { - "indent": 4, "separators": (",", ": "), "sort_keys": True, - "allow_nan": False} - else: - dump_opts = { - "indent": 0, "separators": (",", ":"), "sort_keys": False, - "allow_nan": False} - dump_opts.update(**kwargs) + options = JSON_FORMAT[pretty] + options.update(**kwargs) if isinstance(filename, string_types): with open(filename, "w") as file_handle: - json.dump(obj, file_handle, **dump_opts) + json.dump(obj, file_handle, **options) else: - json.dump(obj, filename, **dump_opts) + json.dump(obj, filename, **options) def load_json_model(filename): @@ -128,17 +142,10 @@ def load_json_model(filename): See Also -------- from_json : Load from a string. + """ if isinstance(filename, string_types): with open(filename, "r") as file_handle: return model_from_dict(json.load(file_handle)) else: return model_from_dict(json.load(filename)) - - -def init_json_schema(): - """ Import the JSON schema for schema validation. """ - with open_text("cobra.io.schemata", "json_schema.json", - encoding="utf-8") as file_handle: - json_schema = json.load(file_handle) - return json_schema diff --git a/cobra/io/schemata/__init__.py b/cobra/io/schemata/__init__.py index 2825e7a3b..77d5db991 100644 --- a/cobra/io/schemata/__init__.py +++ b/cobra/io/schemata/__init__.py @@ -1,3 +1,14 @@ # -*- coding: utf-8 -*- +"""Provide JSON schemata that can be used for validation.""" + from __future__ import absolute_import + +import json + +from importlib_resources import open_text + + +with open_text("cobra.io.schemata", "model_schema.json", + encoding="utf-8") as file_handle: + MODEL_SCHEMA = json.load(file_handle) diff --git a/cobra/io/schemata/json_schema.json b/cobra/io/schemata/model_schema.json similarity index 100% rename from cobra/io/schemata/json_schema.json rename to cobra/io/schemata/model_schema.json diff --git a/cobra/io/yaml.py b/cobra/io/yaml.py index a31c16608..1b862f5af 100644 --- a/cobra/io/yaml.py +++ b/cobra/io/yaml.py @@ -14,6 +14,7 @@ class MyYAML(YAML): + def dump(self, data, stream=None, **kwargs): inefficient = False if stream is None: diff --git a/cobra/test/data/iJO1366.pickle b/cobra/test/data/iJO1366.pickle index bf076ca1c..3192a560f 100644 Binary files a/cobra/test/data/iJO1366.pickle and b/cobra/test/data/iJO1366.pickle differ diff --git a/cobra/test/data/mini.json b/cobra/test/data/mini.json index 0239a9db4..6cbcd6c02 100644 --- a/cobra/test/data/mini.json +++ b/cobra/test/data/mini.json @@ -1,1373 +1,1373 @@ { - "compartments": [ - { - "id": "c", - "name": "cytosol" - }, - { - "id": "e", - "name": "extracellular" - } - ], - "genes": [ - { - "id": "b0755", - "name": "gpmA" - }, - { - "id": "b0875", - "name": "aqpZ" - }, - { - "id": "b1101", - "name": "ptsG" - }, - { - "id": "b1380", - "name": "ldhA" - }, - { - "id": "b1621", - "name": "malX" - }, - { - "annotation": { - "ncbigi": [ - "GI:1208453", - "GI:1652654" - ] - }, - "id": "b1676", - "name": "pykF" - }, - { - "id": "b1723", - "name": "pfkB" - }, - { - "id": "b1773", - "name": "ydjI" - }, - { - "id": "b1779", - "name": "gapA" - }, - { - "id": "b1817", - "name": "manX" - }, - { - "id": "b1818", - "name": "manY" - }, - { - "id": "b1819", - "name": "manZ" - }, - { - "id": "b1854", - "name": "pykA" - }, - { - "id": "b2097", - "name": "fbaB" - }, - { - "id": "b2133", - "name": "dld" - }, - { - "id": "b2415", - "name": "ptsH" - }, - { - "id": "b2416", - "name": "ptsI" - }, - { - "id": "b2417", - "name": "crr" - }, - { - "annotation": { - "ncbigi": "GI:1653839" - }, - "id": "b2779", - "name": "eno" - }, - { - "id": "b2925", - "name": "fbaA" - }, - { - "annotation": { - "ncbigi": "GI:1653609" - }, - "id": "b2926", - "name": "pgk" - }, - { - "id": "b2975", - "name": "glcA" - }, - { - "id": "b2987", - "name": "pitB" - }, - { - "id": "b3493", - "name": "pitA" - }, - { - "id": "b3603", - "name": "lldP" - }, - { - "id": "b3612", - "name": "gpmM" - }, - { - "annotation": { - "ncbigi": [ - "GI:1006614", - "GI:1651919" - ] - }, - "id": "b3916", - "name": "pfkA" - }, - { - "id": "b3919", - "name": "tpiA" - }, - { - "annotation": { - "ncbigi": "GI:1653253" - }, - "id": "b4025", - "name": "pgi" - }, - { - "id": "b4395", - "name": "ytjC" - }, - { - "id": "s0001", - "name": "G_s0001" - } - ], - "id": "mini_textbook", - "metabolites": [ - { - "annotation": { - "bigg.metabolite": "13dpg", - "biocyc": "DPG", - "chebi": [ - "CHEBI:16001", - "CHEBI:1658", - "CHEBI:20189", - "CHEBI:57604", - "CHEBI:11881" - ], - "hmdb": "HMDB01270", - "kegg.compound": "C00236", - "pubchem.substance": "3535", - "reactome": "REACT_29800", - "seed.compound": "cpd00203", - "unipathway.compound": "UPC00236" - }, - "charge": -4, - "compartment": "c", - "formula": "C3H4O10P2", - "id": "13dpg_c", - "name": "3-Phospho-D-glyceroyl phosphate" - }, - { - "annotation": { - "bigg.metabolite": "2pg", - "biocyc": "2-PG", - "chebi": [ - "CHEBI:1267", - "CHEBI:58289", - "CHEBI:17835", - "CHEBI:21028", - "CHEBI:11651", - "CHEBI:12986", - "CHEBI:24344", - "CHEBI:39868" - ], - "hmdb": [ - "HMDB03391", - "HMDB00362" - ], - "kegg.compound": "C00631", - "pubchem.substance": "3904", - "reactome": "REACT_30485", - "seed.compound": "cpd00482", - "unipathway.compound": "UPC00631" - }, - "charge": -3, - "compartment": "c", - "formula": "C3H4O7P", - "id": "2pg_c", - "name": "D-Glycerate 2-phosphate" - }, - { - "annotation": { - "bigg.metabolite": "3pg", - "biocyc": "G3P", - "chebi": [ - "CHEBI:40016", - "CHEBI:58272", - "CHEBI:57998", - "CHEBI:11879", - "CHEBI:1657", - "CHEBI:1659", - "CHEBI:17050", - "CHEBI:21029", - "CHEBI:11882", - "CHEBI:11880", - "CHEBI:12987", - "CHEBI:17794", - "CHEBI:24345" - ], - "hmdb": "HMDB00807", - "kegg.compound": [ - "C00197", - "C00597" - ], - "pubchem.substance": "3497", - "reactome": "REACT_29728", - "seed.compound": "cpd00169", - "unipathway.compound": [ - "UPC00597", - "UPC00197" - ] - }, - "charge": -3, - "compartment": "c", - "formula": "C3H4O7P", - "id": "3pg_c", - "name": "3-Phospho-D-glycerate" - }, - { - "annotation": { - "bigg.metabolite": "adp", - "biocyc": [ - "ADP", - "ADP-GROUP" - ], - "cas": [ - "58-64-0", - "58-64-0" - ], - "chebi": [ - "CHEBI:13222", - "CHEBI:16761", - "CHEBI:2342", - "CHEBI:22244", - "CHEBI:40553", - "CHEBI:456216" - ], - "hmdb": "HMDB01341", - "kegg.compound": "C00008", - "kegg.glycan": "G11113", - "pubchem.substance": "3310", - "reactome": [ - "REACT_190072", - "REACT_481002", - "REACT_211606", - "REACT_429160", - "REACT_29370", - "REACT_196180", - "REACT_113581", - "REACT_113582", - "REACT_114564", - "REACT_114565", - "REACT_429153" - ], - "seed.compound": "cpd00008", - "unipathway.compound": "UPC00008" - }, - "charge": -3, - "compartment": "c", - "formula": "C10H12N5O10P2", - "id": "adp_c", - "name": "ADP" - }, - { - "annotation": { - "bigg.metabolite": "atp", - "biocyc": "ATP", - "cas": [ - "56-65-5", - "56-65-5" - ], - "chebi": [ - "CHEBI:40938", - "CHEBI:15422", - "CHEBI:57299", - "CHEBI:13236", - "CHEBI:10789", - "CHEBI:30616", - "CHEBI:22249", - "CHEBI:10841", - "CHEBI:2359" - ], - "hmdb": "HMDB00538", - "kegg.compound": "C00002", - "kegg.drug": "D08646", - "pubchem.substance": "3304", - "reactome": [ - "REACT_190078", - "REACT_113592", - "REACT_113593", - "REACT_114570", - "REACT_29358", - "REACT_389573", - "REACT_139836", - "REACT_211579" - ], - "seed.compound": "cpd00002", - "unipathway.compound": "UPC00002" - }, - "charge": -4, - "compartment": "c", - "formula": "C10H12N5O13P3", - "id": "atp_c", - "name": "ATP" - }, - { - "annotation": { - "bigg.metabolite": "dhap", - "biocyc": "DIHYDROXY-ACETONE-PHOSPHATE", - "cas": [ - "57-04-5", - "57-04-5" - ], - "chebi": [ - "CHEBI:14341", - "CHEBI:57642", - "CHEBI:14342", - "CHEBI:16108", - "CHEBI:5454", - "CHEBI:24355", - "CHEBI:39571" - ], - "hmdb": [ - "HMDB01473", - "HMDB11735" - ], - "kegg.compound": "C00111", - "pubchem.substance": "3411", - "reactome": [ - "REACT_188451", - "REACT_75970", - "REACT_390404" - ], - "seed.compound": "cpd00095", - "unipathway.compound": "UPC00111" - }, - "charge": -2, - "compartment": "c", - "formula": "C3H5O6P", - "id": "dhap_c", - "name": "Dihydroxyacetone phosphate" - }, - { - "annotation": { - "bigg.metabolite": "f6p", - "biocyc": "FRUCTOSE-6P", - "cas": [ - "643-13-0", - "643-13-0" - ], - "chebi": [ - "CHEBI:57634", - "CHEBI:12352", - "CHEBI:45804", - "CHEBI:61527", - "CHEBI:61553", - "CHEBI:10375", - "CHEBI:16084", - "CHEBI:42378", - "CHEBI:22768" - ], - "hmdb": "HMDB03971", - "kegg.compound": [ - "C05345", - "C00085" - ], - "pubchem.substance": "3385", - "seed.compound": "cpd00072", - "unipathway.compound": [ - "UPC05345", - "UPC00085" - ] - }, - "charge": -2, - "compartment": "c", - "formula": "C6H11O9P", - "id": "f6p_c", - "name": "D-Fructose 6-phosphate" - }, - { - "annotation": { - "bigg.metabolite": "fdp", - "biocyc": "FRUCTOSE-16-DIPHOSPHATE", - "cas": [ - "488-69-7", - "488-69-7" - ], - "chebi": [ - "CHEBI:32968", - "CHEBI:49299", - "CHEBI:42553", - "CHEBI:32966", - "CHEBI:37736", - "CHEBI:28013", - "CHEBI:32967", - "CHEBI:41014", - "CHEBI:22767", - "CHEBI:10374", - "CHEBI:40595", - "CHEBI:40591" - ], - "kegg.compound": [ - "C05378", - "C00354" - ], - "pubchem.substance": "3647", - "seed.compound": "cpd00290", - "unipathway.compound": "UPC00354" - }, - "charge": -4, - "compartment": "c", - "formula": "C6H10O12P2", - "id": "fdp_c", - "name": "D-Fructose 1,6-bisphosphate" - }, - { - "annotation": { - "bigg.metabolite": "g3p", - "cas": [ - "142-10-9", - "142-10-9" - ], - "chebi": [ - "CHEBI:17138", - "CHEBI:14333", - "CHEBI:5446", - "CHEBI:58027" - ], - "hmdb": "HMDB01112", - "kegg.compound": [ - "C00661", - "C00118" - ], - "pubchem.substance": "3930", - "seed.compound": "cpd00102", - "unipathway.compound": [ - "UPC00661", - "UPC00118" - ] - }, - "charge": -2, - "compartment": "c", - "formula": "C3H5O6P", - "id": "g3p_c", - "name": "Glyceraldehyde 3-phosphate" - }, - { - "annotation": { - "bigg.metabolite": "g6p", - "biocyc": [ - "D-glucose-6-phosphate", - "GLC-6-P" - ], - "cas": [ - "56-73-5", - "56-73-5" - ], - "chebi": [ - "CHEBI:10399", - "CHEBI:22797", - "CHEBI:41041", - "CHEBI:17719", - "CHEBI:4170", - "CHEBI:61548", - "CHEBI:58247", - "CHEBI:12375" - ], - "hmdb": [ - "HMDB03498", - "HMDB06793", - "HMDB01401", - "HMDB01549" - ], - "kegg.compound": [ - "C00092", - "C01172" - ], - "pubchem.substance": "3392", - "reactome": "REACT_1629756", - "seed.compound": "cpd00079", - "unipathway.compound": "UPC00092" - }, - "charge": -2, - "compartment": "c", - "formula": "C6H11O9P", - "id": "g6p_c", - "name": "D-Glucose 6-phosphate" - }, - { - "annotation": { - "bigg.metabolite": "glc__D", - "cas": [ - "50-99-7", - "50-99-7" - ], - "kegg.compound": "C00031", - "pubchem.substance": "3333" - }, - "charge": 0, - "compartment": "e", - "formula": "C6H12O6", - "id": "glc__D_e", - "name": "D-Glucose" - }, - { - "annotation": { - "bigg.metabolite": "h2o", - "biocyc": [ - "WATER", - "OH", - "OXONIUM" - ], - "cas": [ - "7732-18-5", - "7732-18-5" - ], - "chebi": [ - "CHEBI:15377", - "CHEBI:13365", - "CHEBI:41979", - "CHEBI:16234", - "CHEBI:36385", - "CHEBI:42857", - "CHEBI:27313", - "CHEBI:44819", - "CHEBI:29373", - "CHEBI:10743", - "CHEBI:5594", - "CHEBI:29356", - "CHEBI:53442", - "CHEBI:29375", - "CHEBI:29374", - "CHEBI:13419", - "CHEBI:43228", - "CHEBI:44292", - "CHEBI:13352", - "CHEBI:41981", - "CHEBI:29412", - "CHEBI:42043", - "CHEBI:33811", - "CHEBI:33813", - "CHEBI:35511", - "CHEBI:5585", - "CHEBI:44641", - "CHEBI:44701" - ], - "hmdb": [ - "HMDB01039", - "HMDB02111" - ], - "kegg.compound": [ - "C01328", - "C00001", - "C18714", - "C18712" - ], - "kegg.drug": [ - "D00001", - "D06322", - "D03703" - ], - "pubchem.substance": "3303", - "reactome": [ - "REACT_947593", - "REACT_189422", - "REACT_141343", - "REACT_113518", - "REACT_1605715", - "REACT_109276", - "REACT_113521", - "REACT_113519", - "REACT_2022884", - "REACT_351603", - "REACT_29356" - ], - "seed.compound": [ - "cpd15275", - "cpd00001" - ], - "unipathway.compound": [ - "UPC00001", - "UPC01328" - ] - }, - "charge": 0, - "compartment": "c", - "formula": "H2O", - "id": "h2o_c", - "name": "H2O" - }, - { - "annotation": { - "bigg.metabolite": "h2o", - "biocyc": [ - "WATER", - "OH", - "OXONIUM" - ], - "cas": [ - "7732-18-5", - "7732-18-5" - ], - "chebi": [ - "CHEBI:15377", - "CHEBI:13365", - "CHEBI:41979", - "CHEBI:16234", - "CHEBI:36385", - "CHEBI:42857", - "CHEBI:27313", - "CHEBI:44819", - "CHEBI:29373", - "CHEBI:10743", - "CHEBI:5594", - "CHEBI:29356", - "CHEBI:53442", - "CHEBI:29375", - "CHEBI:29374", - "CHEBI:13419", - "CHEBI:43228", - "CHEBI:44292", - "CHEBI:13352", - "CHEBI:41981", - "CHEBI:29412", - "CHEBI:42043", - "CHEBI:33811", - "CHEBI:33813", - "CHEBI:35511", - "CHEBI:5585", - "CHEBI:44641", - "CHEBI:44701" - ], - "hmdb": [ - "HMDB01039", - "HMDB02111" - ], - "kegg.compound": [ - "C01328", - "C00001", - "C18714", - "C18712" - ], - "kegg.drug": [ - "D00001", - "D06322", - "D03703" - ], - "pubchem.substance": "3303", - "reactome": [ - "REACT_947593", - "REACT_189422", - "REACT_141343", - "REACT_113518", - "REACT_1605715", - "REACT_109276", - "REACT_113521", - "REACT_113519", - "REACT_2022884", - "REACT_351603", - "REACT_29356" - ], - "seed.compound": [ - "cpd15275", - "cpd00001" - ], - "unipathway.compound": [ - "UPC00001", - "UPC01328" - ] - }, - "charge": 0, - "compartment": "e", - "formula": "H2O", - "id": "h2o_e", - "name": "H2O" - }, - { - "annotation": { - "bigg.metabolite": "h", - "biocyc": "PROTON", - "cas": [ - "12408-02-5", - "12408-02-5" - ], - "chebi": [ - "CHEBI:24636", - "CHEBI:15378", - "CHEBI:10744", - "CHEBI:13357", - "CHEBI:5584" - ], - "kegg.compound": "C00080", - "pubchem.substance": "3380", - "reactome": [ - "REACT_194688", - "REACT_425978", - "REACT_193465", - "REACT_374900", - "REACT_74722", - "REACT_425999", - "REACT_428040", - "REACT_163953", - "REACT_372511", - "REACT_2000349", - "REACT_70106", - "REACT_1470067", - "REACT_113529", - "REACT_425969", - "REACT_428548", - "REACT_156540", - "REACT_1614597", - "REACT_351626", - "REACT_427899" - ], - "seed.compound": "cpd00067", - "unipathway.compound": "UPC00080" - }, - "charge": 1, - "compartment": "c", - "formula": "H", - "id": "h_c", - "name": "H+" - }, - { - "annotation": { - "bigg.metabolite": "h", - "biocyc": "PROTON", - "cas": [ - "12408-02-5", - "12408-02-5" - ], - "chebi": [ - "CHEBI:24636", - "CHEBI:15378", - "CHEBI:10744", - "CHEBI:13357", - "CHEBI:5584" - ], - "kegg.compound": "C00080", - "pubchem.substance": "3380", - "reactome": [ - "REACT_194688", - "REACT_425978", - "REACT_193465", - "REACT_374900", - "REACT_74722", - "REACT_425999", - "REACT_428040", - "REACT_163953", - "REACT_372511", - "REACT_2000349", - "REACT_70106", - "REACT_1470067", - "REACT_113529", - "REACT_425969", - "REACT_428548", - "REACT_156540", - "REACT_1614597", - "REACT_351626", - "REACT_427899" - ], - "seed.compound": "cpd00067", - "unipathway.compound": "UPC00080" - }, - "charge": 1, - "compartment": "e", - "formula": "H", - "id": "h_e", - "name": "H+" - }, - { - "charge": -1, - "compartment": "c", - "formula": "C3H5O3", - "id": "lac__D_c", - "name": "D-Lactate" - }, - { - "charge": -1, - "compartment": "e", - "formula": "C3H5O3", - "id": "lac__D_e", - "name": "D-Lactate" - }, - { - "annotation": { - "bigg.metabolite": "nad", - "biocyc": "NAD", - "cas": [ - "53-84-9", - "53-84-9" - ], - "chebi": [ - "CHEBI:21901", - "CHEBI:7422", - "CHEBI:44214", - "CHEBI:15846", - "CHEBI:13394", - "CHEBI:13393", - "CHEBI:44215", - "CHEBI:13389", - "CHEBI:57540", - "CHEBI:44281" - ], - "hmdb": "HMDB00902", - "kegg.compound": "C00003", - "kegg.drug": "D00002", - "pubchem.substance": "3305", - "reactome": [ - "REACT_192307", - "REACT_29360", - "REACT_427523", - "REACT_194653", - "REACT_113526" - ], - "seed.compound": "cpd00003", - "unipathway.compound": "UPC00003" - }, - "charge": -1, - "compartment": "c", - "formula": "C21H26N7O14P2", - "id": "nad_c", - "name": "Nicotinamide adenine dinucleotide" - }, - { - "annotation": { - "bigg.metabolite": "nadh", - "biocyc": "NADH", - "cas": [ - "58-68-4", - "58-68-4" - ], - "chebi": [ - "CHEBI:13395", - "CHEBI:21902", - "CHEBI:16908", - "CHEBI:7423", - "CHEBI:44216", - "CHEBI:57945", - "CHEBI:13396" - ], - "hmdb": "HMDB01487", - "kegg.compound": "C00004", - "pubchem.substance": "3306", - "reactome": [ - "REACT_192305", - "REACT_73473", - "REACT_194697", - "REACT_29362" - ], - "seed.compound": "cpd00004", - "unipathway.compound": "UPC00004" - }, - "charge": -2, - "compartment": "c", - "formula": "C21H27N7O14P2", - "id": "nadh_c", - "name": "Nicotinamide adenine dinucleotide - reduced" - }, - { - "annotation": { - "bigg.metabolite": "pep", - "biocyc": "PHOSPHO-ENOL-PYRUVATE", - "cas": [ - "138-08-9", - "138-08-9" - ], - "chebi": [ - "CHEBI:44897", - "CHEBI:44894", - "CHEBI:14812", - "CHEBI:8147", - "CHEBI:26055", - "CHEBI:26054", - "CHEBI:58702", - "CHEBI:18021" - ], - "hmdb": "HMDB00263", - "kegg.compound": "C00074", - "pubchem.substance": "3374", - "reactome": [ - "REACT_29492", - "REACT_372364" - ], - "seed.compound": "cpd00061", - "unipathway.compound": "UPC00074" - }, - "charge": -3, - "compartment": "c", - "formula": "C3H2O6P", - "id": "pep_c", - "name": "Phosphoenolpyruvate" - }, - { - "annotation": { - "bigg.metabolite": "pi", - "biocyc": [ - "Pi", - "PHOSPHATE-GROUP", - "CPD0-1421" - ], - "cas": [ - "14265-44-2", - "14265-44-2" - ], - "chebi": [ - "CHEBI:37583", - "CHEBI:7793", - "CHEBI:37585", - "CHEBI:34683", - "CHEBI:14791", - "CHEBI:34855", - "CHEBI:29137", - "CHEBI:29139", - "CHEBI:63036", - "CHEBI:26020", - "CHEBI:39739", - "CHEBI:32597", - "CHEBI:32596", - "CHEBI:43474", - "CHEBI:63051", - "CHEBI:43470", - "CHEBI:9679", - "CHEBI:35433", - "CHEBI:4496", - "CHEBI:45024", - "CHEBI:18367", - "CHEBI:26078", - "CHEBI:39745", - "CHEBI:24838" - ], - "hmdb": "HMDB02142", - "kegg.compound": [ - "C13556", - "C13558", - "C00009" - ], - "kegg.drug": "D05467", - "pubchem.substance": "3311", - "reactome": [ - "REACT_947590", - "REACT_109277", - "REACT_113548", - "REACT_2255331", - "REACT_29372", - "REACT_113550", - "REACT_113551" - ], - "seed.compound": [ - "cpd09464", - "cpd09463", - "cpd00009" - ], - "unipathway.compound": "UPC00009" - }, - "charge": -2, - "compartment": "c", - "formula": "HO4P", - "id": "pi_c", - "name": "Phosphate" - }, - { - "annotation": { - "bigg.metabolite": "pi", - "biocyc": [ - "Pi", - "PHOSPHATE-GROUP", - "CPD0-1421" - ], - "cas": [ - "14265-44-2", - "14265-44-2" - ], - "chebi": [ - "CHEBI:37583", - "CHEBI:7793", - "CHEBI:37585", - "CHEBI:34683", - "CHEBI:14791", - "CHEBI:34855", - "CHEBI:29137", - "CHEBI:29139", - "CHEBI:63036", - "CHEBI:26020", - "CHEBI:39739", - "CHEBI:32597", - "CHEBI:32596", - "CHEBI:43474", - "CHEBI:63051", - "CHEBI:43470", - "CHEBI:9679", - "CHEBI:35433", - "CHEBI:4496", - "CHEBI:45024", - "CHEBI:18367", - "CHEBI:26078", - "CHEBI:39745", - "CHEBI:24838" - ], - "hmdb": "HMDB02142", - "kegg.compound": [ - "C13556", - "C13558", - "C00009" - ], - "kegg.drug": "D05467", - "pubchem.substance": "3311", - "reactome": [ - "REACT_947590", - "REACT_109277", - "REACT_113548", - "REACT_2255331", - "REACT_29372", - "REACT_113550", - "REACT_113551" - ], - "seed.compound": [ - "cpd09464", - "cpd09463", - "cpd00009" - ], - "unipathway.compound": "UPC00009" - }, - "charge": -2, - "compartment": "e", - "formula": "HO4P", - "id": "pi_e", - "name": "Phosphate" - }, - { - "annotation": { - "bigg.metabolite": "pyr", - "biocyc": "PYRUVATE", - "cas": [ - "127-17-3", - "127-17-3" - ], - "chebi": [ - "CHEBI:15361", - "CHEBI:14987", - "CHEBI:8685", - "CHEBI:32816", - "CHEBI:45253", - "CHEBI:26466", - "CHEBI:26462" - ], - "hmdb": "HMDB00243", - "kegg.compound": "C00022", - "lipidmaps": "LMFA01060077", - "pubchem.substance": "3324", - "reactome": [ - "REACT_113557", - "REACT_389680", - "REACT_29398" - ], - "seed.compound": "cpd00020", - "unipathway.compound": "UPC00022" - }, - "charge": -1, - "compartment": "c", - "formula": "C3H3O3", - "id": "pyr_c", - "name": "Pyruvate" - } - ], - "reactions": [ - { - "annotation": { - "bigg.reaction": "ATPM" - }, - "gene_reaction_rule": "", - "id": "ATPM", - "lower_bound": 8.39, - "metabolites": { - "adp_c": 1.0, - "atp_c": -1.0, - "h2o_c": -1.0, - "h_c": 1.0, - "pi_c": 1.0 - }, - "name": "ATP maintenance requirement", - "objective_coefficient": 1.0, - "upper_bound": 1000.0 - }, - { - "gene_reaction_rule": "b3603 or b2975", - "id": "D_LACt2", - "lower_bound": -1000.0, - "metabolites": { - "h_c": 1, - "h_e": -1, - "lac__D_c": 1, - "lac__D_e": -1 - }, - "name": "", - "upper_bound": 1000.0 - }, - { - "annotation": { - "bigg.reaction": "ENO" - }, - "gene_reaction_rule": "b2779", - "id": "ENO", - "lower_bound": -1000.0, - "metabolites": { - "2pg_c": -1.0, - "h2o_c": 1.0, - "pep_c": 1.0 - }, - "name": "enolase", - "upper_bound": 1000.0 - }, - { - "annotation": { - "SBO": "SBO:0000627", - "bigg.reaction": "glc" - }, - "gene_reaction_rule": "", - "id": "EX_glc__D_e", - "lower_bound": -10.0, - "metabolites": { - "glc__D_e": -1.0 - }, - "name": "D-Glucose exchange", - "upper_bound": 1000.0 - }, - { - "annotation": { - "SBO": "SBO:0000627", - "bigg.reaction": "h" - }, - "gene_reaction_rule": "", - "id": "EX_h_e", - "lower_bound": -1000.0, - "metabolites": { - "h_e": -1.0 - }, - "name": "H+ exchange", - "upper_bound": 1000.0 - }, - { - "gene_reaction_rule": "", - "id": "EX_lac__D_e", - "lower_bound": 0.0, - "metabolites": { - "lac__D_e": -1.0 - }, - "name": "D-lactate exchange", - "upper_bound": 1000.0 - }, - { - "annotation": { - "bigg.reaction": "FBA" - }, - "gene_reaction_rule": "b1773 or b2097 or b2925", - "id": "FBA", - "lower_bound": -1000.0, - "metabolites": { - "dhap_c": 1.0, - "fdp_c": -1.0, - "g3p_c": 1.0 - }, - "name": "fructose-bisphosphate aldolase", - "upper_bound": 1000.0 - }, - { - "annotation": { - "bigg.reaction": "GAPD" - }, - "gene_reaction_rule": "b1779", - "id": "GAPD", - "lower_bound": -1000.0, - "metabolites": { - "13dpg_c": 1.0, - "g3p_c": -1.0, - "h_c": 1.0, - "nad_c": -1.0, - "nadh_c": 1.0, - "pi_c": -1.0 - }, - "name": "glyceraldehyde-3-phosphate dehydrogenase", - "upper_bound": 1000.0 - }, - { - "annotation": { - "bigg.reaction": "GLCpts" - }, - "gene_reaction_rule": "( b2417 and b1621 and b2415 and b2416 ) or ( b2417 and b1101 and b2415 and b2416 ) or ( b1817 and b1818 and b1819 and b2415 and b2416 )", - "id": "GLCpts", - "lower_bound": 0.0, - "metabolites": { - "g6p_c": 1.0, - "glc__D_e": -1.0, - "pep_c": -1.0, - "pyr_c": 1.0 - }, - "name": "D-glucose transport via PEP:Pyr PTS", - "upper_bound": 1000.0 - }, - { - "annotation": { - "bigg.reaction": "H2Ot" - }, - "gene_reaction_rule": "b0875 or s0001", - "id": "H2Ot", - "lower_bound": -1000.0, - "metabolites": { - "h2o_c": 1.0, - "h2o_e": -1.0 - }, - "name": "R H2O transport via - diffusion", - "upper_bound": 1000.0 - }, - { - "gene_reaction_rule": "b2133 or b1380", - "id": "LDH_D", - "lower_bound": -1000.0, - "metabolites": { - "h_c": 1.0, - "lac__D_c": -1.0, - "nad_c": -1.0, - "nadh_c": 1.0, - "pyr_c": 1.0 - }, - "name": "D-lactate dehydrogenase", - "upper_bound": 1000.0 - }, - { - "annotation": { - "bigg.reaction": "PFK" - }, - "gene_reaction_rule": "b3916 or b1723", - "id": "PFK", - "lower_bound": 0.0, - "metabolites": { - "adp_c": 1.0, - "atp_c": -1.0, - "f6p_c": -1.0, - "fdp_c": 1.0, - "h_c": 1.0 - }, - "name": "phosphofructokinase", - "objective_coefficient": 1.0, - "upper_bound": 1000.0 - }, - { - "annotation": { - "bigg.reaction": "PGI" - }, - "gene_reaction_rule": "b4025", - "id": "PGI", - "lower_bound": -1000.0, - "metabolites": { - "f6p_c": 1.0, - "g6p_c": -1.0 - }, - "name": "glucose-6-phosphate isomerase", - "upper_bound": 1000.0 - }, - { - "annotation": { - "bigg.reaction": "PGK" - }, - "gene_reaction_rule": "b2926", - "id": "PGK", - "lower_bound": -1000.0, - "metabolites": { - "13dpg_c": 1.0, - "3pg_c": -1.0, - "adp_c": 1.0, - "atp_c": -1.0 - }, - "name": "phosphoglycerate kinase", - "upper_bound": 1000.0 - }, - { - "annotation": { - "bigg.reaction": "PGM" - }, - "gene_reaction_rule": "b4395 or b3612 or b0755", - "id": "PGM", - "lower_bound": -1000.0, - "metabolites": { - "2pg_c": -1.0, - "3pg_c": 1.0 - }, - "name": "phosphoglycerate mutase", - "upper_bound": 1000.0 - }, - { - "annotation": { - "bigg.reaction": "PIt2r" - }, - "gene_reaction_rule": "b2987 or b3493", - "id": "PIt2r", - "lower_bound": -1000.0, - "metabolites": { - "h_c": 1.0, - "h_e": -1.0, - "pi_c": 1.0, - "pi_e": -1.0 - }, - "name": "R phosphate reversible transport via - symport", - "upper_bound": 1000.0 - }, - { - "annotation": { - "bigg.reaction": "PYK" - }, - "gene_reaction_rule": "b1854 or b1676", - "id": "PYK", - "lower_bound": 0.0, - "metabolites": { - "adp_c": -1.0, - "atp_c": 1.0, - "h_c": -1.0, - "pep_c": -1.0, - "pyr_c": 1.0 - }, - "name": "pyruvate kinase", - "upper_bound": 1000.0 - }, - { - "annotation": { - "bigg.reaction": "TPI" - }, - "gene_reaction_rule": "b3919", - "id": "TPI", - "lower_bound": -1000.0, - "metabolites": { - "dhap_c": -1.0, - "g3p_c": 1.0 - }, - "name": "triose-phosphate isomerase", - "upper_bound": 1000.0 - } - ], - "version": "1" + "compartments": [ + { + "id": "c", + "name": "cytosol" + }, + { + "id": "e", + "name": "extracellular" + } + ], + "genes": [ + { + "id": "b0755", + "name": "gpmA" + }, + { + "id": "b0875", + "name": "aqpZ" + }, + { + "id": "b1101", + "name": "ptsG" + }, + { + "id": "b1380", + "name": "ldhA" + }, + { + "id": "b1621", + "name": "malX" + }, + { + "annotation": { + "ncbigi": [ + "GI:1208453", + "GI:1652654" + ] + }, + "id": "b1676", + "name": "pykF" + }, + { + "id": "b1723", + "name": "pfkB" + }, + { + "id": "b1773", + "name": "ydjI" + }, + { + "id": "b1779", + "name": "gapA" + }, + { + "id": "b1817", + "name": "manX" + }, + { + "id": "b1818", + "name": "manY" + }, + { + "id": "b1819", + "name": "manZ" + }, + { + "id": "b1854", + "name": "pykA" + }, + { + "id": "b2097", + "name": "fbaB" + }, + { + "id": "b2133", + "name": "dld" + }, + { + "id": "b2415", + "name": "ptsH" + }, + { + "id": "b2416", + "name": "ptsI" + }, + { + "id": "b2417", + "name": "crr" + }, + { + "annotation": { + "ncbigi": "GI:1653839" + }, + "id": "b2779", + "name": "eno" + }, + { + "id": "b2925", + "name": "fbaA" + }, + { + "annotation": { + "ncbigi": "GI:1653609" + }, + "id": "b2926", + "name": "pgk" + }, + { + "id": "b2975", + "name": "glcA" + }, + { + "id": "b2987", + "name": "pitB" + }, + { + "id": "b3493", + "name": "pitA" + }, + { + "id": "b3603", + "name": "lldP" + }, + { + "id": "b3612", + "name": "gpmM" + }, + { + "annotation": { + "ncbigi": [ + "GI:1006614", + "GI:1651919" + ] + }, + "id": "b3916", + "name": "pfkA" + }, + { + "id": "b3919", + "name": "tpiA" + }, + { + "annotation": { + "ncbigi": "GI:1653253" + }, + "id": "b4025", + "name": "pgi" + }, + { + "id": "b4395", + "name": "ytjC" + }, + { + "id": "s0001", + "name": "G_s0001" + } + ], + "id": "mini_textbook", + "metabolites": [ + { + "annotation": { + "bigg.metabolite": "13dpg", + "biocyc": "DPG", + "chebi": [ + "CHEBI:16001", + "CHEBI:1658", + "CHEBI:20189", + "CHEBI:57604", + "CHEBI:11881" + ], + "hmdb": "HMDB01270", + "kegg.compound": "C00236", + "pubchem.substance": "3535", + "reactome": "REACT_29800", + "seed.compound": "cpd00203", + "unipathway.compound": "UPC00236" + }, + "charge": -4, + "compartment": "c", + "formula": "C3H4O10P2", + "id": "13dpg_c", + "name": "3-Phospho-D-glyceroyl phosphate" + }, + { + "annotation": { + "bigg.metabolite": "2pg", + "biocyc": "2-PG", + "chebi": [ + "CHEBI:1267", + "CHEBI:58289", + "CHEBI:17835", + "CHEBI:21028", + "CHEBI:11651", + "CHEBI:12986", + "CHEBI:24344", + "CHEBI:39868" + ], + "hmdb": [ + "HMDB03391", + "HMDB00362" + ], + "kegg.compound": "C00631", + "pubchem.substance": "3904", + "reactome": "REACT_30485", + "seed.compound": "cpd00482", + "unipathway.compound": "UPC00631" + }, + "charge": -3, + "compartment": "c", + "formula": "C3H4O7P", + "id": "2pg_c", + "name": "D-Glycerate 2-phosphate" + }, + { + "annotation": { + "bigg.metabolite": "3pg", + "biocyc": "G3P", + "chebi": [ + "CHEBI:40016", + "CHEBI:58272", + "CHEBI:57998", + "CHEBI:11879", + "CHEBI:1657", + "CHEBI:1659", + "CHEBI:17050", + "CHEBI:21029", + "CHEBI:11882", + "CHEBI:11880", + "CHEBI:12987", + "CHEBI:17794", + "CHEBI:24345" + ], + "hmdb": "HMDB00807", + "kegg.compound": [ + "C00197", + "C00597" + ], + "pubchem.substance": "3497", + "reactome": "REACT_29728", + "seed.compound": "cpd00169", + "unipathway.compound": [ + "UPC00597", + "UPC00197" + ] + }, + "charge": -3, + "compartment": "c", + "formula": "C3H4O7P", + "id": "3pg_c", + "name": "3-Phospho-D-glycerate" + }, + { + "annotation": { + "bigg.metabolite": "adp", + "biocyc": [ + "ADP", + "ADP-GROUP" + ], + "cas": [ + "58-64-0", + "58-64-0" + ], + "chebi": [ + "CHEBI:13222", + "CHEBI:16761", + "CHEBI:2342", + "CHEBI:22244", + "CHEBI:40553", + "CHEBI:456216" + ], + "hmdb": "HMDB01341", + "kegg.compound": "C00008", + "kegg.glycan": "G11113", + "pubchem.substance": "3310", + "reactome": [ + "REACT_190072", + "REACT_481002", + "REACT_211606", + "REACT_429160", + "REACT_29370", + "REACT_196180", + "REACT_113581", + "REACT_113582", + "REACT_114564", + "REACT_114565", + "REACT_429153" + ], + "seed.compound": "cpd00008", + "unipathway.compound": "UPC00008" + }, + "charge": -3, + "compartment": "c", + "formula": "C10H12N5O10P2", + "id": "adp_c", + "name": "ADP" + }, + { + "annotation": { + "bigg.metabolite": "atp", + "biocyc": "ATP", + "cas": [ + "56-65-5", + "56-65-5" + ], + "chebi": [ + "CHEBI:40938", + "CHEBI:15422", + "CHEBI:57299", + "CHEBI:13236", + "CHEBI:10789", + "CHEBI:30616", + "CHEBI:22249", + "CHEBI:10841", + "CHEBI:2359" + ], + "hmdb": "HMDB00538", + "kegg.compound": "C00002", + "kegg.drug": "D08646", + "pubchem.substance": "3304", + "reactome": [ + "REACT_190078", + "REACT_113592", + "REACT_113593", + "REACT_114570", + "REACT_29358", + "REACT_389573", + "REACT_139836", + "REACT_211579" + ], + "seed.compound": "cpd00002", + "unipathway.compound": "UPC00002" + }, + "charge": -4, + "compartment": "c", + "formula": "C10H12N5O13P3", + "id": "atp_c", + "name": "ATP" + }, + { + "annotation": { + "bigg.metabolite": "dhap", + "biocyc": "DIHYDROXY-ACETONE-PHOSPHATE", + "cas": [ + "57-04-5", + "57-04-5" + ], + "chebi": [ + "CHEBI:14341", + "CHEBI:57642", + "CHEBI:14342", + "CHEBI:16108", + "CHEBI:5454", + "CHEBI:24355", + "CHEBI:39571" + ], + "hmdb": [ + "HMDB01473", + "HMDB11735" + ], + "kegg.compound": "C00111", + "pubchem.substance": "3411", + "reactome": [ + "REACT_188451", + "REACT_75970", + "REACT_390404" + ], + "seed.compound": "cpd00095", + "unipathway.compound": "UPC00111" + }, + "charge": -2, + "compartment": "c", + "formula": "C3H5O6P", + "id": "dhap_c", + "name": "Dihydroxyacetone phosphate" + }, + { + "annotation": { + "bigg.metabolite": "f6p", + "biocyc": "FRUCTOSE-6P", + "cas": [ + "643-13-0", + "643-13-0" + ], + "chebi": [ + "CHEBI:57634", + "CHEBI:12352", + "CHEBI:45804", + "CHEBI:61527", + "CHEBI:61553", + "CHEBI:10375", + "CHEBI:16084", + "CHEBI:42378", + "CHEBI:22768" + ], + "hmdb": "HMDB03971", + "kegg.compound": [ + "C05345", + "C00085" + ], + "pubchem.substance": "3385", + "seed.compound": "cpd00072", + "unipathway.compound": [ + "UPC05345", + "UPC00085" + ] + }, + "charge": -2, + "compartment": "c", + "formula": "C6H11O9P", + "id": "f6p_c", + "name": "D-Fructose 6-phosphate" + }, + { + "annotation": { + "bigg.metabolite": "fdp", + "biocyc": "FRUCTOSE-16-DIPHOSPHATE", + "cas": [ + "488-69-7", + "488-69-7" + ], + "chebi": [ + "CHEBI:32968", + "CHEBI:49299", + "CHEBI:42553", + "CHEBI:32966", + "CHEBI:37736", + "CHEBI:28013", + "CHEBI:32967", + "CHEBI:41014", + "CHEBI:22767", + "CHEBI:10374", + "CHEBI:40595", + "CHEBI:40591" + ], + "kegg.compound": [ + "C05378", + "C00354" + ], + "pubchem.substance": "3647", + "seed.compound": "cpd00290", + "unipathway.compound": "UPC00354" + }, + "charge": -4, + "compartment": "c", + "formula": "C6H10O12P2", + "id": "fdp_c", + "name": "D-Fructose 1,6-bisphosphate" + }, + { + "annotation": { + "bigg.metabolite": "g3p", + "cas": [ + "142-10-9", + "142-10-9" + ], + "chebi": [ + "CHEBI:17138", + "CHEBI:14333", + "CHEBI:5446", + "CHEBI:58027" + ], + "hmdb": "HMDB01112", + "kegg.compound": [ + "C00661", + "C00118" + ], + "pubchem.substance": "3930", + "seed.compound": "cpd00102", + "unipathway.compound": [ + "UPC00661", + "UPC00118" + ] + }, + "charge": -2, + "compartment": "c", + "formula": "C3H5O6P", + "id": "g3p_c", + "name": "Glyceraldehyde 3-phosphate" + }, + { + "annotation": { + "bigg.metabolite": "g6p", + "biocyc": [ + "D-glucose-6-phosphate", + "GLC-6-P" + ], + "cas": [ + "56-73-5", + "56-73-5" + ], + "chebi": [ + "CHEBI:10399", + "CHEBI:22797", + "CHEBI:41041", + "CHEBI:17719", + "CHEBI:4170", + "CHEBI:61548", + "CHEBI:58247", + "CHEBI:12375" + ], + "hmdb": [ + "HMDB03498", + "HMDB06793", + "HMDB01401", + "HMDB01549" + ], + "kegg.compound": [ + "C00092", + "C01172" + ], + "pubchem.substance": "3392", + "reactome": "REACT_1629756", + "seed.compound": "cpd00079", + "unipathway.compound": "UPC00092" + }, + "charge": -2, + "compartment": "c", + "formula": "C6H11O9P", + "id": "g6p_c", + "name": "D-Glucose 6-phosphate" + }, + { + "annotation": { + "bigg.metabolite": "glc__D", + "cas": [ + "50-99-7", + "50-99-7" + ], + "kegg.compound": "C00031", + "pubchem.substance": "3333" + }, + "charge": 0, + "compartment": "e", + "formula": "C6H12O6", + "id": "glc__D_e", + "name": "D-Glucose" + }, + { + "annotation": { + "bigg.metabolite": "h2o", + "biocyc": [ + "WATER", + "OH", + "OXONIUM" + ], + "cas": [ + "7732-18-5", + "7732-18-5" + ], + "chebi": [ + "CHEBI:15377", + "CHEBI:13365", + "CHEBI:41979", + "CHEBI:16234", + "CHEBI:36385", + "CHEBI:42857", + "CHEBI:27313", + "CHEBI:44819", + "CHEBI:29373", + "CHEBI:10743", + "CHEBI:5594", + "CHEBI:29356", + "CHEBI:53442", + "CHEBI:29375", + "CHEBI:29374", + "CHEBI:13419", + "CHEBI:43228", + "CHEBI:44292", + "CHEBI:13352", + "CHEBI:41981", + "CHEBI:29412", + "CHEBI:42043", + "CHEBI:33811", + "CHEBI:33813", + "CHEBI:35511", + "CHEBI:5585", + "CHEBI:44641", + "CHEBI:44701" + ], + "hmdb": [ + "HMDB01039", + "HMDB02111" + ], + "kegg.compound": [ + "C01328", + "C00001", + "C18714", + "C18712" + ], + "kegg.drug": [ + "D00001", + "D06322", + "D03703" + ], + "pubchem.substance": "3303", + "reactome": [ + "REACT_947593", + "REACT_189422", + "REACT_141343", + "REACT_113518", + "REACT_1605715", + "REACT_109276", + "REACT_113521", + "REACT_113519", + "REACT_2022884", + "REACT_351603", + "REACT_29356" + ], + "seed.compound": [ + "cpd15275", + "cpd00001" + ], + "unipathway.compound": [ + "UPC00001", + "UPC01328" + ] + }, + "charge": 0, + "compartment": "c", + "formula": "H2O", + "id": "h2o_c", + "name": "H2O" + }, + { + "annotation": { + "bigg.metabolite": "h2o", + "biocyc": [ + "WATER", + "OH", + "OXONIUM" + ], + "cas": [ + "7732-18-5", + "7732-18-5" + ], + "chebi": [ + "CHEBI:15377", + "CHEBI:13365", + "CHEBI:41979", + "CHEBI:16234", + "CHEBI:36385", + "CHEBI:42857", + "CHEBI:27313", + "CHEBI:44819", + "CHEBI:29373", + "CHEBI:10743", + "CHEBI:5594", + "CHEBI:29356", + "CHEBI:53442", + "CHEBI:29375", + "CHEBI:29374", + "CHEBI:13419", + "CHEBI:43228", + "CHEBI:44292", + "CHEBI:13352", + "CHEBI:41981", + "CHEBI:29412", + "CHEBI:42043", + "CHEBI:33811", + "CHEBI:33813", + "CHEBI:35511", + "CHEBI:5585", + "CHEBI:44641", + "CHEBI:44701" + ], + "hmdb": [ + "HMDB01039", + "HMDB02111" + ], + "kegg.compound": [ + "C01328", + "C00001", + "C18714", + "C18712" + ], + "kegg.drug": [ + "D00001", + "D06322", + "D03703" + ], + "pubchem.substance": "3303", + "reactome": [ + "REACT_947593", + "REACT_189422", + "REACT_141343", + "REACT_113518", + "REACT_1605715", + "REACT_109276", + "REACT_113521", + "REACT_113519", + "REACT_2022884", + "REACT_351603", + "REACT_29356" + ], + "seed.compound": [ + "cpd15275", + "cpd00001" + ], + "unipathway.compound": [ + "UPC00001", + "UPC01328" + ] + }, + "charge": 0, + "compartment": "e", + "formula": "H2O", + "id": "h2o_e", + "name": "H2O" + }, + { + "annotation": { + "bigg.metabolite": "h", + "biocyc": "PROTON", + "cas": [ + "12408-02-5", + "12408-02-5" + ], + "chebi": [ + "CHEBI:24636", + "CHEBI:15378", + "CHEBI:10744", + "CHEBI:13357", + "CHEBI:5584" + ], + "kegg.compound": "C00080", + "pubchem.substance": "3380", + "reactome": [ + "REACT_194688", + "REACT_425978", + "REACT_193465", + "REACT_374900", + "REACT_74722", + "REACT_425999", + "REACT_428040", + "REACT_163953", + "REACT_372511", + "REACT_2000349", + "REACT_70106", + "REACT_1470067", + "REACT_113529", + "REACT_425969", + "REACT_428548", + "REACT_156540", + "REACT_1614597", + "REACT_351626", + "REACT_427899" + ], + "seed.compound": "cpd00067", + "unipathway.compound": "UPC00080" + }, + "charge": 1, + "compartment": "c", + "formula": "H", + "id": "h_c", + "name": "H+" + }, + { + "annotation": { + "bigg.metabolite": "h", + "biocyc": "PROTON", + "cas": [ + "12408-02-5", + "12408-02-5" + ], + "chebi": [ + "CHEBI:24636", + "CHEBI:15378", + "CHEBI:10744", + "CHEBI:13357", + "CHEBI:5584" + ], + "kegg.compound": "C00080", + "pubchem.substance": "3380", + "reactome": [ + "REACT_194688", + "REACT_425978", + "REACT_193465", + "REACT_374900", + "REACT_74722", + "REACT_425999", + "REACT_428040", + "REACT_163953", + "REACT_372511", + "REACT_2000349", + "REACT_70106", + "REACT_1470067", + "REACT_113529", + "REACT_425969", + "REACT_428548", + "REACT_156540", + "REACT_1614597", + "REACT_351626", + "REACT_427899" + ], + "seed.compound": "cpd00067", + "unipathway.compound": "UPC00080" + }, + "charge": 1, + "compartment": "e", + "formula": "H", + "id": "h_e", + "name": "H+" + }, + { + "charge": -1, + "compartment": "c", + "formula": "C3H5O3", + "id": "lac__D_c", + "name": "D-Lactate" + }, + { + "charge": -1, + "compartment": "e", + "formula": "C3H5O3", + "id": "lac__D_e", + "name": "D-Lactate" + }, + { + "annotation": { + "bigg.metabolite": "nad", + "biocyc": "NAD", + "cas": [ + "53-84-9", + "53-84-9" + ], + "chebi": [ + "CHEBI:21901", + "CHEBI:7422", + "CHEBI:44214", + "CHEBI:15846", + "CHEBI:13394", + "CHEBI:13393", + "CHEBI:44215", + "CHEBI:13389", + "CHEBI:57540", + "CHEBI:44281" + ], + "hmdb": "HMDB00902", + "kegg.compound": "C00003", + "kegg.drug": "D00002", + "pubchem.substance": "3305", + "reactome": [ + "REACT_192307", + "REACT_29360", + "REACT_427523", + "REACT_194653", + "REACT_113526" + ], + "seed.compound": "cpd00003", + "unipathway.compound": "UPC00003" + }, + "charge": -1, + "compartment": "c", + "formula": "C21H26N7O14P2", + "id": "nad_c", + "name": "Nicotinamide adenine dinucleotide" + }, + { + "annotation": { + "bigg.metabolite": "nadh", + "biocyc": "NADH", + "cas": [ + "58-68-4", + "58-68-4" + ], + "chebi": [ + "CHEBI:13395", + "CHEBI:21902", + "CHEBI:16908", + "CHEBI:7423", + "CHEBI:44216", + "CHEBI:57945", + "CHEBI:13396" + ], + "hmdb": "HMDB01487", + "kegg.compound": "C00004", + "pubchem.substance": "3306", + "reactome": [ + "REACT_192305", + "REACT_73473", + "REACT_194697", + "REACT_29362" + ], + "seed.compound": "cpd00004", + "unipathway.compound": "UPC00004" + }, + "charge": -2, + "compartment": "c", + "formula": "C21H27N7O14P2", + "id": "nadh_c", + "name": "Nicotinamide adenine dinucleotide - reduced" + }, + { + "annotation": { + "bigg.metabolite": "pep", + "biocyc": "PHOSPHO-ENOL-PYRUVATE", + "cas": [ + "138-08-9", + "138-08-9" + ], + "chebi": [ + "CHEBI:44897", + "CHEBI:44894", + "CHEBI:14812", + "CHEBI:8147", + "CHEBI:26055", + "CHEBI:26054", + "CHEBI:58702", + "CHEBI:18021" + ], + "hmdb": "HMDB00263", + "kegg.compound": "C00074", + "pubchem.substance": "3374", + "reactome": [ + "REACT_29492", + "REACT_372364" + ], + "seed.compound": "cpd00061", + "unipathway.compound": "UPC00074" + }, + "charge": -3, + "compartment": "c", + "formula": "C3H2O6P", + "id": "pep_c", + "name": "Phosphoenolpyruvate" + }, + { + "annotation": { + "bigg.metabolite": "pi", + "biocyc": [ + "Pi", + "PHOSPHATE-GROUP", + "CPD0-1421" + ], + "cas": [ + "14265-44-2", + "14265-44-2" + ], + "chebi": [ + "CHEBI:37583", + "CHEBI:7793", + "CHEBI:37585", + "CHEBI:34683", + "CHEBI:14791", + "CHEBI:34855", + "CHEBI:29137", + "CHEBI:29139", + "CHEBI:63036", + "CHEBI:26020", + "CHEBI:39739", + "CHEBI:32597", + "CHEBI:32596", + "CHEBI:43474", + "CHEBI:63051", + "CHEBI:43470", + "CHEBI:9679", + "CHEBI:35433", + "CHEBI:4496", + "CHEBI:45024", + "CHEBI:18367", + "CHEBI:26078", + "CHEBI:39745", + "CHEBI:24838" + ], + "hmdb": "HMDB02142", + "kegg.compound": [ + "C13556", + "C13558", + "C00009" + ], + "kegg.drug": "D05467", + "pubchem.substance": "3311", + "reactome": [ + "REACT_947590", + "REACT_109277", + "REACT_113548", + "REACT_2255331", + "REACT_29372", + "REACT_113550", + "REACT_113551" + ], + "seed.compound": [ + "cpd09464", + "cpd09463", + "cpd00009" + ], + "unipathway.compound": "UPC00009" + }, + "charge": -2, + "compartment": "c", + "formula": "HO4P", + "id": "pi_c", + "name": "Phosphate" + }, + { + "annotation": { + "bigg.metabolite": "pi", + "biocyc": [ + "Pi", + "PHOSPHATE-GROUP", + "CPD0-1421" + ], + "cas": [ + "14265-44-2", + "14265-44-2" + ], + "chebi": [ + "CHEBI:37583", + "CHEBI:7793", + "CHEBI:37585", + "CHEBI:34683", + "CHEBI:14791", + "CHEBI:34855", + "CHEBI:29137", + "CHEBI:29139", + "CHEBI:63036", + "CHEBI:26020", + "CHEBI:39739", + "CHEBI:32597", + "CHEBI:32596", + "CHEBI:43474", + "CHEBI:63051", + "CHEBI:43470", + "CHEBI:9679", + "CHEBI:35433", + "CHEBI:4496", + "CHEBI:45024", + "CHEBI:18367", + "CHEBI:26078", + "CHEBI:39745", + "CHEBI:24838" + ], + "hmdb": "HMDB02142", + "kegg.compound": [ + "C13556", + "C13558", + "C00009" + ], + "kegg.drug": "D05467", + "pubchem.substance": "3311", + "reactome": [ + "REACT_947590", + "REACT_109277", + "REACT_113548", + "REACT_2255331", + "REACT_29372", + "REACT_113550", + "REACT_113551" + ], + "seed.compound": [ + "cpd09464", + "cpd09463", + "cpd00009" + ], + "unipathway.compound": "UPC00009" + }, + "charge": -2, + "compartment": "e", + "formula": "HO4P", + "id": "pi_e", + "name": "Phosphate" + }, + { + "annotation": { + "bigg.metabolite": "pyr", + "biocyc": "PYRUVATE", + "cas": [ + "127-17-3", + "127-17-3" + ], + "chebi": [ + "CHEBI:15361", + "CHEBI:14987", + "CHEBI:8685", + "CHEBI:32816", + "CHEBI:45253", + "CHEBI:26466", + "CHEBI:26462" + ], + "hmdb": "HMDB00243", + "kegg.compound": "C00022", + "lipidmaps": "LMFA01060077", + "pubchem.substance": "3324", + "reactome": [ + "REACT_113557", + "REACT_389680", + "REACT_29398" + ], + "seed.compound": "cpd00020", + "unipathway.compound": "UPC00022" + }, + "charge": -1, + "compartment": "c", + "formula": "C3H3O3", + "id": "pyr_c", + "name": "Pyruvate" + } + ], + "reactions": [ + { + "annotation": { + "bigg.reaction": "ATPM" + }, + "gene_reaction_rule": "", + "id": "ATPM", + "lower_bound": 8.39, + "metabolites": { + "adp_c": 1.0, + "atp_c": -1.0, + "h2o_c": -1.0, + "h_c": 1.0, + "pi_c": 1.0 + }, + "name": "ATP maintenance requirement", + "objective_coefficient": 1.0, + "upper_bound": 1000.0 + }, + { + "gene_reaction_rule": "b3603 or b2975", + "id": "D_LACt2", + "lower_bound": -1000.0, + "metabolites": { + "h_c": 1, + "h_e": -1, + "lac__D_c": 1, + "lac__D_e": -1 + }, + "name": "", + "upper_bound": 1000.0 + }, + { + "annotation": { + "bigg.reaction": "ENO" + }, + "gene_reaction_rule": "b2779", + "id": "ENO", + "lower_bound": -1000.0, + "metabolites": { + "2pg_c": -1.0, + "h2o_c": 1.0, + "pep_c": 1.0 + }, + "name": "enolase", + "upper_bound": 1000.0 + }, + { + "annotation": { + "SBO": "SBO:0000627", + "bigg.reaction": "glc" + }, + "gene_reaction_rule": "", + "id": "EX_glc__D_e", + "lower_bound": -10.0, + "metabolites": { + "glc__D_e": -1.0 + }, + "name": "D-Glucose exchange", + "upper_bound": 1000.0 + }, + { + "annotation": { + "SBO": "SBO:0000627", + "bigg.reaction": "h" + }, + "gene_reaction_rule": "", + "id": "EX_h_e", + "lower_bound": -1000.0, + "metabolites": { + "h_e": -1.0 + }, + "name": "H+ exchange", + "upper_bound": 1000.0 + }, + { + "gene_reaction_rule": "", + "id": "EX_lac__D_e", + "lower_bound": 0.0, + "metabolites": { + "lac__D_e": -1.0 + }, + "name": "D-lactate exchange", + "upper_bound": 1000.0 + }, + { + "annotation": { + "bigg.reaction": "FBA" + }, + "gene_reaction_rule": "b1773 or b2097 or b2925", + "id": "FBA", + "lower_bound": -1000.0, + "metabolites": { + "dhap_c": 1.0, + "fdp_c": -1.0, + "g3p_c": 1.0 + }, + "name": "fructose-bisphosphate aldolase", + "upper_bound": 1000.0 + }, + { + "annotation": { + "bigg.reaction": "GAPD" + }, + "gene_reaction_rule": "b1779", + "id": "GAPD", + "lower_bound": -1000.0, + "metabolites": { + "13dpg_c": 1.0, + "g3p_c": -1.0, + "h_c": 1.0, + "nad_c": -1.0, + "nadh_c": 1.0, + "pi_c": -1.0 + }, + "name": "glyceraldehyde-3-phosphate dehydrogenase", + "upper_bound": 1000.0 + }, + { + "annotation": { + "bigg.reaction": "GLCpts" + }, + "gene_reaction_rule": "( b2417 and b1621 and b2415 and b2416 ) or ( b2417 and b1101 and b2415 and b2416 ) or ( b1817 and b1818 and b1819 and b2415 and b2416 )", + "id": "GLCpts", + "lower_bound": 0.0, + "metabolites": { + "g6p_c": 1.0, + "glc__D_e": -1.0, + "pep_c": -1.0, + "pyr_c": 1.0 + }, + "name": "D-glucose transport via PEP:Pyr PTS", + "upper_bound": 1000.0 + }, + { + "annotation": { + "bigg.reaction": "H2Ot" + }, + "gene_reaction_rule": "b0875 or s0001", + "id": "H2Ot", + "lower_bound": -1000.0, + "metabolites": { + "h2o_c": 1.0, + "h2o_e": -1.0 + }, + "name": "R H2O transport via - diffusion", + "upper_bound": 1000.0 + }, + { + "gene_reaction_rule": "b2133 or b1380", + "id": "LDH_D", + "lower_bound": -1000.0, + "metabolites": { + "h_c": 1.0, + "lac__D_c": -1.0, + "nad_c": -1.0, + "nadh_c": 1.0, + "pyr_c": 1.0 + }, + "name": "D-lactate dehydrogenase", + "upper_bound": 1000.0 + }, + { + "annotation": { + "bigg.reaction": "PFK" + }, + "gene_reaction_rule": "b3916 or b1723", + "id": "PFK", + "lower_bound": 0.0, + "metabolites": { + "adp_c": 1.0, + "atp_c": -1.0, + "f6p_c": -1.0, + "fdp_c": 1.0, + "h_c": 1.0 + }, + "name": "phosphofructokinase", + "objective_coefficient": 1.0, + "upper_bound": 1000.0 + }, + { + "annotation": { + "bigg.reaction": "PGI" + }, + "gene_reaction_rule": "b4025", + "id": "PGI", + "lower_bound": -1000.0, + "metabolites": { + "f6p_c": 1.0, + "g6p_c": -1.0 + }, + "name": "glucose-6-phosphate isomerase", + "upper_bound": 1000.0 + }, + { + "annotation": { + "bigg.reaction": "PGK" + }, + "gene_reaction_rule": "b2926", + "id": "PGK", + "lower_bound": -1000.0, + "metabolites": { + "13dpg_c": 1.0, + "3pg_c": -1.0, + "adp_c": 1.0, + "atp_c": -1.0 + }, + "name": "phosphoglycerate kinase", + "upper_bound": 1000.0 + }, + { + "annotation": { + "bigg.reaction": "PGM" + }, + "gene_reaction_rule": "b4395 or b3612 or b0755", + "id": "PGM", + "lower_bound": -1000.0, + "metabolites": { + "2pg_c": -1.0, + "3pg_c": 1.0 + }, + "name": "phosphoglycerate mutase", + "upper_bound": 1000.0 + }, + { + "annotation": { + "bigg.reaction": "PIt2r" + }, + "gene_reaction_rule": "b2987 or b3493", + "id": "PIt2r", + "lower_bound": -1000.0, + "metabolites": { + "h_c": 1.0, + "h_e": -1.0, + "pi_c": 1.0, + "pi_e": -1.0 + }, + "name": "R phosphate reversible transport via - symport", + "upper_bound": 1000.0 + }, + { + "annotation": { + "bigg.reaction": "PYK" + }, + "gene_reaction_rule": "b1854 or b1676", + "id": "PYK", + "lower_bound": 0.0, + "metabolites": { + "adp_c": -1.0, + "atp_c": 1.0, + "h_c": -1.0, + "pep_c": -1.0, + "pyr_c": 1.0 + }, + "name": "pyruvate kinase", + "upper_bound": 1000.0 + }, + { + "annotation": { + "bigg.reaction": "TPI" + }, + "gene_reaction_rule": "b3919", + "id": "TPI", + "lower_bound": -1000.0, + "metabolites": { + "dhap_c": -1.0, + "g3p_c": 1.0 + }, + "name": "triose-phosphate isomerase", + "upper_bound": 1000.0 + } + ], + "version": "1" } \ No newline at end of file diff --git a/cobra/test/data/mini.mat b/cobra/test/data/mini.mat index b201f6b64..627b56033 100644 Binary files a/cobra/test/data/mini.mat and b/cobra/test/data/mini.mat differ diff --git a/cobra/test/data/mini.pickle b/cobra/test/data/mini.pickle index 0f4b6ae22..7feb9419d 100644 Binary files a/cobra/test/data/mini.pickle and b/cobra/test/data/mini.pickle differ diff --git a/cobra/test/data/mini.yml b/cobra/test/data/mini.yml index 9850d2ff1..a8c5ba6bf 100644 --- a/cobra/test/data/mini.yml +++ b/cobra/test/data/mini.yml @@ -6,38 +6,31 @@ - compartment: c - charge: -4 - formula: C3H4O10P2 - - annotation: - pubchem.substance: '3535' - biocyc: DPG - kegg.compound: C00236 - seed.compound: cpd00203 - reactome: REACT_29800 - bigg.metabolite: 13dpg - hmdb: HMDB01270 - chebi: + - annotation: !!omap + - bigg.metabolite: 13dpg + - biocyc: DPG + - chebi: - CHEBI:16001 - CHEBI:1658 - CHEBI:20189 - CHEBI:57604 - CHEBI:11881 - unipathway.compound: UPC00236 + - hmdb: HMDB01270 + - kegg.compound: C00236 + - pubchem.substance: '3535' + - reactome: REACT_29800 + - seed.compound: cpd00203 + - unipathway.compound: UPC00236 - !!omap - id: 2pg_c - name: D-Glycerate 2-phosphate - compartment: c - charge: -3 - formula: C3H4O7P - - annotation: - pubchem.substance: '3904' - biocyc: 2-PG - kegg.compound: C00631 - seed.compound: cpd00482 - reactome: REACT_30485 - bigg.metabolite: 2pg - hmdb: - - HMDB03391 - - HMDB00362 - chebi: + - annotation: !!omap + - bigg.metabolite: 2pg + - biocyc: 2-PG + - chebi: - CHEBI:1267 - CHEBI:58289 - CHEBI:17835 @@ -46,24 +39,24 @@ - CHEBI:12986 - CHEBI:24344 - CHEBI:39868 - unipathway.compound: UPC00631 + - hmdb: + - HMDB03391 + - HMDB00362 + - kegg.compound: C00631 + - pubchem.substance: '3904' + - reactome: REACT_30485 + - seed.compound: cpd00482 + - unipathway.compound: UPC00631 - !!omap - id: 3pg_c - name: 3-Phospho-D-glycerate - compartment: c - charge: -3 - formula: C3H4O7P - - annotation: - pubchem.substance: '3497' - biocyc: G3P - kegg.compound: - - C00197 - - C00597 - seed.compound: cpd00169 - reactome: REACT_29728 - bigg.metabolite: 3pg - hmdb: HMDB00807 - chebi: + - annotation: !!omap + - bigg.metabolite: 3pg + - biocyc: G3P + - chebi: - CHEBI:40016 - CHEBI:58272 - CHEBI:57998 @@ -77,7 +70,14 @@ - CHEBI:12987 - CHEBI:17794 - CHEBI:24345 - unipathway.compound: + - hmdb: HMDB00807 + - kegg.compound: + - C00197 + - C00597 + - pubchem.substance: '3497' + - reactome: REACT_29728 + - seed.compound: cpd00169 + - unipathway.compound: - UPC00597 - UPC00197 - !!omap @@ -86,21 +86,26 @@ - compartment: c - charge: -3 - formula: C10H12N5O10P2 - - annotation: - kegg.glycan: G11113 - biocyc: + - annotation: !!omap + - bigg.metabolite: adp + - biocyc: - ADP - ADP-GROUP - chebi: + - cas: + - 58-64-0 + - 58-64-0 + - chebi: - CHEBI:13222 - CHEBI:16761 - CHEBI:2342 - CHEBI:22244 - CHEBI:40553 - CHEBI:456216 - unipathway.compound: UPC00008 - seed.compound: cpd00008 - reactome: + - hmdb: HMDB01341 + - kegg.compound: C00008 + - kegg.glycan: G11113 + - pubchem.substance: '3310' + - reactome: - REACT_190072 - REACT_481002 - REACT_211606 @@ -112,23 +117,21 @@ - REACT_114564 - REACT_114565 - REACT_429153 - bigg.metabolite: adp - hmdb: HMDB01341 - pubchem.substance: '3310' - cas: - - 58-64-0 - - 58-64-0 - kegg.compound: C00008 + - seed.compound: cpd00008 + - unipathway.compound: UPC00008 - !!omap - id: atp_c - name: ATP - compartment: c - charge: -4 - formula: C10H12N5O13P3 - - annotation: - pubchem.substance: '3304' - biocyc: ATP - chebi: + - annotation: !!omap + - bigg.metabolite: atp + - biocyc: ATP + - cas: + - 56-65-5 + - 56-65-5 + - chebi: - CHEBI:40938 - CHEBI:15422 - CHEBI:57299 @@ -138,9 +141,11 @@ - CHEBI:22249 - CHEBI:10841 - CHEBI:2359 - unipathway.compound: UPC00002 - seed.compound: cpd00002 - reactome: + - hmdb: HMDB00538 + - kegg.compound: C00002 + - kegg.drug: D08646 + - pubchem.substance: '3304' + - reactome: - REACT_190078 - REACT_113592 - REACT_113593 @@ -149,23 +154,21 @@ - REACT_389573 - REACT_139836 - REACT_211579 - bigg.metabolite: atp - hmdb: HMDB00538 - kegg.drug: D08646 - cas: - - 56-65-5 - - 56-65-5 - kegg.compound: C00002 + - seed.compound: cpd00002 + - unipathway.compound: UPC00002 - !!omap - id: dhap_c - name: Dihydroxyacetone phosphate - compartment: c - charge: -2 - formula: C3H5O6P - - annotation: - pubchem.substance: '3411' - biocyc: DIHYDROXY-ACETONE-PHOSPHATE - chebi: + - annotation: !!omap + - bigg.metabolite: dhap + - biocyc: DIHYDROXY-ACETONE-PHOSPHATE + - cas: + - 57-04-5 + - 57-04-5 + - chebi: - CHEBI:14341 - CHEBI:57642 - CHEBI:14342 @@ -173,30 +176,30 @@ - CHEBI:5454 - CHEBI:24355 - CHEBI:39571 - unipathway.compound: UPC00111 - seed.compound: cpd00095 - reactome: + - hmdb: + - HMDB01473 + - HMDB11735 + - kegg.compound: C00111 + - pubchem.substance: '3411' + - reactome: - REACT_188451 - REACT_75970 - REACT_390404 - bigg.metabolite: dhap - hmdb: - - HMDB01473 - - HMDB11735 - cas: - - 57-04-5 - - 57-04-5 - kegg.compound: C00111 + - seed.compound: cpd00095 + - unipathway.compound: UPC00111 - !!omap - id: f6p_c - name: D-Fructose 6-phosphate - compartment: c - charge: -2 - formula: C6H11O9P - - annotation: - pubchem.substance: '3385' - biocyc: FRUCTOSE-6P - chebi: + - annotation: !!omap + - bigg.metabolite: f6p + - biocyc: FRUCTOSE-6P + - cas: + - 643-13-0 + - 643-13-0 + - chebi: - CHEBI:57634 - CHEBI:12352 - CHEBI:45804 @@ -206,28 +209,28 @@ - CHEBI:16084 - CHEBI:42378 - CHEBI:22768 - unipathway.compound: - - UPC05345 - - UPC00085 - seed.compound: cpd00072 - bigg.metabolite: f6p - hmdb: HMDB03971 - cas: - - 643-13-0 - - 643-13-0 - kegg.compound: + - hmdb: HMDB03971 + - kegg.compound: - C05345 - C00085 + - pubchem.substance: '3385' + - seed.compound: cpd00072 + - unipathway.compound: + - UPC05345 + - UPC00085 - !!omap - id: fdp_c - name: D-Fructose 1,6-bisphosphate - compartment: c - charge: -4 - formula: C6H10O12P2 - - annotation: - pubchem.substance: '3647' - biocyc: FRUCTOSE-16-DIPHOSPHATE - chebi: + - annotation: !!omap + - bigg.metabolite: fdp + - biocyc: FRUCTOSE-16-DIPHOSPHATE + - cas: + - 488-69-7 + - 488-69-7 + - chebi: - CHEBI:32968 - CHEBI:49299 - CHEBI:42553 @@ -240,52 +243,52 @@ - CHEBI:10374 - CHEBI:40595 - CHEBI:40591 - unipathway.compound: UPC00354 - seed.compound: cpd00290 - bigg.metabolite: fdp - cas: - - 488-69-7 - - 488-69-7 - kegg.compound: + - kegg.compound: - C05378 - C00354 + - pubchem.substance: '3647' + - seed.compound: cpd00290 + - unipathway.compound: UPC00354 - !!omap - id: g3p_c - name: Glyceraldehyde 3-phosphate - compartment: c - charge: -2 - formula: C3H5O6P - - annotation: - pubchem.substance: '3930' - chebi: + - annotation: !!omap + - bigg.metabolite: g3p + - cas: + - 142-10-9 + - 142-10-9 + - chebi: - CHEBI:17138 - CHEBI:14333 - CHEBI:5446 - CHEBI:58027 - unipathway.compound: - - UPC00661 - - UPC00118 - seed.compound: cpd00102 - bigg.metabolite: g3p - hmdb: HMDB01112 - cas: - - 142-10-9 - - 142-10-9 - kegg.compound: + - hmdb: HMDB01112 + - kegg.compound: - C00661 - C00118 + - pubchem.substance: '3930' + - seed.compound: cpd00102 + - unipathway.compound: + - UPC00661 + - UPC00118 - !!omap - id: g6p_c - name: D-Glucose 6-phosphate - compartment: c - charge: -2 - formula: C6H11O9P - - annotation: - pubchem.substance: '3392' - biocyc: + - annotation: !!omap + - bigg.metabolite: g6p + - biocyc: - D-glucose-6-phosphate - GLC-6-P - chebi: + - cas: + - 56-73-5 + - 56-73-5 + - chebi: - CHEBI:10399 - CHEBI:22797 - CHEBI:41041 @@ -294,47 +297,47 @@ - CHEBI:61548 - CHEBI:58247 - CHEBI:12375 - unipathway.compound: UPC00092 - seed.compound: cpd00079 - reactome: REACT_1629756 - bigg.metabolite: g6p - hmdb: + - hmdb: - HMDB03498 - HMDB06793 - HMDB01401 - HMDB01549 - cas: - - 56-73-5 - - 56-73-5 - kegg.compound: + - kegg.compound: - C00092 - C01172 + - pubchem.substance: '3392' + - reactome: REACT_1629756 + - seed.compound: cpd00079 + - unipathway.compound: UPC00092 - !!omap - id: glc__D_e - name: D-Glucose - compartment: e - charge: 0 - formula: C6H12O6 - - annotation: - bigg.metabolite: glc__D - pubchem.substance: '3333' - cas: + - annotation: !!omap + - bigg.metabolite: glc__D + - cas: - 50-99-7 - 50-99-7 - kegg.compound: C00031 + - kegg.compound: C00031 + - pubchem.substance: '3333' - !!omap - id: h2o_c - name: H2O - compartment: c - charge: 0 - formula: H2O - - annotation: - pubchem.substance: '3303' - biocyc: + - annotation: !!omap + - bigg.metabolite: h2o + - biocyc: - WATER - OH - OXONIUM - chebi: + - cas: + - 7732-18-5 + - 7732-18-5 + - chebi: - CHEBI:15377 - CHEBI:13365 - CHEBI:41979 @@ -363,13 +366,20 @@ - CHEBI:5585 - CHEBI:44641 - CHEBI:44701 - unipathway.compound: - - UPC00001 - - UPC01328 - seed.compound: - - cpd15275 - - cpd00001 - reactome: + - hmdb: + - HMDB01039 + - HMDB02111 + - kegg.compound: + - C01328 + - C00001 + - C18714 + - C18712 + - kegg.drug: + - D00001 + - D06322 + - D03703 + - pubchem.substance: '3303' + - reactome: - REACT_947593 - REACT_189422 - REACT_141343 @@ -381,35 +391,28 @@ - REACT_2022884 - REACT_351603 - REACT_29356 - bigg.metabolite: h2o - hmdb: - - HMDB01039 - - HMDB02111 - kegg.drug: - - D00001 - - D06322 - - D03703 - cas: - - 7732-18-5 - - 7732-18-5 - kegg.compound: - - C01328 - - C00001 - - C18714 - - C18712 + - seed.compound: + - cpd15275 + - cpd00001 + - unipathway.compound: + - UPC00001 + - UPC01328 - !!omap - id: h2o_e - name: H2O - compartment: e - charge: 0 - formula: H2O - - annotation: - pubchem.substance: '3303' - biocyc: + - annotation: !!omap + - bigg.metabolite: h2o + - biocyc: - WATER - OH - OXONIUM - chebi: + - cas: + - 7732-18-5 + - 7732-18-5 + - chebi: - CHEBI:15377 - CHEBI:13365 - CHEBI:41979 @@ -438,13 +441,20 @@ - CHEBI:5585 - CHEBI:44641 - CHEBI:44701 - unipathway.compound: - - UPC00001 - - UPC01328 - seed.compound: - - cpd15275 - - cpd00001 - reactome: + - hmdb: + - HMDB01039 + - HMDB02111 + - kegg.compound: + - C01328 + - C00001 + - C18714 + - C18712 + - kegg.drug: + - D00001 + - D06322 + - D03703 + - pubchem.substance: '3303' + - reactome: - REACT_947593 - REACT_189422 - REACT_141343 @@ -456,40 +466,33 @@ - REACT_2022884 - REACT_351603 - REACT_29356 - bigg.metabolite: h2o - hmdb: - - HMDB01039 - - HMDB02111 - kegg.drug: - - D00001 - - D06322 - - D03703 - cas: - - 7732-18-5 - - 7732-18-5 - kegg.compound: - - C01328 - - C00001 - - C18714 - - C18712 + - seed.compound: + - cpd15275 + - cpd00001 + - unipathway.compound: + - UPC00001 + - UPC01328 - !!omap - id: h_c - name: H+ - compartment: c - charge: 1 - formula: H - - annotation: - pubchem.substance: '3380' - biocyc: PROTON - chebi: + - annotation: !!omap + - bigg.metabolite: h + - biocyc: PROTON + - cas: + - 12408-02-5 + - 12408-02-5 + - chebi: - CHEBI:24636 - CHEBI:15378 - CHEBI:10744 - CHEBI:13357 - CHEBI:5584 - unipathway.compound: UPC00080 - seed.compound: cpd00067 - reactome: + - kegg.compound: C00080 + - pubchem.substance: '3380' + - reactome: - REACT_194688 - REACT_425978 - REACT_193465 @@ -509,29 +512,29 @@ - REACT_1614597 - REACT_351626 - REACT_427899 - bigg.metabolite: h - cas: - - 12408-02-5 - - 12408-02-5 - kegg.compound: C00080 + - seed.compound: cpd00067 + - unipathway.compound: UPC00080 - !!omap - id: h_e - name: H+ - compartment: e - charge: 1 - formula: H - - annotation: - pubchem.substance: '3380' - biocyc: PROTON - chebi: + - annotation: !!omap + - bigg.metabolite: h + - biocyc: PROTON + - cas: + - 12408-02-5 + - 12408-02-5 + - chebi: - CHEBI:24636 - CHEBI:15378 - CHEBI:10744 - CHEBI:13357 - CHEBI:5584 - unipathway.compound: UPC00080 - seed.compound: cpd00067 - reactome: + - kegg.compound: C00080 + - pubchem.substance: '3380' + - reactome: - REACT_194688 - REACT_425978 - REACT_193465 @@ -551,11 +554,8 @@ - REACT_1614597 - REACT_351626 - REACT_427899 - bigg.metabolite: h - cas: - - 12408-02-5 - - 12408-02-5 - kegg.compound: C00080 + - seed.compound: cpd00067 + - unipathway.compound: UPC00080 - !!omap - id: lac__D_c - name: D-Lactate @@ -574,10 +574,13 @@ - compartment: c - charge: -1 - formula: C21H26N7O14P2 - - annotation: - pubchem.substance: '3305' - biocyc: NAD - chebi: + - annotation: !!omap + - bigg.metabolite: nad + - biocyc: NAD + - cas: + - 53-84-9 + - 53-84-9 + - chebi: - CHEBI:21901 - CHEBI:7422 - CHEBI:44214 @@ -588,31 +591,31 @@ - CHEBI:13389 - CHEBI:57540 - CHEBI:44281 - unipathway.compound: UPC00003 - seed.compound: cpd00003 - reactome: + - hmdb: HMDB00902 + - kegg.compound: C00003 + - kegg.drug: D00002 + - pubchem.substance: '3305' + - reactome: - REACT_192307 - REACT_29360 - REACT_427523 - REACT_194653 - REACT_113526 - bigg.metabolite: nad - hmdb: HMDB00902 - kegg.drug: D00002 - cas: - - 53-84-9 - - 53-84-9 - kegg.compound: C00003 + - seed.compound: cpd00003 + - unipathway.compound: UPC00003 - !!omap - id: nadh_c - name: Nicotinamide adenine dinucleotide - reduced - compartment: c - charge: -2 - formula: C21H27N7O14P2 - - annotation: - pubchem.substance: '3306' - biocyc: NADH - chebi: + - annotation: !!omap + - bigg.metabolite: nadh + - biocyc: NADH + - cas: + - 58-68-4 + - 58-68-4 + - chebi: - CHEBI:13395 - CHEBI:21902 - CHEBI:16908 @@ -620,29 +623,29 @@ - CHEBI:44216 - CHEBI:57945 - CHEBI:13396 - unipathway.compound: UPC00004 - seed.compound: cpd00004 - reactome: + - hmdb: HMDB01487 + - kegg.compound: C00004 + - pubchem.substance: '3306' + - reactome: - REACT_192305 - REACT_73473 - REACT_194697 - REACT_29362 - bigg.metabolite: nadh - hmdb: HMDB01487 - cas: - - 58-68-4 - - 58-68-4 - kegg.compound: C00004 + - seed.compound: cpd00004 + - unipathway.compound: UPC00004 - !!omap - id: pep_c - name: Phosphoenolpyruvate - compartment: c - charge: -3 - formula: C3H2O6P - - annotation: - pubchem.substance: '3374' - biocyc: PHOSPHO-ENOL-PYRUVATE - chebi: + - annotation: !!omap + - bigg.metabolite: pep + - biocyc: PHOSPHO-ENOL-PYRUVATE + - cas: + - 138-08-9 + - 138-08-9 + - chebi: - CHEBI:44897 - CHEBI:44894 - CHEBI:14812 @@ -651,30 +654,30 @@ - CHEBI:26054 - CHEBI:58702 - CHEBI:18021 - unipathway.compound: UPC00074 - seed.compound: cpd00061 - reactome: + - hmdb: HMDB00263 + - kegg.compound: C00074 + - pubchem.substance: '3374' + - reactome: - REACT_29492 - REACT_372364 - bigg.metabolite: pep - hmdb: HMDB00263 - cas: - - 138-08-9 - - 138-08-9 - kegg.compound: C00074 + - seed.compound: cpd00061 + - unipathway.compound: UPC00074 - !!omap - id: pi_c - name: Phosphate - compartment: c - charge: -2 - formula: HO4P - - annotation: - pubchem.substance: '3311' - biocyc: + - annotation: !!omap + - bigg.metabolite: pi + - biocyc: - Pi - PHOSPHATE-GROUP - CPD0-1421 - chebi: + - cas: + - 14265-44-2 + - 14265-44-2 + - chebi: - CHEBI:37583 - CHEBI:7793 - CHEBI:37585 @@ -699,12 +702,14 @@ - CHEBI:26078 - CHEBI:39745 - CHEBI:24838 - unipathway.compound: UPC00009 - seed.compound: - - cpd09464 - - cpd09463 - - cpd00009 - reactome: + - hmdb: HMDB02142 + - kegg.compound: + - C13556 + - C13558 + - C00009 + - kegg.drug: D05467 + - pubchem.substance: '3311' + - reactome: - REACT_947590 - REACT_109277 - REACT_113548 @@ -712,29 +717,27 @@ - REACT_29372 - REACT_113550 - REACT_113551 - bigg.metabolite: pi - hmdb: HMDB02142 - kegg.drug: D05467 - cas: - - 14265-44-2 - - 14265-44-2 - kegg.compound: - - C13556 - - C13558 - - C00009 + - seed.compound: + - cpd09464 + - cpd09463 + - cpd00009 + - unipathway.compound: UPC00009 - !!omap - id: pi_e - name: Phosphate - compartment: e - charge: -2 - formula: HO4P - - annotation: - pubchem.substance: '3311' - biocyc: + - annotation: !!omap + - bigg.metabolite: pi + - biocyc: - Pi - PHOSPHATE-GROUP - CPD0-1421 - chebi: + - cas: + - 14265-44-2 + - 14265-44-2 + - chebi: - CHEBI:37583 - CHEBI:7793 - CHEBI:37585 @@ -759,12 +762,14 @@ - CHEBI:26078 - CHEBI:39745 - CHEBI:24838 - unipathway.compound: UPC00009 - seed.compound: - - cpd09464 - - cpd09463 - - cpd00009 - reactome: + - hmdb: HMDB02142 + - kegg.compound: + - C13556 + - C13558 + - C00009 + - kegg.drug: D05467 + - pubchem.substance: '3311' + - reactome: - REACT_947590 - REACT_109277 - REACT_113548 @@ -772,26 +777,24 @@ - REACT_29372 - REACT_113550 - REACT_113551 - bigg.metabolite: pi - hmdb: HMDB02142 - kegg.drug: D05467 - cas: - - 14265-44-2 - - 14265-44-2 - kegg.compound: - - C13556 - - C13558 - - C00009 + - seed.compound: + - cpd09464 + - cpd09463 + - cpd00009 + - unipathway.compound: UPC00009 - !!omap - id: pyr_c - name: Pyruvate - compartment: c - charge: -1 - formula: C3H3O3 - - annotation: - pubchem.substance: '3324' - biocyc: PYRUVATE - chebi: + - annotation: !!omap + - bigg.metabolite: pyr + - biocyc: PYRUVATE + - cas: + - 127-17-3 + - 127-17-3 + - chebi: - CHEBI:15361 - CHEBI:14987 - CHEBI:8685 @@ -799,19 +802,16 @@ - CHEBI:45253 - CHEBI:26466 - CHEBI:26462 - lipidmaps: LMFA01060077 - seed.compound: cpd00020 - kegg.compound: C00022 - reactome: + - hmdb: HMDB00243 + - kegg.compound: C00022 + - lipidmaps: LMFA01060077 + - pubchem.substance: '3324' + - reactome: - REACT_113557 - REACT_389680 - REACT_29398 - bigg.metabolite: pyr - hmdb: HMDB00243 - cas: - - 127-17-3 - - 127-17-3 - unipathway.compound: UPC00022 + - seed.compound: cpd00020 + - unipathway.compound: UPC00022 - reactions: - !!omap - id: ATPM @@ -826,8 +826,8 @@ - upper_bound: 1000.0 - gene_reaction_rule: '' - objective_coefficient: 1.0 - - annotation: - bigg.reaction: ATPM + - annotation: !!omap + - bigg.reaction: ATPM - !!omap - id: D_LACt2 - name: '' @@ -849,8 +849,8 @@ - lower_bound: -1000.0 - upper_bound: 1000.0 - gene_reaction_rule: b2779 - - annotation: - bigg.reaction: ENO + - annotation: !!omap + - bigg.reaction: ENO - !!omap - id: EX_glc__D_e - name: D-Glucose exchange @@ -859,9 +859,9 @@ - lower_bound: -10.0 - upper_bound: 1000.0 - gene_reaction_rule: '' - - annotation: - bigg.reaction: glc - SBO: SBO:0000627 + - annotation: !!omap + - SBO: SBO:0000627 + - bigg.reaction: glc - !!omap - id: EX_h_e - name: H+ exchange @@ -870,9 +870,9 @@ - lower_bound: -1000.0 - upper_bound: 1000.0 - gene_reaction_rule: '' - - annotation: - bigg.reaction: h - SBO: SBO:0000627 + - annotation: !!omap + - SBO: SBO:0000627 + - bigg.reaction: h - !!omap - id: EX_lac__D_e - name: D-lactate exchange @@ -891,8 +891,8 @@ - lower_bound: -1000.0 - upper_bound: 1000.0 - gene_reaction_rule: b1773 or b2097 or b2925 - - annotation: - bigg.reaction: FBA + - annotation: !!omap + - bigg.reaction: FBA - !!omap - id: GAPD - name: glyceraldehyde-3-phosphate dehydrogenase @@ -906,8 +906,8 @@ - lower_bound: -1000.0 - upper_bound: 1000.0 - gene_reaction_rule: b1779 - - annotation: - bigg.reaction: GAPD + - annotation: !!omap + - bigg.reaction: GAPD - !!omap - id: GLCpts - name: D-glucose transport via PEP:Pyr PTS @@ -920,8 +920,8 @@ - upper_bound: 1000.0 - gene_reaction_rule: ( b2417 and b1621 and b2415 and b2416 ) or ( b2417 and b1101 and b2415 and b2416 ) or ( b1817 and b1818 and b1819 and b2415 and b2416 ) - - annotation: - bigg.reaction: GLCpts + - annotation: !!omap + - bigg.reaction: GLCpts - !!omap - id: H2Ot - name: R H2O transport via - diffusion @@ -931,8 +931,8 @@ - lower_bound: -1000.0 - upper_bound: 1000.0 - gene_reaction_rule: b0875 or s0001 - - annotation: - bigg.reaction: H2Ot + - annotation: !!omap + - bigg.reaction: H2Ot - !!omap - id: LDH_D - name: D-lactate dehydrogenase @@ -958,8 +958,8 @@ - upper_bound: 1000.0 - gene_reaction_rule: b3916 or b1723 - objective_coefficient: 1.0 - - annotation: - bigg.reaction: PFK + - annotation: !!omap + - bigg.reaction: PFK - !!omap - id: PGI - name: glucose-6-phosphate isomerase @@ -969,8 +969,8 @@ - lower_bound: -1000.0 - upper_bound: 1000.0 - gene_reaction_rule: b4025 - - annotation: - bigg.reaction: PGI + - annotation: !!omap + - bigg.reaction: PGI - !!omap - id: PGK - name: phosphoglycerate kinase @@ -982,8 +982,8 @@ - lower_bound: -1000.0 - upper_bound: 1000.0 - gene_reaction_rule: b2926 - - annotation: - bigg.reaction: PGK + - annotation: !!omap + - bigg.reaction: PGK - !!omap - id: PGM - name: phosphoglycerate mutase @@ -993,8 +993,8 @@ - lower_bound: -1000.0 - upper_bound: 1000.0 - gene_reaction_rule: b4395 or b3612 or b0755 - - annotation: - bigg.reaction: PGM + - annotation: !!omap + - bigg.reaction: PGM - !!omap - id: PIt2r - name: R phosphate reversible transport via - symport @@ -1006,8 +1006,8 @@ - lower_bound: -1000.0 - upper_bound: 1000.0 - gene_reaction_rule: b2987 or b3493 - - annotation: - bigg.reaction: PIt2r + - annotation: !!omap + - bigg.reaction: PIt2r - !!omap - id: PYK - name: pyruvate kinase @@ -1020,8 +1020,8 @@ - lower_bound: 0.0 - upper_bound: 1000.0 - gene_reaction_rule: b1854 or b1676 - - annotation: - bigg.reaction: PYK + - annotation: !!omap + - bigg.reaction: PYK - !!omap - id: TPI - name: triose-phosphate isomerase @@ -1031,8 +1031,8 @@ - lower_bound: -1000.0 - upper_bound: 1000.0 - gene_reaction_rule: b3919 - - annotation: - bigg.reaction: TPI + - annotation: !!omap + - bigg.reaction: TPI - genes: - !!omap - id: b0755 @@ -1052,8 +1052,8 @@ - !!omap - id: b1676 - name: pykF - - annotation: - ncbigi: + - annotation: !!omap + - ncbigi: - GI:1208453 - GI:1652654 - !!omap @@ -1095,16 +1095,16 @@ - !!omap - id: b2779 - name: eno - - annotation: - ncbigi: GI:1653839 + - annotation: !!omap + - ncbigi: GI:1653839 - !!omap - id: b2925 - name: fbaA - !!omap - id: b2926 - name: pgk - - annotation: - ncbigi: GI:1653609 + - annotation: !!omap + - ncbigi: GI:1653609 - !!omap - id: b2975 - name: glcA @@ -1123,8 +1123,8 @@ - !!omap - id: b3916 - name: pfkA - - annotation: - ncbigi: + - annotation: !!omap + - ncbigi: - GI:1006614 - GI:1651919 - !!omap @@ -1133,20 +1133,20 @@ - !!omap - id: b4025 - name: pgi - - annotation: - ncbigi: GI:1653253 + - annotation: !!omap + - ncbigi: GI:1653253 - !!omap - id: b4395 - name: ytjC - !!omap - id: s0001 - name: G_s0001 -- id: mini_textbook - compartments: - !!omap - - id: e - - name: extracellular + - id: c + - name: cytosol - !!omap - - id: c - - name: cytosol + - id: e + - name: extracellular +- id: mini_textbook - version: '1.2' diff --git a/cobra/test/data/mini_cobra.xml b/cobra/test/data/mini_cobra.xml index a9861ea60..edfccd336 100644 --- a/cobra/test/data/mini_cobra.xml +++ b/cobra/test/data/mini_cobra.xml @@ -201,12 +201,12 @@ - + - + @@ -214,8 +214,8 @@ FLUX_VALUE - + @@ -232,16 +232,16 @@ - + FLUX_VALUE - + @@ -257,16 +257,16 @@ - + FLUX_VALUE - + @@ -284,8 +284,8 @@ FLUX_VALUE - + @@ -303,8 +303,8 @@ FLUX_VALUE - + @@ -322,8 +322,8 @@ FLUX_VALUE - + @@ -339,16 +339,16 @@ - + FLUX_VALUE - + @@ -362,21 +362,21 @@ - + - + FLUX_VALUE - + @@ -389,8 +389,8 @@ - + @@ -401,8 +401,8 @@ FLUX_VALUE - + @@ -425,8 +425,8 @@ FLUX_VALUE - + @@ -439,21 +439,21 @@ - + + - FLUX_VALUE - + @@ -471,16 +471,16 @@ - + FLUX_VALUE - + @@ -503,8 +503,8 @@ FLUX_VALUE - + @@ -521,16 +521,16 @@ - + FLUX_VALUE - + @@ -553,8 +553,8 @@ FLUX_VALUE - + @@ -579,8 +579,8 @@ FLUX_VALUE - + @@ -594,20 +594,20 @@ - + - + FLUX_VALUE - + @@ -630,8 +630,8 @@ FLUX_VALUE - + diff --git a/cobra/test/data/mini_fbc1.xml b/cobra/test/data/mini_fbc1.xml index 1676698cd..eddeda5e7 100644 --- a/cobra/test/data/mini_fbc1.xml +++ b/cobra/test/data/mini_fbc1.xml @@ -308,12 +308,12 @@ - + - + @@ -328,8 +328,8 @@ - + @@ -342,8 +342,8 @@ - + @@ -380,8 +380,8 @@ - + @@ -392,13 +392,13 @@ - + - + @@ -408,8 +408,8 @@ - + @@ -436,13 +436,13 @@ - + + - @@ -457,8 +457,8 @@ - + @@ -485,8 +485,8 @@ - + @@ -525,12 +525,12 @@ - + - + diff --git a/cobra/test/data/mini_fbc2.xml.gz b/cobra/test/data/mini_fbc2.xml.gz index 66118bdaf..301215565 100644 Binary files a/cobra/test/data/mini_fbc2.xml.gz and b/cobra/test/data/mini_fbc2.xml.gz differ diff --git a/cobra/test/data/raven.pickle b/cobra/test/data/raven.pickle index 70a1d7e2c..b31f252df 100644 Binary files a/cobra/test/data/raven.pickle and b/cobra/test/data/raven.pickle differ diff --git a/cobra/test/data/salmonella.pickle b/cobra/test/data/salmonella.pickle index 1c30b036e..e4d65505e 100644 Binary files a/cobra/test/data/salmonella.pickle and b/cobra/test/data/salmonella.pickle differ diff --git a/cobra/test/data/textbook_fva.json b/cobra/test/data/textbook_fva.json index 84f685f75..29f5a6db1 100644 --- a/cobra/test/data/textbook_fva.json +++ b/cobra/test/data/textbook_fva.json @@ -1 +1 @@ -{"maximum": {"ACALD": 0.0, "ACALDt": 0.0, "ACKr": 0.0, "ACONTa": 6.00725, "ACONTb": 6.00725, "ACt2r": 0.0, "ADK1": -0.0, "AKGDH": 5.06438, "AKGt2r": 0.0, "ALCD2x": 0.0, "ATPM": 8.39, "ATPS4r": 45.51401, "Biomass_Ecoli_core": 0.87392, "CO2t": -22.80983, "CS": 6.00725, "CYTBD": 43.59899, "D_LACt2": 0.0, "ENO": 14.71614, "ETOHt2r": 0.0, "EX_ac_e": -0.0, "EX_acald_e": -0.0, "EX_akg_e": -0.0, "EX_co2_e": 22.80983, "EX_etoh_e": -0.0, "EX_for_e": -0.0, "EX_fru_e": -0.0, "EX_fum_e": 0.0, "EX_glc__D_e": -10.0, "EX_gln__L_e": 0.0, "EX_glu__L_e": -0.0, "EX_h_e": 17.53087, "EX_h2o_e": 29.17583, "EX_lac__D_e": -0.0, "EX_mal__L_e": -0.0, "EX_nh4_e": -4.76532, "EX_o2_e": -21.79949, "EX_pi_e": -3.2149, "EX_pyr_e": -0.0, "EX_succ_e": -0.0, "FBA": 7.47738, "FBP": -0.0, "FORt2": -0.0, "FORti": -0.0, "FRD7": 994.93562, "FRUpts2": 0.0, "FUM": 5.06438, "FUMt2_2": 0.0, "G6PDH2r": 4.95998, "GAPD": 16.02353, "GLCpts": 10.0, "GLNS": 0.22346, "GLNabc": 0.0, "GLUDy": -4.54186, "GLUN": -0.0, "GLUSy": -0.0, "GLUt2r": 0.0, "GND": 4.95998, "H2Ot": -29.17583, "ICDHyr": 6.00725, "ICL": -0.0, "LDH_D": 0.0, "MALS": -0.0, "MALt2_2": 0.0, "MDH": 5.06438, "ME1": -0.0, "ME2": -0.0, "NADH16": 38.53461, "NADTRHD": -0.0, "NH4t": 4.76532, "O2t": 21.79949, "PDH": 9.28253, "PFK": 7.47738, "PFL": -0.0, "PGI": 4.86086, "PGK": -16.02353, "PGL": 4.95998, "PGM": -14.71614, "PIt2r": 3.2149, "PPC": 2.50431, "PPCK": -0.0, "PPS": -0.0, "PTAr": -0.0, "PYK": 1.75818, "PYRt2": 0.0, "RPE": 2.67848, "RPI": -2.2815, "SUCCt2_2": -0.0, "SUCCt3": -0.0, "SUCDi": 1000.0, "SUCOAS": -5.06438, "TALA": 1.49698, "THD2": -0.0, "TKT1": 1.49698, "TKT2": 1.1815, "TPI": 7.47738}, "minimum": {"ACALD": 0.0, "ACALDt": 0.0, "ACKr": 0.0, "ACONTa": 6.00725, "ACONTb": 6.00725, "ACt2r": 0.0, "ADK1": 0.0, "AKGDH": 5.06438, "AKGt2r": 0.0, "ALCD2x": 0.0, "ATPM": 8.39, "ATPS4r": 45.51401, "Biomass_Ecoli_core": 0.87392, "CO2t": -22.80983, "CS": 6.00725, "CYTBD": 43.59899, "D_LACt2": 0.0, "ENO": 14.71614, "ETOHt2r": 0.0, "EX_ac_e": 0.0, "EX_acald_e": 0.0, "EX_akg_e": 0.0, "EX_co2_e": 22.80983, "EX_etoh_e": 0.0, "EX_for_e": 0.0, "EX_fru_e": 0.0, "EX_fum_e": 0.0, "EX_glc__D_e": -10.0, "EX_gln__L_e": 0.0, "EX_glu__L_e": 0.0, "EX_h_e": 17.53087, "EX_h2o_e": 29.17583, "EX_lac__D_e": 0.0, "EX_mal__L_e": 0.0, "EX_nh4_e": -4.76532, "EX_o2_e": -21.79949, "EX_pi_e": -3.2149, "EX_pyr_e": 0.0, "EX_succ_e": 0.0, "FBA": 7.47738, "FBP": 0.0, "FORt2": 0.0, "FORti": 0.0, "FRD7": 0.0, "FRUpts2": 0.0, "FUM": 5.06438, "FUMt2_2": 0.0, "G6PDH2r": 4.95998, "GAPD": 16.02353, "GLCpts": 10.0, "GLNS": 0.22346, "GLNabc": 0.0, "GLUDy": -4.54186, "GLUN": 0.0, "GLUSy": 0.0, "GLUt2r": 0.0, "GND": 4.95998, "H2Ot": -29.17583, "ICDHyr": 6.00725, "ICL": 0.0, "LDH_D": 0.0, "MALS": 0.0, "MALt2_2": 0.0, "MDH": 5.06438, "ME1": 0.0, "ME2": 0.0, "NADH16": 38.53461, "NADTRHD": 0.0, "NH4t": 4.76532, "O2t": 21.79949, "PDH": 9.28253, "PFK": 7.47738, "PFL": 0.0, "PGI": 4.86086, "PGK": -16.02353, "PGL": 4.95998, "PGM": -14.71614, "PIt2r": 3.2149, "PPC": 2.50431, "PPCK": 0.0, "PPS": 0.0, "PTAr": 0.0, "PYK": 1.75818, "PYRt2": 0.0, "RPE": 2.67848, "RPI": -2.2815, "SUCCt2_2": 0.0, "SUCCt3": 0.0, "SUCDi": 5.06438, "SUCOAS": -5.06438, "TALA": 1.49698, "THD2": 0.0, "TKT1": 1.49698, "TKT2": 1.1815, "TPI": 7.47738}} \ No newline at end of file +{"maximum": {"MDH": 5.06438, "MALS": -0.0, "EX_pyr_e": -0.0, "PYK": 1.75818, "MALt2_2": 0.0, "PPCK": -0.0, "FBA": 7.47738, "RPE": 2.67848, "EX_fum_e": 0.0, "CS": 6.00725, "EX_o2_e": -21.79949, "FRD7": 994.93562, "AKGDH": 5.06438, "FORt2": -0.0, "GLNabc": 0.0, "EX_fru_e": -0.0, "THD2": -0.0, "FUMt2_2": 0.0, "PYRt2": 0.0, "O2t": 21.79949, "ACALDt": 0.0, "EX_acald_e": -0.0, "Biomass_Ecoli_core": 0.87392, "ACONTa": 6.00725, "TKT2": 1.1815, "TKT1": 1.49698, "LDH_D": 0.0, "GLUDy": -4.54186, "ALCD2x": 0.0, "EX_h_e": 17.53087, "EX_mal__L_e": -0.0, "NADH16": 38.53461, "TALA": 1.49698, "ME1": -0.0, "FORti": -0.0, "ME2": -0.0, "EX_nh4_e": -4.76532, "ACKr": 0.0, "ENO": 14.71614, "ACt2r": 0.0, "NH4t": 4.76532, "ACONTb": 6.00725, "EX_akg_e": -0.0, "EX_ac_e": -0.0, "ATPS4r": 45.51401, "GLUN": -0.0, "FRUpts2": 0.0, "CYTBD": 43.59899, "ATPM": 8.39, "GLNS": 0.22346, "PFK": 7.47738, "NADTRHD": -0.0, "PGK": -16.02353, "EX_succ_e": -0.0, "PGL": 4.95998, "EX_gln__L_e": 0.0, "PTAr": -0.0, "RPI": -2.2815, "GAPD": 16.02353, "ICDHyr": 6.00725, "TPI": 7.47738, "EX_glc__D_e": -10.0, "ICL": -0.0, "GLUt2r": 0.0, "ADK1": -0.0, "EX_for_e": -0.0, "EX_etoh_e": -0.0, "EX_lac__D_e": -0.0, "D_LACt2": 0.0, "PGI": 4.86086, "GND": 4.95998, "PDH": 9.28253, "EX_glu__L_e": -0.0, "PIt2r": 3.2149, "SUCDi": 1000.0, "FBP": -0.0, "EX_co2_e": 22.80983, "SUCCt2_2": -0.0, "EX_pi_e": -3.2149, "PPC": 2.50431, "PGM": -14.71614, "FUM": 5.06438, "SUCCt3": -0.0, "EX_h2o_e": 29.17583, "SUCOAS": -5.06438, "ACALD": 0.0, "H2Ot": -29.17583, "PPS": -0.0, "GLUSy": -0.0, "PFL": -0.0, "CO2t": -22.80983, "ETOHt2r": 0.0, "GLCpts": 10.0, "G6PDH2r": 4.95998, "AKGt2r": 0.0}, "minimum": {"MDH": 5.06438, "MALS": 0.0, "EX_pyr_e": 0.0, "PYK": 1.75818, "MALt2_2": 0.0, "PPCK": 0.0, "FBA": 7.47738, "RPE": 2.67848, "EX_fum_e": 0.0, "CS": 6.00725, "EX_o2_e": -21.79949, "FRD7": 0.0, "AKGDH": 5.06438, "FORt2": 0.0, "GLNabc": 0.0, "EX_fru_e": 0.0, "THD2": 0.0, "FUMt2_2": 0.0, "PYRt2": 0.0, "O2t": 21.79949, "ACALDt": 0.0, "EX_acald_e": 0.0, "Biomass_Ecoli_core": 0.87392, "ACONTa": 6.00725, "TKT2": 1.1815, "TKT1": 1.49698, "LDH_D": 0.0, "GLUDy": -4.54186, "ALCD2x": 0.0, "EX_h_e": 17.53087, "EX_mal__L_e": 0.0, "NADH16": 38.53461, "TALA": 1.49698, "ME1": 0.0, "FORti": -0.0, "ME2": 0.0, "EX_nh4_e": -4.76532, "ACKr": 0.0, "ENO": 14.71614, "ACt2r": 0.0, "NH4t": 4.76532, "ACONTb": 6.00725, "EX_akg_e": 0.0, "EX_ac_e": 0.0, "ATPS4r": 45.51401, "GLUN": 0.0, "FRUpts2": 0.0, "CYTBD": 43.59899, "ATPM": 8.39, "GLNS": 0.22346, "PFK": 7.47738, "NADTRHD": 0.0, "PGK": -16.02353, "EX_succ_e": 0.0, "PGL": 4.95998, "EX_gln__L_e": 0.0, "PTAr": 0.0, "RPI": -2.2815, "GAPD": 16.02353, "ICDHyr": 6.00725, "TPI": 7.47738, "EX_glc__D_e": -10.0, "ICL": 0.0, "GLUt2r": 0.0, "ADK1": 0.0, "EX_for_e": 0.0, "EX_etoh_e": 0.0, "EX_lac__D_e": 0.0, "D_LACt2": 0.0, "PGI": 4.86086, "GND": 4.95998, "PDH": 9.28253, "EX_glu__L_e": 0.0, "PIt2r": 3.2149, "SUCDi": 5.06438, "FBP": 0.0, "EX_co2_e": 22.80983, "SUCCt2_2": 0.0, "EX_pi_e": -3.2149, "PPC": 2.50431, "PGM": -14.71614, "FUM": 5.06438, "SUCCt3": 0.0, "EX_h2o_e": 29.17583, "SUCOAS": -5.06438, "ACALD": 0.0, "H2Ot": -29.17583, "PPS": 0.0, "GLUSy": 0.0, "PFL": 0.0, "CO2t": -22.80983, "ETOHt2r": 0.0, "GLCpts": 10.0, "G6PDH2r": 4.95998, "AKGt2r": 0.0}} \ No newline at end of file diff --git a/cobra/test/data/textbook_pfba_fva.json b/cobra/test/data/textbook_pfba_fva.json index b42e6ccf9..6a357e464 100644 --- a/cobra/test/data/textbook_pfba_fva.json +++ b/cobra/test/data/textbook_pfba_fva.json @@ -1 +1 @@ -{"maximum": {"ACALD": 0.0, "ACALDt": 0.0, "ACKr": 0.0, "ACONTa": 6.00725, "ACONTb": 6.00725, "ACt2r": 0.0, "ADK1": -0.0, "AKGDH": 5.06438, "AKGt2r": 0.0, "ALCD2x": -0.0, "ATPM": 8.39, "ATPS4r": 45.51401, "Biomass_Ecoli_core": 0.87392, "CO2t": -22.80983, "CS": 6.00725, "CYTBD": 43.59899, "D_LACt2": 0.0, "ENO": 14.71614, "ETOHt2r": -0.0, "EX_ac_e": -0.0, "EX_acald_e": -0.0, "EX_akg_e": -0.0, "EX_co2_e": 22.80983, "EX_etoh_e": -0.0, "EX_for_e": -0.0, "EX_fru_e": -0.0, "EX_fum_e": 0.0, "EX_glc__D_e": -10.0, "EX_gln__L_e": 0.0, "EX_glu__L_e": -0.0, "EX_h_e": 17.53087, "EX_h2o_e": 29.17583, "EX_lac__D_e": -0.0, "EX_mal__L_e": -0.0, "EX_nh4_e": -4.76532, "EX_o2_e": -21.79949, "EX_pi_e": -3.2149, "EX_pyr_e": -0.0, "EX_succ_e": -0.0, "FBA": 7.47738, "FBP": -0.0, "FORt2": -0.0, "FORti": -0.0, "FRD7": 25.9211, "FRUpts2": 0.0, "FUM": 5.06438, "FUMt2_2": 0.0, "G6PDH2r": 4.95998, "GAPD": 16.02353, "GLCpts": 10.0, "GLNS": 0.22346, "GLNabc": 0.0, "GLUDy": -4.54186, "GLUN": -0.0, "GLUSy": -0.0, "GLUt2r": 0.0, "GND": 4.95998, "H2Ot": -29.17583, "ICDHyr": 6.00725, "ICL": -0.0, "LDH_D": 0.0, "MALS": -0.0, "MALt2_2": 0.0, "MDH": 5.06438, "ME1": -0.0, "ME2": -0.0, "NADH16": 38.53461, "NADTRHD": -0.0, "NH4t": 4.76532, "O2t": 21.79949, "PDH": 9.28253, "PFK": 7.47738, "PFL": -0.0, "PGI": 4.86086, "PGK": -16.02353, "PGL": 4.95998, "PGM": -14.71614, "PIt2r": 3.2149, "PPC": 2.50431, "PPCK": -0.0, "PPS": -0.0, "PTAr": -0.0, "PYK": 1.75818, "PYRt2": 0.0, "RPE": 2.67848, "RPI": -2.2815, "SUCCt2_2": -0.0, "SUCCt3": -0.0, "SUCDi": 30.98548, "SUCOAS": -5.06438, "TALA": 1.49698, "THD2": -0.0, "TKT1": 1.49698, "TKT2": 1.1815, "TPI": 7.47738}, "minimum": {"ACALD": 0.0, "ACALDt": 0.0, "ACKr": 0.0, "ACONTa": 6.00725, "ACONTb": 6.00725, "ACt2r": 0.0, "ADK1": 0.0, "AKGDH": 5.06438, "AKGt2r": 0.0, "ALCD2x": 0.0, "ATPM": 8.39, "ATPS4r": 45.51401, "Biomass_Ecoli_core": 0.87392, "CO2t": -22.80983, "CS": 6.00725, "CYTBD": 43.59899, "D_LACt2": 0.0, "ENO": 14.71614, "ETOHt2r": 0.0, "EX_ac_e": 0.0, "EX_acald_e": 0.0, "EX_akg_e": 0.0, "EX_co2_e": 22.80983, "EX_etoh_e": 0.0, "EX_for_e": 0.0, "EX_fru_e": 0.0, "EX_fum_e": 0.0, "EX_glc__D_e": -10.0, "EX_gln__L_e": 0.0, "EX_glu__L_e": 0.0, "EX_h_e": 17.53087, "EX_h2o_e": 29.17583, "EX_lac__D_e": 0.0, "EX_mal__L_e": 0.0, "EX_nh4_e": -4.76532, "EX_o2_e": -21.79949, "EX_pi_e": -3.2149, "EX_pyr_e": 0.0, "EX_succ_e": 0.0, "FBA": 7.47738, "FBP": 0.0, "FORt2": 0.0, "FORti": 0.0, "FRD7": 0.0, "FRUpts2": 0.0, "FUM": 5.06438, "FUMt2_2": 0.0, "G6PDH2r": 4.95998, "GAPD": 16.02353, "GLCpts": 10.0, "GLNS": 0.22346, "GLNabc": 0.0, "GLUDy": -4.54186, "GLUN": 0.0, "GLUSy": 0.0, "GLUt2r": 0.0, "GND": 4.95998, "H2Ot": -29.17583, "ICDHyr": 6.00725, "ICL": 0.0, "LDH_D": 0.0, "MALS": 0.0, "MALt2_2": 0.0, "MDH": 5.06438, "ME1": 0.0, "ME2": 0.0, "NADH16": 38.53461, "NADTRHD": 0.0, "NH4t": 4.76532, "O2t": 21.79949, "PDH": 9.28253, "PFK": 7.47738, "PFL": 0.0, "PGI": 4.86086, "PGK": -16.02353, "PGL": 4.95998, "PGM": -14.71614, "PIt2r": 3.2149, "PPC": 2.50431, "PPCK": 0.0, "PPS": 0.0, "PTAr": 0.0, "PYK": 1.75818, "PYRt2": 0.0, "RPE": 2.67848, "RPI": -2.2815, "SUCCt2_2": 0.0, "SUCCt3": 0.0, "SUCDi": 5.06438, "SUCOAS": -5.06438, "TALA": 1.49698, "THD2": 0.0, "TKT1": 1.49698, "TKT2": 1.1815, "TPI": 7.47738}} \ No newline at end of file +{"maximum": {"MDH": 5.06438, "MALS": -0.0, "EX_pyr_e": -0.0, "PYK": 1.75818, "MALt2_2": 0.0, "PPCK": -0.0, "FBA": 7.47738, "RPE": 2.67848, "EX_fum_e": 0.0, "CS": 6.00725, "EX_o2_e": -21.79949, "FRD7": 25.9211, "AKGDH": 5.06438, "FORt2": -0.0, "GLNabc": 0.0, "EX_fru_e": -0.0, "THD2": -0.0, "FUMt2_2": 0.0, "PYRt2": 0.0, "O2t": 21.79949, "ACALDt": 0.0, "EX_acald_e": -0.0, "Biomass_Ecoli_core": 0.87392, "ACONTa": 6.00725, "TKT2": 1.1815, "TKT1": 1.49698, "LDH_D": 0.0, "GLUDy": -4.54186, "ALCD2x": 0.0, "EX_h_e": 17.53087, "EX_mal__L_e": -0.0, "NADH16": 38.53461, "TALA": 1.49698, "ME1": -0.0, "FORti": -0.0, "ME2": -0.0, "EX_nh4_e": -4.76532, "ACKr": 0.0, "ENO": 14.71614, "ACt2r": 0.0, "NH4t": 4.76532, "ACONTb": 6.00725, "EX_akg_e": -0.0, "EX_ac_e": -0.0, "ATPS4r": 45.51401, "GLUN": -0.0, "FRUpts2": 0.0, "CYTBD": 43.59899, "ATPM": 8.39, "GLNS": 0.22346, "PFK": 7.47738, "NADTRHD": -0.0, "PGK": -16.02353, "EX_succ_e": -0.0, "PGL": 4.95998, "EX_gln__L_e": 0.0, "PTAr": -0.0, "RPI": -2.2815, "GAPD": 16.02353, "ICDHyr": 6.00725, "TPI": 7.47738, "EX_glc__D_e": -10.0, "ICL": -0.0, "GLUt2r": 0.0, "ADK1": -0.0, "EX_for_e": -0.0, "EX_etoh_e": -0.0, "EX_lac__D_e": -0.0, "D_LACt2": 0.0, "PGI": 4.86086, "GND": 4.95998, "PDH": 9.28253, "EX_glu__L_e": -0.0, "PIt2r": 3.2149, "SUCDi": 30.98548, "FBP": -0.0, "EX_co2_e": 22.80983, "SUCCt2_2": -0.0, "EX_pi_e": -3.2149, "PPC": 2.50431, "PGM": -14.71614, "FUM": 5.06438, "SUCCt3": -0.0, "EX_h2o_e": 29.17583, "SUCOAS": -5.06438, "ACALD": 0.0, "H2Ot": -29.17583, "PPS": -0.0, "GLUSy": -0.0, "PFL": -0.0, "CO2t": -22.80983, "ETOHt2r": 0.0, "GLCpts": 10.0, "G6PDH2r": 4.95998, "AKGt2r": 0.0}, "minimum": {"MDH": 5.06438, "MALS": 0.0, "EX_pyr_e": 0.0, "PYK": 1.75818, "MALt2_2": 0.0, "PPCK": 0.0, "FBA": 7.47738, "RPE": 2.67848, "EX_fum_e": 0.0, "CS": 6.00725, "EX_o2_e": -21.79949, "FRD7": 0.0, "AKGDH": 5.06438, "FORt2": 0.0, "GLNabc": 0.0, "EX_fru_e": 0.0, "THD2": 0.0, "FUMt2_2": 0.0, "PYRt2": 0.0, "O2t": 21.79949, "ACALDt": 0.0, "EX_acald_e": 0.0, "Biomass_Ecoli_core": 0.87392, "ACONTa": 6.00725, "TKT2": 1.1815, "TKT1": 1.49698, "LDH_D": 0.0, "GLUDy": -4.54186, "ALCD2x": 0.0, "EX_h_e": 17.53087, "EX_mal__L_e": 0.0, "NADH16": 38.53461, "TALA": 1.49698, "ME1": 0.0, "FORti": 0.0, "ME2": 0.0, "EX_nh4_e": -4.76532, "ACKr": 0.0, "ENO": 14.71614, "ACt2r": 0.0, "NH4t": 4.76532, "ACONTb": 6.00725, "EX_akg_e": 0.0, "EX_ac_e": 0.0, "ATPS4r": 45.51401, "GLUN": 0.0, "FRUpts2": 0.0, "CYTBD": 43.59899, "ATPM": 8.39, "GLNS": 0.22346, "PFK": 7.47738, "NADTRHD": 0.0, "PGK": -16.02353, "EX_succ_e": 0.0, "PGL": 4.95998, "EX_gln__L_e": 0.0, "PTAr": 0.0, "RPI": -2.2815, "GAPD": 16.02353, "ICDHyr": 6.00725, "TPI": 7.47738, "EX_glc__D_e": -10.0, "ICL": 0.0, "GLUt2r": 0.0, "ADK1": 0.0, "EX_for_e": 0.0, "EX_etoh_e": 0.0, "EX_lac__D_e": 0.0, "D_LACt2": 0.0, "PGI": 4.86086, "GND": 4.95998, "PDH": 9.28253, "EX_glu__L_e": 0.0, "PIt2r": 3.2149, "SUCDi": 5.06438, "FBP": 0.0, "EX_co2_e": 22.80983, "SUCCt2_2": 0.0, "EX_pi_e": -3.2149, "PPC": 2.50431, "PGM": -14.71614, "FUM": 5.06438, "SUCCt3": 0.0, "EX_h2o_e": 29.17583, "SUCOAS": -5.06438, "ACALD": 0.0, "H2Ot": -29.17583, "PPS": 0.0, "GLUSy": 0.0, "PFL": 0.0, "CO2t": -22.80983, "ETOHt2r": 0.0, "GLCpts": 10.0, "G6PDH2r": 4.95998, "AKGt2r": 0.0}} \ No newline at end of file diff --git a/cobra/test/data/textbook_solution.pickle b/cobra/test/data/textbook_solution.pickle index a9633a37a..ac0e1f9be 100644 Binary files a/cobra/test/data/textbook_solution.pickle and b/cobra/test/data/textbook_solution.pickle differ diff --git a/cobra/test/data/update_pickles.py b/cobra/test/data/update_pickles.py index 87bb90e16..69b720db9 100755 --- a/cobra/test/data/update_pickles.py +++ b/cobra/test/data/update_pickles.py @@ -3,38 +3,39 @@ from __future__ import absolute_import +import json from collections import OrderedDict -from json import dump as json_dump +from builtins import open # Python 2 unicode compatibility. import cobra from cobra.io import ( - load_matlab_model, read_sbml_model, save_json_model, save_matlab_model, - write_sbml_model) + load_matlab_model, read_sbml_model, save_json_model, save_yaml_model, + save_matlab_model, write_sbml_model) from cobra.io.sbml3 import write_sbml2 # This script regenerates pickles of cobra Models. Should be # performed after updating core classes to prevent subtle bugs. try: - from cPickle import load, dump -except: - from pickle import load, dump + import cPickle as pickle +except ImportError: + import pickle # ecoli ecoli_model = read_sbml_model("iJO1366.xml") -with open("iJO1366.pickle", "wb") as outfile: - dump(ecoli_model, outfile, protocol=2) +with open("iJO1366.pickle", "wb", encoding=None) as outfile: + pickle.dump(ecoli_model, outfile, protocol=2) # salmonella salmonella = read_sbml_model("salmonella.xml") with open("salmonella.genes", "rb") as infile: - gene_names = load(infile) + gene_names = pickle.load(infile) for gene in salmonella.genes: gene.name = gene_names[gene.id] with open("salmonella.media", "rb") as infile: - salmonella.media_compositions = load(infile) -with open("salmonella.pickle", "wb") as outfile: - dump(salmonella, outfile, protocol=2) + salmonella.media_compositions = pickle.load(infile) +with open("salmonella.pickle", "wb", encoding=None) as outfile: + pickle.dump(salmonella, outfile, protocol=2) # create mini model from textbook textbook = read_sbml_model("textbook.xml.gz") @@ -78,18 +79,19 @@ mini.metabolites.sort() mini.compartments.sort() # output to various formats -with open("mini.pickle", "wb") as outfile: - dump(mini, outfile, protocol=2) +with open("mini.pickle", "wb", encoding=None) as outfile: + pickle.dump(mini, outfile, protocol=2) save_matlab_model(mini, "mini.mat") -save_json_model(mini, "mini.json", pretty=True) +save_json_model(mini, "mini.json", sort=True, pretty=True) +save_yaml_model(mini, "mini.yml", sort=True) write_sbml_model(mini, "mini_fbc2.xml") write_sbml_model(mini, "mini_fbc2.xml.bz2") write_sbml_model(mini, "mini_fbc2.xml.gz") write_sbml2(mini, "mini_fbc1.xml", use_fbc_package=True) write_sbml_model(mini, "mini_cobra.xml", use_fbc_package=False) raven = load_matlab_model("raven.mat") -with open("raven.pickle", "wb") as outfile: - dump(raven, outfile, protocol=2) +with open("raven.pickle", "wb", encoding=None) as outfile: + pickle.dump(raven, outfile, protocol=2) # TODO:these need a reference solutions rather than circular solution checking! @@ -99,7 +101,7 @@ for key in sorted(fva_result): clean_result[key] = {k: round(v, 5) for k, v in fva_result[key].items()} with open("textbook_fva.json", "w") as outfile: - json_dump(clean_result, outfile) + json.dump(clean_result, outfile) # fva with pfba constraint fva_result = cobra.flux_analysis.flux_variability_analysis(textbook, @@ -108,9 +110,9 @@ for key in sorted(fva_result): clean_result[key] = {k: round(v, 5) for k, v in fva_result[key].items()} with open("textbook_pfba_fva.json", "w") as outfile: - json_dump(clean_result, outfile) + json.dump(clean_result, outfile) # textbook solution solution = cobra.flux_analysis.parsimonious.pfba(textbook) -with open('textbook_solution.pickle', 'wb') as f: - dump(solution, f, protocol=2) +with open('textbook_solution.pickle', 'wb', encoding=None) as f: + pickle.dump(solution, f, protocol=2) diff --git a/cobra/test/test_io/__init__.py b/cobra/test/test_io/__init__.py deleted file mode 100644 index 40a96afc6..000000000 --- a/cobra/test/test_io/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/cobra/test/test_io/conftest.py b/cobra/test/test_io/conftest.py index df3dfa197..1a583e773 100644 --- a/cobra/test/test_io/conftest.py +++ b/cobra/test/test_io/conftest.py @@ -19,6 +19,7 @@ def mini_model(data_directory): def compare_models(model_1, model_2): """Compare two models (only for testing purposes).""" + assert len(model_1.compartments) == len(model_2.compartments) assert len(model_1.reactions) == len(model_2.reactions) assert len(model_1.metabolites) == len(model_2.metabolites) assert len(model_1.genes) == len(model_2.genes) diff --git a/cobra/test/test_io/helpers.py b/cobra/test/test_io/helpers.py new file mode 100644 index 000000000..cd0c91391 --- /dev/null +++ b/cobra/test/test_io/helpers.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- + +"""Define testing helper functions.""" + +from __future__ import absolute_import + +import pytest + + +def assert_equal_models(model_1, model_2): + """Compare two models (only for testing purposes).""" + assert len(model_1.compartments) == len(model_2.compartments) + assert len(model_1.reactions) == len(model_2.reactions) + assert len(model_1.metabolites) == len(model_2.metabolites) + assert len(model_1.genes) == len(model_2.genes) + assert model_1.objective.direction == model_2.objective.direction + + # check Reaction attributes + for attr in ("id", "name", "lower_bound", "upper_bound", + "objective_coefficient", "gene_reaction_rule"): + assert getattr(model_1.reactions[0], attr) == getattr( + model_2.reactions[0], attr) + assert getattr(model_1.reactions[5], attr) == getattr( + model_2.reactions[5], attr) + assert getattr(model_1.reactions[-1], attr) == getattr( + model_2.reactions[-1], attr) + + # check Metabolite attributes + for attr in ("id", "name", "compartment", "formula", "charge"): + assert getattr(model_1.metabolites[0], attr) == getattr( + model_2.metabolites[0], attr) + assert getattr(model_1.metabolites[5], attr) == getattr( + model_2.metabolites[5], attr) + assert getattr(model_1.metabolites[-1], attr) == getattr( + model_2.metabolites[-1], attr) + assert len(model_1.reactions[0].metabolites) == len( + model_2.reactions[0].metabolites) + # TODO: either relax gene attribute checking or fix models for testing. + # check Gene attributes + # for attr in ("id", "name"): + # assert getattr(model_1.genes[0], attr) == getattr(model_2.genes[0], + # attr) + # assert getattr(model_1.genes[10], attr) == getattr(model_2.genes[10], + # attr) + # assert getattr(model_1.genes[-1], attr) == getattr(model_2.genes[-1], + # attr) + + assert len(model_1.reactions[8].metabolites) == len( + model_2.reactions[8].metabolites) + assert len(model_1.reactions[-1].metabolites) == len( + model_2.reactions[-1].metabolites) + assert len(model_1.genes) == len(model_2.genes) + + # ensure they have the same solution max + solution_1 = model_1.optimize() + solution_2 = model_2.optimize() + assert abs(solution_1.objective_value - + solution_2.objective_value) == pytest.approx(0.0) + + # ensure the references are correct + # metabolite -> model reference + assert model_1.metabolites[0]._model is model_1 + assert model_2.metabolites[0]._model is model_2 + + # reaction -> model reference + assert model_1.reactions[0]._model is model_1 + assert model_2.reactions[0]._model is model_2 + + # gene -> model reference + assert model_1.genes[0]._model is model_1 + assert model_2.genes[0]._model is model_2 + + # extra comparisons + # assert model_1.compartments == model_2.compartments + # assert dict(model_1.metabolites[4].annotation) == dict( + # model_2.metabolites[4].annotation) + # assert dict(model_1.reactions[4].annotation) == dict( + # model_2.reactions[4].annotation) + # assert dict(model_1.genes[5].annotation) == dict( + # model_2.genes[5].annotation) diff --git a/cobra/test/test_io/test_json.py b/cobra/test/test_io/test_json.py index 93d7cac91..5300729c4 100644 --- a/cobra/test/test_io/test_json.py +++ b/cobra/test/test_io/test_json.py @@ -1,40 +1,45 @@ # -*- coding: utf-8 -*- -"""Test functionalities of json.py""" +"""Test JSON input and output.""" from __future__ import absolute_import -import json +from builtins import open # Python 2 unicode compatibility. from os.path import join import cobra.io as cio -import pytest -from cobra.test.test_io.conftest import compare_models +import helpers -@pytest.mark.xfail(reason="schema outdated") -def test_validate_json(data_directory): - """Validate file according to JSON-schema.""" - jsonschema = pytest.importorskip("jsonschema") - with open(join(data_directory, "mini.json"), - "r", encoding="utf-8") as infile: - loaded = json.load(infile) - assert jsonschema.validate(loaded, cio.json.json_schema) + +def test_from_json(data_directory, mini_model): + """Test reading a model from a JSON string.""" + with open(join(data_directory, "mini.json"), encoding="utf-8") as handle: + json_model = cio.from_json(handle.read()) + helpers.assert_equal_models(mini_model, json_model) def test_load_json_model(data_directory, mini_model): - """Test the reading of JSON model.""" + """Test reading a model from a JSON file.""" json_model = cio.load_json_model(join(data_directory, "mini.json")) - assert compare_models(mini_model, json_model) is None + helpers.assert_equal_models(mini_model, json_model) + + +def test_to_json(data_directory, mini_model): + """Test writing a model to a JSON string.""" + output = cio.to_json(mini_model, sort=True, pretty=True) + with open(join(data_directory, "mini.json"), encoding="utf-8") as handle: + expected = handle.read() + assert output == expected -@pytest.mark.xfail(reason="schema outdated") -def test_save_json_model(tmpdir, mini_model): - """Test the writing of JSON model.""" - jsonschema = pytest.importorskip("jsonschema") +def test_save_json_model(tmpdir, data_directory, mini_model): + """Test writing a model to a JSON file.""" output_file = tmpdir.join("mini.json") - cio.save_json_model(mini_model, output_file.strpath, pretty=True) - # validate against JSONSchema - with open(output_file, "r") as infile: - loaded = json.load(infile) - assert jsonschema.validate(loaded, cio.json.json_schema) + cio.save_json_model(mini_model, str(output_file), sort=True, pretty=True) + # Validate the written file. + with open(str(output_file), encoding="utf-8") as handle: + output = handle.read() + with open(join(data_directory, "mini.json"), encoding="utf-8") as handle: + expected = handle.read() + assert output == expected diff --git a/cobra/test/test_io/test_mat.py b/cobra/test/test_io/test_mat.py index ab8b6857e..626638fbe 100644 --- a/cobra/test/test_io/test_mat.py +++ b/cobra/test/test_io/test_mat.py @@ -4,27 +4,27 @@ from __future__ import absolute_import +from builtins import open # Python 2 unicode compatibility. from os.path import join from pickle import load import pytest -from cobra import io -from cobra.test.test_io.conftest import compare_models +import cobra.io as cio -try: - import scipy -except ImportError: - scipy = None +import helpers -@pytest.fixture(scope="function") +scipy = pytest.importorskip("scipy") + + +@pytest.fixture(scope="module") def raven_model(data_directory): """Fixture for RAVEN model.""" - with open(join(data_directory, "raven.pickle"), "rb") as infile: + with open(join(data_directory, "raven.pickle"), + "rb", encoding=None) as infile: return load(infile) -@pytest.mark.skipif(scipy is None, reason='scipy unavailable') # @pytest.mark.parametrize("ref_model, filename", # [(pytest.fixture_request("mini_model"), # "mini.mat"), @@ -33,14 +33,12 @@ def raven_model(data_directory): # TODO: wait for pytest.fixture_request() to get approved def test_load_matlab_model(data_directory, mini_model, raven_model): """Test the reading of MAT model.""" - mini_mat_model = io.load_matlab_model(join(data_directory, "mini.mat")) - raven_mat_model = io.load_matlab_model(join(data_directory, "raven.mat")) - assert compare_models(mini_model, mini_mat_model) is None - assert compare_models(raven_model, raven_mat_model) is None + mini_mat_model = cio.load_matlab_model(join(data_directory, "mini.mat")) + raven_mat_model = cio.load_matlab_model(join(data_directory, "raven.mat")) + helpers.assert_equal_models(mini_model, mini_mat_model) + helpers.assert_equal_models(raven_model, raven_mat_model) -# @pytest.mark.xfail(reason="localPath not supported yet") -@pytest.mark.skipif(scipy is None, reason='scipy unavailable') # @pytest.mark.parametrize("model, filename", # [(pytest.fixture_request("mini_model"), # "mini.mat"), @@ -53,7 +51,7 @@ def test_save_matlab_model(tmpdir, mini_model, raven_model): raven_output_file = tmpdir.join("raven.mat") # scipy.io.savemat() doesn't support anything other than # str or file-stream object, hence the str conversion - io.save_matlab_model(mini_model, str(mini_output_file)) - io.save_matlab_model(raven_model, str(raven_output_file)) + cio.save_matlab_model(mini_model, str(mini_output_file)) + cio.save_matlab_model(raven_model, str(raven_output_file)) assert mini_output_file.check() assert raven_output_file.check() diff --git a/cobra/test/test_io/test_pickle.py b/cobra/test/test_io/test_pickle.py index 7f3a921c2..1f2d3d196 100644 --- a/cobra/test/test_io/test_pickle.py +++ b/cobra/test/test_io/test_pickle.py @@ -4,41 +4,32 @@ from __future__ import absolute_import +from builtins import open # Python 2 unicode compatibility. from os.path import join -from pickle import dump, load import pytest -from cobra.test.test_io.conftest import compare_models -try: - import cPickle - cload = cPickle.load - cdump = cPickle.dump -except ImportError: - cload = None - cdump = None +import helpers -@pytest.mark.parametrize("load_function", [load, cload]) -def test_read_pickle(data_directory, mini_model, load_function): - """Test the reading of model from pickle.""" - if load_function is None: - pytest.skip() +PICKLE_MODULES = ["pickle", "cPickle"] - with open(join(data_directory, "mini.pickle"), "rb") as infile: - pickle_model = load_function(infile) - assert compare_models(mini_model, pickle_model) is None +@pytest.mark.parametrize("module", PICKLE_MODULES) +def test_read_pickle(data_directory, mini_model, module): + """Test the reading of model from pickle.""" + pickle = pytest.importorskip(module) + with open(join(data_directory, "mini.pickle"), + "rb", encoding=None) as infile: + pickle_model = pickle.load(infile) + helpers.assert_equal_models(mini_model, pickle_model) -@pytest.mark.parametrize("dump_function", [dump, cdump]) -def test_write_pickle(tmpdir, mini_model, dump_function): +@pytest.mark.parametrize("module", PICKLE_MODULES) +def test_write_pickle(tmpdir, mini_model, module): """Test the writing of model to pickle.""" - if dump_function is None: - pytest.skip() - + pickle = pytest.importorskip(module) output_file = tmpdir.join("mini.pickle") - with open(str(output_file), "wb") as outfile: - dump_function(mini_model, outfile) - + with open(str(output_file), "wb", encoding=None) as outfile: + pickle.dump(mini_model, outfile) assert output_file.check() diff --git a/cobra/test/test_io/test_sbml.py b/cobra/test/test_io/test_sbml.py index 010665fb3..9cae9e805 100644 --- a/cobra/test/test_io/test_sbml.py +++ b/cobra/test/test_io/test_sbml.py @@ -4,52 +4,50 @@ from __future__ import absolute_import -from os.path import getsize, join +from os.path import join import pytest -from cobra import io -from cobra.test.test_io.conftest import compare_models -try: - import libsbml -except ImportError: - libsbml = None +import cobra.io as cio + +import helpers + + +libsbml = pytest.importorskip("libsbml") @pytest.fixture(scope="function") def mini_fbc1_model(data_directory): - return io.read_legacy_sbml(join(data_directory, "mini_fbc1.xml")) + return cio.read_legacy_sbml(join(data_directory, "mini_fbc1.xml")) @pytest.fixture(scope="function") def mini_cobra_model(data_directory): - return io.read_legacy_sbml(join(data_directory, "mini_cobra.xml")) + return cio.read_legacy_sbml(join(data_directory, "mini_cobra.xml")) # TODO: parametrize the arguments after pytest.fixture_request() # is approved -@pytest.mark.skipif(libsbml is None, reason="libsbml unavailable.") def test_read_sbml_model(data_directory, mini_fbc1_model, mini_cobra_model): """Test the reading of a model from SBML v2.""" - mini_fbc1 = io.read_legacy_sbml(join(data_directory, "mini_fbc1.xml")) - mini_cobra = io.read_legacy_sbml(join(data_directory, "mini_cobra.xml")) - assert compare_models(mini_fbc1_model, mini_fbc1) is None - assert compare_models(mini_cobra_model, mini_cobra) is None + mini_fbc1 = cio.read_legacy_sbml(join(data_directory, "mini_fbc1.xml")) + mini_cobra = cio.read_legacy_sbml(join(data_directory, "mini_cobra.xml")) + helpers.assert_equal_models(mini_fbc1_model, mini_fbc1) + helpers.assert_equal_models(mini_cobra_model, mini_cobra) # TODO: parametrize the arguments after pytest.fixture_request() # is approved -@pytest.mark.skipif(libsbml is None, reason="libsbml unavailable.") def test_write_sbml_model(tmpdir, mini_fbc1_model, mini_cobra_model): """Test the writing of a model to SBML v2.""" mini_fbc1_output_file = tmpdir.join("mini_fbc1.xml") mini_cobra_output_file = tmpdir.join("mini_cobra.xml") # convert to str object before passing the filename - io.write_legacy_sbml(mini_fbc1_model, str(mini_fbc1_output_file), - use_fbc_package=True) - io.write_legacy_sbml(mini_cobra_model, str(mini_cobra_output_file), - use_fbc_package=False) + cio.write_legacy_sbml(mini_fbc1_model, str(mini_fbc1_output_file), + use_fbc_package=True) + cio.write_legacy_sbml(mini_cobra_model, str(mini_cobra_output_file), + use_fbc_package=False) assert mini_fbc1_output_file.check() assert mini_cobra_output_file.check() diff --git a/cobra/test/test_io/test_sbml3.py b/cobra/test/test_io/test_sbml3.py index 249f1d1e3..81e88c9e5 100644 --- a/cobra/test/test_io/test_sbml3.py +++ b/cobra/test/test_io/test_sbml3.py @@ -6,36 +6,37 @@ from os.path import join +import pytest from six import itervalues -import pytest -from cobra import io -from cobra.test.test_io.conftest import compare_models +import cobra.io as cio + +import helpers @pytest.fixture(scope="function") def mini_fbc2_model(data_directory): """Return mini_fbc2 model.""" - return io.sbml3.read_sbml_model(join(data_directory, "mini_fbc2.xml")) + return cio.sbml3.read_sbml_model(join(data_directory, "mini_fbc2.xml")) # Benchmarks def test_benchmark_read(data_directory, benchmark): """Benchmark SBML read.""" - benchmark(io.sbml3.read_sbml_model, join(data_directory, "mini_fbc2.xml")) + benchmark(cio.sbml3.read_sbml_model, join(data_directory, "mini_fbc2.xml")) def test_benchmark_write(model, benchmark, tmpdir): """Benchmark SBML write.""" - benchmark(io.sbml3.write_sbml_model, model, tmpdir.join("-bench")) + benchmark(cio.sbml3.write_sbml_model, model, tmpdir.join("-bench")) # Tests def test_sbml3_error(data_directory): """Test invalid SBML read.""" filename = join(data_directory, "invalid0.xml") - with pytest.raises(io.sbml3.CobraSBMLError): - io.read_sbml_model(filename) + with pytest.raises(cio.sbml3.CobraSBMLError): + cio.read_sbml_model(filename) def test_validate_sbml_model(data_directory): @@ -43,12 +44,12 @@ def test_validate_sbml_model(data_directory): # invalid SBML for i in range(3): filename = join(data_directory, "invalid{}.xml".format(i)) - _, errors = io.sbml3.validate_sbml_model(filename) + _, errors = cio.sbml3.validate_sbml_model(filename) assert all(len(v) >= 1 for v in itervalues(errors)) is False # valid SBML filename = join(data_directory, "mini_fbc2.xml") - _, errors = io.sbml3.validate_sbml_model(filename) + _, errors = cio.sbml3.validate_sbml_model(filename) assert all(len(v) == 0 for v in itervalues(errors)) @@ -56,13 +57,13 @@ def test_validate_sbml_model(data_directory): "mini_fbc2.xml.bz2"]) def test_read_sbml_model(data_directory, mini_model, sbml_file): """Test the reading of a model from SBML3.""" - sbml3_model = io.read_sbml_model(join(data_directory, sbml_file)) - assert compare_models(mini_model, sbml3_model) is None + sbml3_model = cio.read_sbml_model(join(data_directory, sbml_file)) + helpers.assert_equal_models(mini_model, sbml3_model) @pytest.mark.parametrize("ext", [".xml", ".xml.gz", ".xml.bz2"]) def test_write_sbml_model(tmpdir, mini_fbc2_model, ext): """Test the writing of model to SBML3.""" output_file = tmpdir.join("mini_fbc2{}".format(ext)) - io.write_sbml_model(mini_fbc2_model, output_file) + cio.write_sbml_model(mini_fbc2_model, output_file) assert output_file.check() diff --git a/cobra/test/test_io/test_yaml.py b/cobra/test/test_io/test_yaml.py index e1832192a..ad13c2cf5 100644 --- a/cobra/test/test_io/test_yaml.py +++ b/cobra/test/test_io/test_yaml.py @@ -1,35 +1,45 @@ # -*- coding: utf-8 -*- -"""Test functionalities provided by yaml.py""" +"""Test YAML input and output.""" from __future__ import absolute_import -import json +from builtins import open # Python 2 unicode compatibility. from os.path import join -from ruamel.yaml import YAML - import cobra.io as cio -import pytest -from cobra.test.test_io.conftest import compare_models + +import helpers + + +def test_from_yaml(data_directory, mini_model): + """Test reading a model from a YAML string.""" + with open(join(data_directory, "mini.yml"), encoding="utf-8") as handle: + yaml_model = cio.from_yaml(handle.read()) + helpers.assert_equal_models(mini_model, yaml_model) def test_load_yaml_model(data_directory, mini_model): - """Test the reading of YAML model.""" + """Test reading a model from a YAML file.""" yaml_model = cio.load_yaml_model(join(data_directory, "mini.yml")) - assert compare_models(mini_model, yaml_model) is None + helpers.assert_equal_models(mini_model, yaml_model) + + +def test_to_yaml(data_directory, mini_model): + """Test writing a model to a YAML string.""" + output = cio.to_yaml(mini_model, sort=True) + with open(join(data_directory, "mini.yml"), encoding="utf-8") as handle: + expected = handle.read() + assert output == expected -@pytest.mark.xfail(reason="schema outdated") -def test_save_yaml_model(tmpdir, mini_model): - jsonschema = pytest.importorskip("jsonschema") - """Test the writing of YAML model.""" +def test_save_yaml_model(tmpdir, data_directory, mini_model): + """Test writing a model to a YAML file.""" output_file = tmpdir.join("mini.yml") - cio.save_yaml_model(mini_model, output_file.strpath, sort=True) - # validate against schema - yaml = YAML(typ="unsafe") - with open(output_file.strpath, "r") as infile: - yaml_to_dict = yaml.load(infile) - dict_to_json = json.dumps(yaml_to_dict) - loaded = json.loads(dict_to_json) - assert jsonschema.validate(loaded, cio.json.json_schema) + cio.save_yaml_model(mini_model, str(output_file), sort=True) + # Validate the written file. + with open(str(output_file), encoding="utf-8") as handle: + output = handle.read() + with open(join(data_directory, "mini.yml"), encoding="utf-8") as handle: + expected = handle.read() + assert output == expected