[med-svn] [Git][med-team/python-cobra][upstream] New upstream version 0.18.0

Andreas Tille gitlab at salsa.debian.org
Sat Apr 4 09:24:39 BST 2020



Andreas Tille pushed to branch upstream at Debian Med / python-cobra


Commits:
04049da7 by Andreas Tille at 2020-04-04T10:17:56+02:00
New upstream version 0.18.0
- - - - -


30 changed files:

- .travis.yml
- appveyor.yml
- cobra/__init__.py
- cobra/core/group.py
- cobra/core/object.py
- cobra/io/sbml.py
- cobra/medium/minimal_medium.py
- cobra/test/data/iJO1366.pickle
- + cobra/test/data/invalid_annotation_format.json
- cobra/test/data/mini.json
- cobra/test/data/mini.mat
- cobra/test/data/mini.pickle
- cobra/test/data/mini.yml
- cobra/test/data/mini_fbc2.xml
- cobra/test/data/mini_fbc2.xml.bz2
- cobra/test/data/mini_fbc2.xml.gz
- cobra/test/data/salmonella.pickle
- cobra/test/data/update_pickles.py
- + cobra/test/data/valid_annotation_format.json
- + cobra/test/data/valid_annotation_output.xml
- cobra/test/test_core/test_group.py
- cobra/test/test_core/test_model.py
- cobra/test/test_core/test_summary/test_metabolite_summary.py
- + cobra/test/test_io/test_annotation_format.py
- + cobra/test/test_io/test_notes.py
- cobra/test/test_io/test_sbml.py
- + release-notes/0.18.0.md
- setup.cfg
- setup.py
- tox.ini


Changes:

=====================================
.travis.yml
=====================================
@@ -1,10 +1,10 @@
 language: python
 sudo: false
 python:
-  - "2.7"
   - "3.5"
   - "3.6"
-  - "3.7-dev"
+  - "3.7"
+  - "3.8"
 
 git:
   depth: 2
@@ -26,7 +26,7 @@ matrix:
   fast_finish: true
 
 install:
-  - pip install --upgrade pip setuptools wheel tox tox-travis
+  - python -m pip install --upgrade pip setuptools wheel tox tox-travis
 
 script:
   - travis_wait tox -- --benchmark-skip --cov-report xml --cov-report term
@@ -44,9 +44,9 @@ stages:
 jobs:
   include:
     - stage: deploy
-      python: "3.6"
+      python: "3.8"
       install:
-        - pip install --upgrade pip setuptools wheel
+        - python -m pip install --upgrade pip setuptools wheel
       script:
         - echo "Deploying..."
       deploy:


=====================================
appveyor.yml
=====================================
@@ -29,7 +29,7 @@ install:
   - set PATH=%PYTHON%;%PYTHON%\Scripts;%PYTHON%\Library\bin;%PATH%"
   - "ECHO %PYTHON%"
   - python --version
-  - python -m pip install --upgrade --disable-pip-version-check pip setuptools wheel tox
+  - python -m pip install --upgrade --disable-pip-version-check pip setuptools wheel tox six>=1.14.0
 
 test_script:
   - tox


=====================================
cobra/__init__.py
=====================================
@@ -41,4 +41,4 @@ from cobra import io
 from cobra import sampling
 from cobra.util import show_versions
 
-__version__ = "0.17.1"
+__version__ = "0.18.0"


=====================================
cobra/core/group.py
=====================================
@@ -8,6 +8,7 @@ from warnings import warn
 
 from six import string_types
 
+from cobra.core.dictlist import DictList
 from cobra.core.object import Object
 
 
@@ -26,7 +27,7 @@ class Group(Object):
     name : str, optional
         A human readable name for the group
     members : iterable, optional
-        A list object containing references to cobra.Model-associated objects
+        A DictList containing references to cobra.Model-associated objects
         that belong to the group.
     kind : {"collection", "classification", "partonomy"}, optional
         The kind of group, as specified for the Groups feature in the SBML
@@ -47,7 +48,7 @@ class Group(Object):
     def __init__(self, id, name='', members=None, kind=None):
         Object.__init__(self, id, name)
 
-        self._members = set() if members is None else set(members)
+        self._members = DictList() if members is None else DictList(members)
         self._kind = None
         self.kind = "collection" if kind is None else kind
         # self.model is None or refers to the cobra.Model that
@@ -92,7 +93,7 @@ class Group(Object):
             warn("need to pass in a list")
             new_members = [new_members]
 
-        self._members.update(new_members)
+        self._members.union(new_members)
 
     def remove_members(self, to_remove):
         """
@@ -109,4 +110,5 @@ class Group(Object):
             warn("need to pass in a list")
             to_remove = [to_remove]
 
-        self._members.difference_update(to_remove)
+        for member_to_remove in to_remove:
+            self._members.remove(member_to_remove)


=====================================
cobra/core/object.py
=====================================
@@ -20,7 +20,7 @@ class Object(object):
         self.name = name
 
         self.notes = {}
-        self.annotation = {}
+        self._annotation = {}
 
     @property
     def id(self):
@@ -40,6 +40,17 @@ class Object(object):
     def _set_id_with_model(self, value):
         self._id = value
 
+    @property
+    def annotation(self):
+        return self._annotation
+
+    @annotation.setter
+    def annotation(self, annotation):
+        if not isinstance(annotation, dict):
+            raise TypeError("Annotation must be a dict")
+        else:
+            self._annotation = annotation
+
     def __getstate__(self):
         """To prevent excessive replication during deepcopy."""
         state = self.__dict__.copy()


=====================================
cobra/io/sbml.py
=====================================
@@ -101,7 +101,7 @@ SBML_DOT = "__SBML_DOT__"
 # -----------------------------------------------------------------------------
 pattern_notes = re.compile(
     r"<(?P<prefix>(\w+:)?)p[^>]*>(?P<content>.*?)</(?P=prefix)p>",
-    re.IGNORECASE
+    re.IGNORECASE | re.DOTALL
 )
 
 pattern_to_sbml = re.compile(r'([^0-9_a-zA-Z])')
@@ -935,9 +935,12 @@ def _model_to_sbml(cobra_model, f_replace=None, units=True):
     if cobra_model.name is not None:
         model.setName(cobra_model.name)
 
+    # for parsing annotation corresponding to the model
     _sbase_annotations(model, cobra_model.annotation)
+    # for parsing notes corresponding to the model
+    _sbase_notes_dict(model, cobra_model.notes)
 
-    # Meta information (ModelHistory)
+    # Meta information (ModelHistory) related to SBMLDocument
     if hasattr(cobra_model, "_sbml"):
         meta = cobra_model._sbml
         if "annotation" in meta:


=====================================
cobra/medium/minimal_medium.py
=====================================
@@ -161,9 +161,8 @@ def minimal_medium(model, min_objective_value=0.1, exports=False,
     minimize the number of "large" import fluxes. Specifically, the detection
     limit is given by ``integrality_tolerance * max_bound`` where ``max_bound``
     is the largest bound on an import reaction. Thus, if you are interested
-    in small import fluxes as well you may have to adjust the integrality
-    tolerance at first with
-    `model.solver.configuration.tolerances.integrality = 1e-7` for instance.
+    in small import fluxes as well you may have to adjust the solver
+    tolerance at first with `model.tolerance = 1e-7` for instance.
     However, this will be *very* slow for large models especially with GLPK.
 
     """
@@ -202,6 +201,7 @@ def minimal_medium(model, min_objective_value=0.1, exports=False,
             mod.add_cons_vars([exclusion])
             mod.solver.update()
             media = []
+
             for i in range(minimize_components):
                 LOGGER.info("Finding alternative medium #%d.", (i + 1))
                 vars = [mod.variables["ind_" + s] for s in seen]
@@ -211,6 +211,17 @@ def minimal_medium(model, min_objective_value=0.1, exports=False,
                     exclusion.ub = best - 1
                 num_components = mod.slim_optimize()
                 if mod.solver.status != OPTIMAL or num_components > best:
+                    if i == 0:
+                        LOGGER.warning(
+                            "Could not get an optimal solution. "
+                            "This is usually due to numerical instability. "
+                            "Possible remedies are relaoding the model "
+                            "from scratch, switching to a different solver, "
+                            "or decreasing the solver tolerance. Please, "
+                            "carefully read the note on numerical instability "
+                            "in the function documentation."
+                        )
+                        return None
                     break
                 medium = _as_medium(exchange_rxns, tol, exports=exports)
                 media.append(medium)


=====================================
cobra/test/data/iJO1366.pickle
=====================================
Binary files a/cobra/test/data/iJO1366.pickle and b/cobra/test/data/iJO1366.pickle differ


=====================================
cobra/test/data/invalid_annotation_format.json
=====================================
@@ -0,0 +1,24 @@
+{
+  "metabolites":[
+    {
+      "id":"4crsol_c",
+      "name":"",
+      "compartment":"c",
+      "annotation":[
+        [
+          "KEGG Compound",
+          "http://identifiers.org/kegg.compound/C01468"
+        ],
+        [
+          "CHEBI",
+          "http://identifiers.org/chebi/CHEBI:11981"
+        ]
+      ]
+    }
+  ],
+  "reactions":[],
+  "genes":[],
+  "id":"tesut",
+  "compartments":{},
+  "version": 1
+}


=====================================
cobra/test/data/mini.json
=====================================
@@ -100,10 +100,6 @@
             "id": "b2926",
             "name": "pgk"
         },
-        {
-            "id": "b2975",
-            "name": "glcA"
-        },
         {
             "id": "b2987",
             "name": "pitB"
@@ -112,10 +108,6 @@
             "id": "b3493",
             "name": "pitA"
         },
-        {
-            "id": "b3603",
-            "name": "lldP"
-        },
         {
             "id": "b3612",
             "name": "gpmM"
@@ -252,7 +244,6 @@
                     "ADP-GROUP"
                 ],
                 "cas": [
-                    "58-64-0",
                     "58-64-0"
                 ],
                 "chebi": [
@@ -294,7 +285,6 @@
                 "bigg.metabolite": "atp",
                 "biocyc": "ATP",
                 "cas": [
-                    "56-65-5",
                     "56-65-5"
                 ],
                 "chebi": [
@@ -336,7 +326,6 @@
                 "bigg.metabolite": "dhap",
                 "biocyc": "DIHYDROXY-ACETONE-PHOSPHATE",
                 "cas": [
-                    "57-04-5",
                     "57-04-5"
                 ],
                 "chebi": [
@@ -373,7 +362,6 @@
                 "bigg.metabolite": "f6p",
                 "biocyc": "FRUCTOSE-6P",
                 "cas": [
-                    "643-13-0",
                     "643-13-0"
                 ],
                 "chebi": [
@@ -410,7 +398,6 @@
                 "bigg.metabolite": "fdp",
                 "biocyc": "FRUCTOSE-16-DIPHOSPHATE",
                 "cas": [
-                    "488-69-7",
                     "488-69-7"
                 ],
                 "chebi": [
@@ -445,7 +432,6 @@
             "annotation": {
                 "bigg.metabolite": "g3p",
                 "cas": [
-                    "142-10-9",
                     "142-10-9"
                 ],
                 "chebi": [
@@ -480,7 +466,6 @@
                     "GLC-6-P"
                 ],
                 "cas": [
-                    "56-73-5",
                     "56-73-5"
                 ],
                 "chebi": [
@@ -518,7 +503,6 @@
             "annotation": {
                 "bigg.metabolite": "glc__D",
                 "cas": [
-                    "50-99-7",
                     "50-99-7"
                 ],
                 "kegg.compound": "C00031",
@@ -539,7 +523,6 @@
                     "OXONIUM"
                 ],
                 "cas": [
-                    "7732-18-5",
                     "7732-18-5"
                 ],
                 "chebi": [
@@ -625,7 +608,6 @@
                     "OXONIUM"
                 ],
                 "cas": [
-                    "7732-18-5",
                     "7732-18-5"
                 ],
                 "chebi": [
@@ -707,7 +689,6 @@
                 "bigg.metabolite": "h",
                 "biocyc": "PROTON",
                 "cas": [
-                    "12408-02-5",
                     "12408-02-5"
                 ],
                 "chebi": [
@@ -754,7 +735,6 @@
                 "bigg.metabolite": "h",
                 "biocyc": "PROTON",
                 "cas": [
-                    "12408-02-5",
                     "12408-02-5"
                 ],
                 "chebi": [
@@ -797,6 +777,26 @@
             "name": "H+"
         },
         {
+            "annotation": {
+                "bigg.metabolite": "lac__D",
+                "biocyc": "META:D-LACTATE",
+                "chebi": [
+                    "CHEBI:11001",
+                    "CHEBI:16004",
+                    "CHEBI:18684",
+                    "CHEBI:341",
+                    "CHEBI:42105",
+                    "CHEBI:42111",
+                    "CHEBI:43701"
+                ],
+                "hmdb": [
+                    "HMDB00171",
+                    "HMDB01311"
+                ],
+                "kegg.compound": "C00256",
+                "metanetx.chemical": "MNXM285",
+                "seed.compound": "cpd00221"
+            },
             "charge": -1,
             "compartment": "c",
             "formula": "C3H5O3",
@@ -804,6 +804,26 @@
             "name": "D-Lactate"
         },
         {
+            "annotation": {
+                "bigg.metabolite": "lac__D",
+                "biocyc": "META:D-LACTATE",
+                "chebi": [
+                    "CHEBI:11001",
+                    "CHEBI:16004",
+                    "CHEBI:18684",
+                    "CHEBI:341",
+                    "CHEBI:42105",
+                    "CHEBI:42111",
+                    "CHEBI:43701"
+                ],
+                "hmdb": [
+                    "HMDB00171",
+                    "HMDB01311"
+                ],
+                "kegg.compound": "C00256",
+                "metanetx.chemical": "MNXM285",
+                "seed.compound": "cpd00221"
+            },
             "charge": -1,
             "compartment": "e",
             "formula": "C3H5O3",
@@ -815,7 +835,6 @@
                 "bigg.metabolite": "nad",
                 "biocyc": "NAD",
                 "cas": [
-                    "53-84-9",
                     "53-84-9"
                 ],
                 "chebi": [
@@ -855,7 +874,6 @@
                 "bigg.metabolite": "nadh",
                 "biocyc": "NADH",
                 "cas": [
-                    "58-68-4",
                     "58-68-4"
                 ],
                 "chebi": [
@@ -890,7 +908,6 @@
                 "bigg.metabolite": "pep",
                 "biocyc": "PHOSPHO-ENOL-PYRUVATE",
                 "cas": [
-                    "138-08-9",
                     "138-08-9"
                 ],
                 "chebi": [
@@ -928,7 +945,6 @@
                     "CPD0-1421"
                 ],
                 "cas": [
-                    "14265-44-2",
                     "14265-44-2"
                 ],
                 "chebi": [
@@ -996,7 +1012,6 @@
                     "CPD0-1421"
                 ],
                 "cas": [
-                    "14265-44-2",
                     "14265-44-2"
                 ],
                 "chebi": [
@@ -1060,7 +1075,6 @@
                 "bigg.metabolite": "pyr",
                 "biocyc": "PYRUVATE",
                 "cas": [
-                    "127-17-3",
                     "127-17-3"
                 ],
                 "chebi": [
@@ -1111,15 +1125,10 @@
             "upper_bound": 1000.0
         },
         {
-            "gene_reaction_rule": "b3603 or b2975",
+            "gene_reaction_rule": "",
             "id": "D_LACt2",
             "lower_bound": -1000.0,
-            "metabolites": {
-                "h_c": 1,
-                "h_e": -1,
-                "lac__D_c": 1,
-                "lac__D_e": -1
-            },
+            "metabolites": {},
             "name": "",
             "upper_bound": 1000.0
         },
@@ -1167,6 +1176,10 @@
             "upper_bound": 1000.0
         },
         {
+            "annotation": {
+                "bigg.reaction": "lac__D",
+                "sbo": "SBO:0000627"
+            },
             "gene_reaction_rule": "",
             "id": "EX_lac__D_e",
             "lower_bound": 0.0,
@@ -1213,7 +1226,7 @@
             "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 )",
+            "gene_reaction_rule": "( b2415 and b2417 and b1101 and b2416 ) or ( b2415 and b2417 and b1621 and b2416 ) or ( b2415 and b1818 and b1817 and b1819 and b2416 )",
             "id": "GLCpts",
             "lower_bound": 0.0,
             "metabolites": {
@@ -1240,6 +1253,20 @@
             "upper_bound": 1000.0
         },
         {
+            "annotation": {
+                "bigg.reaction": "LDH_D",
+                "biocyc": "META:DLACTDEHYDROGNAD-RXN",
+                "ec-code": "1.1.1.28",
+                "kegg.reaction": "R00704",
+                "metanetx.reaction": "MNXR101037",
+                "rhea": [
+                    "16369",
+                    "16370",
+                    "16371",
+                    "16372"
+                ],
+                "sbo": "SBO:0000375"
+            },
             "gene_reaction_rule": "b2133 or b1380",
             "id": "LDH_D",
             "lower_bound": -1000.0,


=====================================
cobra/test/data/mini.mat
=====================================
Binary files a/cobra/test/data/mini.mat and b/cobra/test/data/mini.mat differ


=====================================
cobra/test/data/mini.pickle
=====================================
Binary files a/cobra/test/data/mini.pickle and b/cobra/test/data/mini.pickle differ


=====================================
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,25 @@
     - 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
+      - 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 +116,20 @@
         - 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
+      - chebi:
         - CHEBI:40938
         - CHEBI:15422
         - CHEBI:57299
@@ -138,9 +139,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 +152,20 @@
         - 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
+      - chebi:
         - CHEBI:14341
         - CHEBI:57642
         - CHEBI:14342
@@ -173,30 +173,29 @@
         - 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
+      - chebi:
         - CHEBI:57634
         - CHEBI:12352
         - CHEBI:45804
@@ -206,28 +205,27 @@
         - 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
+      - chebi:
         - CHEBI:32968
         - CHEBI:49299
         - CHEBI:42553
@@ -240,52 +238,50 @@
         - 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
+      - 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
+      - chebi:
         - CHEBI:10399
         - CHEBI:22797
         - CHEBI:41041
@@ -294,47 +290,45 @@
         - 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
+      - chebi:
         - CHEBI:15377
         - CHEBI:13365
         - CHEBI:41979
@@ -363,13 +357,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 +382,27 @@
         - 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
+      - chebi:
         - CHEBI:15377
         - CHEBI:13365
         - CHEBI:41979
@@ -438,13 +431,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 +456,32 @@
         - 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
+      - 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 +501,28 @@
         - 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
+      - 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,33 +542,66 @@
         - 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
     - compartment: c
     - charge: -1
     - formula: C3H5O3
+    - annotation: !!omap
+      - bigg.metabolite: lac__D
+      - biocyc: META:D-LACTATE
+      - chebi:
+        - CHEBI:11001
+        - CHEBI:16004
+        - CHEBI:18684
+        - CHEBI:341
+        - CHEBI:42105
+        - CHEBI:42111
+        - CHEBI:43701
+      - hmdb:
+        - HMDB00171
+        - HMDB01311
+      - kegg.compound: C00256
+      - metanetx.chemical: MNXM285
+      - seed.compound: cpd00221
   - !!omap
     - id: lac__D_e
     - name: D-Lactate
     - compartment: e
     - charge: -1
     - formula: C3H5O3
+    - annotation: !!omap
+      - bigg.metabolite: lac__D
+      - biocyc: META:D-LACTATE
+      - chebi:
+        - CHEBI:11001
+        - CHEBI:16004
+        - CHEBI:18684
+        - CHEBI:341
+        - CHEBI:42105
+        - CHEBI:42111
+        - CHEBI:43701
+      - hmdb:
+        - HMDB00171
+        - HMDB01311
+      - kegg.compound: C00256
+      - metanetx.chemical: MNXM285
+      - seed.compound: cpd00221
   - !!omap
     - id: nad_c
     - name: Nicotinamide adenine dinucleotide
     - compartment: c
     - charge: -1
     - formula: C21H26N7O14P2
-    - annotation:
-        pubchem.substance: '3305'
-        biocyc: NAD
-        chebi:
+    - annotation: !!omap
+      - bigg.metabolite: nad
+      - biocyc: NAD
+      - cas:
+        - 53-84-9
+      - chebi:
         - CHEBI:21901
         - CHEBI:7422
         - CHEBI:44214
@@ -588,31 +612,30 @@
         - 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
+      - chebi:
         - CHEBI:13395
         - CHEBI:21902
         - CHEBI:16908
@@ -620,29 +643,28 @@
         - 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
+      - chebi:
         - CHEBI:44897
         - CHEBI:44894
         - CHEBI:14812
@@ -651,30 +673,29 @@
         - 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
+      - chebi:
         - CHEBI:37583
         - CHEBI:7793
         - CHEBI:37585
@@ -699,12 +720,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 +735,26 @@
         - 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
+      - chebi:
         - CHEBI:37583
         - CHEBI:7793
         - CHEBI:37585
@@ -759,12 +779,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 +794,23 @@
         - 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
+      - chebi:
         - CHEBI:15361
         - CHEBI:14987
         - CHEBI:8685
@@ -799,19 +818,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,19 +842,15 @@
     - 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: ''
-    - metabolites: !!omap
-      - h_c: 1
-      - h_e: -1
-      - lac__D_c: 1
-      - lac__D_e: -1
+    - metabolites: !!omap []
     - lower_bound: -1000.0
     - upper_bound: 1000.0
-    - gene_reaction_rule: b3603 or b2975
+    - gene_reaction_rule: ''
   - !!omap
     - id: ENO
     - name: enolase
@@ -849,8 +861,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 +871,9 @@
     - lower_bound: -10.0
     - upper_bound: 1000.0
     - gene_reaction_rule: ''
-    - annotation:
-        bigg.reaction: glc
-        sbo: sbo:0000627
+    - annotation: !!omap
+      - bigg.reaction: glc
+      - sbo: SBO:0000627
   - !!omap
     - id: EX_h_e
     - name: H+ exchange
@@ -870,9 +882,9 @@
     - lower_bound: -1000.0
     - upper_bound: 1000.0
     - gene_reaction_rule: ''
-    - annotation:
-        bigg.reaction: h
-        sbo: SBO:0000627
+    - annotation: !!omap
+      - bigg.reaction: h
+      - sbo: SBO:0000627
   - !!omap
     - id: EX_lac__D_e
     - name: D-lactate exchange
@@ -881,6 +893,9 @@
     - lower_bound: 0.0
     - upper_bound: 1000.0
     - gene_reaction_rule: ''
+    - annotation: !!omap
+      - bigg.reaction: lac__D
+      - sbo: SBO:0000627
   - !!omap
     - id: FBA
     - name: fructose-bisphosphate aldolase
@@ -891,8 +906,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 +921,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
@@ -918,10 +933,10 @@
       - pyr_c: 1.0
     - lower_bound: 0.0
     - 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
+    - gene_reaction_rule: ( b2415 and b2417 and b1101 and b2416 ) or ( b2415 and b2417
+        and b1621 and b2416 ) or ( b2415 and b1818 and b1817 and b1819 and b2416 )
+    - annotation: !!omap
+      - bigg.reaction: GLCpts
   - !!omap
     - id: H2Ot
     - name: R H2O transport via - diffusion
@@ -931,8 +946,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
@@ -945,6 +960,18 @@
     - lower_bound: -1000.0
     - upper_bound: 1000.0
     - gene_reaction_rule: b2133 or b1380
+    - annotation: !!omap
+      - bigg.reaction: LDH_D
+      - biocyc: META:DLACTDEHYDROGNAD-RXN
+      - ec-code: 1.1.1.28
+      - kegg.reaction: R00704
+      - metanetx.reaction: MNXR101037
+      - rhea:
+        - '16369'
+        - '16370'
+        - '16371'
+        - '16372'
+      - sbo: SBO:0000375
   - !!omap
     - id: PFK
     - name: phosphofructokinase
@@ -958,8 +985,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 +996,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 +1009,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 +1020,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 +1033,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 +1047,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 +1058,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 +1079,8 @@
   - !!omap
     - id: b1676
     - name: pykF
-    - annotation:
-        ncbigi:
+    - annotation: !!omap
+      - ncbigi:
         - GI:1208453
         - GI:1652654
   - !!omap
@@ -1095,36 +1122,30 @@
   - !!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
-  - !!omap
-    - id: b2975
-    - name: glcA
+    - annotation: !!omap
+      - ncbigi: GI:1653609
   - !!omap
     - id: b2987
     - name: pitB
   - !!omap
     - id: b3493
     - name: pitA
-  - !!omap
-    - id: b3603
-    - name: lldP
   - !!omap
     - id: b3612
     - name: gpmM
   - !!omap
     - id: b3916
     - name: pfkA
-    - annotation:
-        ncbigi:
+    - annotation: !!omap
+      - ncbigi:
         - GI:1006614
         - GI:1651919
   - !!omap
@@ -1133,8 +1154,8 @@
   - !!omap
     - id: b4025
     - name: pgi
-    - annotation:
-        ncbigi: GI:1653253
+    - annotation: !!omap
+      - ncbigi: GI:1653253
   - !!omap
     - id: b4395
     - name: ytjC


=====================================
cobra/test/data/mini_fbc2.xml
=====================================
The diff for this file was not included because it is too large.

=====================================
cobra/test/data/mini_fbc2.xml.bz2
=====================================
Binary files a/cobra/test/data/mini_fbc2.xml.bz2 and b/cobra/test/data/mini_fbc2.xml.bz2 differ


=====================================
cobra/test/data/mini_fbc2.xml.gz
=====================================
Binary files a/cobra/test/data/mini_fbc2.xml.gz and b/cobra/test/data/mini_fbc2.xml.gz differ


=====================================
cobra/test/data/salmonella.pickle
=====================================
Binary files a/cobra/test/data/salmonella.pickle and b/cobra/test/data/salmonella.pickle differ


=====================================
cobra/test/data/update_pickles.py
=====================================
@@ -9,8 +9,10 @@ from json import dump as json_dump
 import cobra
 from cobra.io import (
     load_matlab_model, read_sbml_model, save_json_model, save_matlab_model,
-    write_sbml_model)
-from cobra.io.sbml3 import write_sbml2
+    save_yaml_model, write_sbml_model)
+
+
+# from cobra.io.sbml3 import write_sbml2
 
 
 # This script regenerates pickles of cobra Models.  Should be
@@ -26,7 +28,7 @@ config.solver = "glpk"
 
 
 # ecoli
-ecoli_model = read_sbml_model("iJO1366.xml")
+ecoli_model = read_sbml_model("iJO1366.xml.gz")
 with open("iJO1366.pickle", "wb") as outfile:
     dump(ecoli_model, outfile, protocol=2)
 
@@ -60,8 +62,6 @@ mini.add_reaction(ecoli_model.reactions.LDH_D.copy())
 mini.add_reaction(ecoli_model.reactions.EX_lac__D_e.copy())
 r = cobra.Reaction("D_LACt2")
 mini.add_reaction(r)
-r.gene_reaction_rule = ecoli_model.reactions.D__LACt2pp.gene_reaction_rule
-r.reaction = ecoli_model.reactions.D__LACt2pp.reaction.replace("_p", "_e")
 mini.reactions.GLCpts.gene_reaction_rule = \
     ecoli_model.reactions.GLCptspp.gene_reaction_rule
 
@@ -86,10 +86,10 @@ with open("mini.pickle", "wb") as outfile:
     dump(mini, outfile, protocol=2)
 save_matlab_model(mini, "mini.mat")
 save_json_model(mini, "mini.json", pretty=True)
+save_yaml_model(mini, "mini.yml")
 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:


=====================================
cobra/test/data/valid_annotation_format.json
=====================================
@@ -0,0 +1,19 @@
+{
+  "metabolites":[
+    {
+      "id":"4crsol_c",
+      "name":"",
+      "compartment":"c",
+      "annotation": {
+        "bigg.reaction": [["is", "PFK26"]],
+        "kegg.reaction": [["is", "R02732"]],
+        "rhea": [["is", "15656"]]
+      }
+    }
+  ],
+  "reactions":[],
+  "genes":[],
+  "id":"tesut",
+  "compartments":{},
+  "version": 1
+}


=====================================
cobra/test/data/valid_annotation_output.xml
=====================================
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version2" sboTerm="SBO:0000624" level="3" version="1" fbc:required="false">
+  <model metaid="meta_tesut" id="tesut" fbc:strict="true">
+    <listOfUnitDefinitions>
+      <unitDefinition id="mmol_per_gDW_per_hr">
+        <listOfUnits>
+          <unit kind="mole" exponent="1" scale="-3" multiplier="1"/>
+          <unit kind="gram" exponent="-1" scale="0" multiplier="1"/>
+          <unit kind="second" exponent="-1" scale="0" multiplier="3600"/>
+        </listOfUnits>
+      </unitDefinition>
+    </listOfUnitDefinitions>
+    <listOfCompartments>
+      <compartment id="c" constant="true"/>
+    </listOfCompartments>
+    <listOfSpecies>
+      <species metaid="meta_M_4crsol_c" id="M_4crsol_c" compartment="c" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false">
+        <annotation>
+          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:vCard4="http://www.w3.org/2006/vcard/ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
+            <rdf:Description rdf:about="#meta_M_4crsol_c">
+              <bqbiol:is>
+                <rdf:Bag>
+                  <rdf:li rdf:resource="https://identifiers.org/bigg.reaction/PFK26"/>
+                  <rdf:li rdf:resource="https://identifiers.org/kegg.reaction/R02732"/>
+                  <rdf:li rdf:resource="https://identifiers.org/rhea/15656"/>
+                </rdf:Bag>
+              </bqbiol:is>
+            </rdf:Description>
+          </rdf:RDF>
+        </annotation>
+      </species>
+    </listOfSpecies>
+    <listOfParameters>
+      <parameter sboTerm="SBO:0000626" id="cobra_default_lb" value="-1000" constant="true"/>
+      <parameter sboTerm="SBO:0000626" id="cobra_default_ub" value="1000" constant="true"/>
+      <parameter sboTerm="SBO:0000626" id="cobra_0_bound" value="0" constant="true"/>
+      <parameter sboTerm="SBO:0000625" id="minus_inf" value="-INF" constant="true"/>
+      <parameter sboTerm="SBO:0000625" id="plus_inf" value="INF" constant="true"/>
+    </listOfParameters>
+    <fbc:listOfObjectives fbc:activeObjective="obj">
+      <fbc:objective fbc:id="obj" fbc:type="maximize"/>
+    </fbc:listOfObjectives>
+  </model>
+</sbml>


=====================================
cobra/test/test_core/test_group.py
=====================================
@@ -24,6 +24,10 @@ def test_group_add_elements(model):
     group.add_members(reactions_for_larger_group)
     assert len(group.members) == num_total_members
 
+    # the order of members should be the same as the loaded one
+    for i in range(num_total_members):
+        assert group.members[i] == model.reactions[i]
+
 
 def test_group_kind():
     group = Group("arbitrary_group1")


=====================================
cobra/test/test_core/test_model.py
=====================================
@@ -669,13 +669,14 @@ def test_change_objective(model):
 def test_problem_properties(model):
     new_variable = model.problem.Variable("test_variable")
     new_constraint = model.problem.Constraint(Zero,
-                                              name="test_constraint")
+                                              name="test_constraint",
+                                              lb=0)
     model.add_cons_vars([new_variable, new_constraint])
-    assert "test_variable" in model.variables.keys()
-    assert "test_constraint" in model.constraints.keys()
+    assert "test_variable" in model.variables
+    assert "test_constraint" in model.constraints
     model.remove_cons_vars([new_constraint, new_variable])
-    assert "test_variable" not in model.variables.keys()
-    assert "test_constraint" not in model.variables.keys()
+    assert "test_variable" not in model.variables
+    assert "test_constraint" not in model.variables
 
 
 def test_solution_data_frame(model):
@@ -912,16 +913,20 @@ def test_change_objective(model):
 
 def test_set_reaction_objective(model):
     model.objective = model.reactions.ACALD
-    assert str(model.objective.expression) == str(
+    assert same_ex(
+        model.objective.expression,
         1.0 * model.reactions.ACALD.forward_variable -
-        1.0 * model.reactions.ACALD.reverse_variable)
+        1.0 * model.reactions.ACALD.reverse_variable
+    )
 
 
 def test_set_reaction_objective_str(model):
     model.objective = model.reactions.ACALD.id
-    assert str(model.objective.expression) == str(
+    assert same_ex(
+        model.objective.expression,
         1.0 * model.reactions.ACALD.forward_variable -
-        1.0 * model.reactions.ACALD.reverse_variable)
+        1.0 * model.reactions.ACALD.reverse_variable
+    )
 
 
 def test_invalid_objective_raises(model):
@@ -933,6 +938,7 @@ def test_invalid_objective_raises(model):
 
 @pytest.mark.skipif("cplex" not in solvers, reason="need cplex")
 def test_solver_change(model):
+    model.solver = "glpk"
     solver_id = id(model.solver)
     problem_id = id(model.solver.problem)
     solution = model.optimize().fluxes
@@ -944,6 +950,7 @@ def test_solver_change(model):
 
 
 def test_no_change_for_same_solver(model):
+    model.solver = "glpk"
     solver_id = id(model.solver)
     problem_id = id(model.solver.problem)
     model.solver = "glpk"


=====================================
cobra/test/test_core/test_summary/test_metabolite_summary.py
=====================================
@@ -4,6 +4,7 @@
 
 from __future__ import absolute_import
 
+import numpy as np
 import pytest
 
 from cobra.flux_analysis.parsimonious import pfba
@@ -18,7 +19,7 @@ def test_metabolite_summary_to_table_previous_solution(model, opt_solver, met):
     solution = pfba(model)
 
     expected_entry = ['PRODUCING CYTBD     100    43.6  2.0 h_c + 0.5 o2_c + '
-                      'q8h2_c --> h2o_c + 2.0 h_...']
+                      'q8h2_c --> h2o_c + 2.0 h_']
 
     with captured_output() as (out, _):
         print(model.metabolites.get_by_id(met).summary(solution))
@@ -50,10 +51,10 @@ def test_metabolite_summary_to_table(model, opt_solver, met, names):
     if names:
         expected_entry = ['PRODUCING cytochrome oxidase bd '
                           '(ubiquinol-8: 2 protons)    100    43.6  '
-                          '2.0 H+ + 0.5 O2 + Ubiquinol-8 --> H2O + 2.0 H+...']
+                          '2.0 H+ + 0.5 O2 + Ubiquinol-8 --> H2O + 2.0 H+']
     else:
         expected_entry = ['PRODUCING CYTBD     100    43.6  2.0 h_c + '
-                          '0.5 o2_c + q8h2_c --> h2o_c + 2.0 h_...']
+                          '0.5 o2_c + q8h2_c --> h2o_c + 2.0 h_']
 
     with captured_output() as (out, _):
         print(model.metabolites.get_by_id(met).summary(names=names))
@@ -105,4 +106,7 @@ def test_metabolite_summary_to_frame_with_fva(model, opt_solver, fraction,
 
     out_df = model.metabolites.get_by_id(met).summary(fva=fraction).to_frame()
 
-    assert out_df['PERCENT'].tolist() == expected_percent
+    assert np.allclose(
+        out_df['PERCENT'].tolist(),
+        expected_percent,
+        1e-6, 1e-6)


=====================================
cobra/test/test_io/test_annotation_format.py
=====================================
@@ -0,0 +1,27 @@
+from os.path import join
+
+import pytest
+
+from cobra.io import load_json_model, write_sbml_model
+
+
+def test_load_json_model_valid(data_directory, tmp_path):
+    """Test loading a valid annotation from JSON."""
+    path_to_file = join(data_directory, "valid_annotation_format.json")
+    model = load_json_model(path_to_file)
+    expected = {
+        'bigg.reaction': [['is', 'PFK26']],
+        'kegg.reaction': [['is', 'R02732']],
+        'rhea': [['is', '15656']]
+    }
+    for metabolite in model.metabolites:
+        assert metabolite.annotation == expected
+    path_to_output = join(str(tmp_path), 'valid_annotation_output.xml')
+    write_sbml_model(model, path_to_output)
+
+
+def test_load_json_model_invalid(data_directory):
+    """Test that loading an invalid annotation from JSON raises TypeError"""
+    path = join(data_directory, "invalid_annotation_format.json")
+    with pytest.raises(TypeError):
+        model = load_json_model(path)


=====================================
cobra/test/test_io/test_notes.py
=====================================
@@ -0,0 +1,36 @@
+from os.path import join
+
+import pytest
+
+import cobra
+from cobra.io import read_sbml_model, write_sbml_model
+
+
+def test_notes(tmp_path):
+    """Testing if model notes are written in SBML"""
+    path_to_file = join(str(tmp_path), "model_notes.xml")
+
+    # making a minimal cobra model to test notes
+    model = cobra.Model("e_coli_core")
+    model.notes["Remark"] = "...Model Notes..."
+    met = cobra.Metabolite("pyr_c", compartment="c")
+    model.add_metabolites([met])
+    met.notes["Remark"] = "Note with \n newline"
+    rxn = cobra.Reaction("R_ATPM")
+    model.add_reactions([rxn])
+    rxn.notes["Remark"] = "What about me?"
+    model.objective_direction = "max"
+    model.objective = rxn
+    write_sbml_model(model, path_to_file)
+
+    # reading the model back
+    model_after_reading = read_sbml_model(path_to_file)
+    met_after_reading = model_after_reading.metabolites.get_by_id("pyr_c")
+    reaction_after_reading = model_after_reading.reactions.get_by_id("R_ATPM")
+
+    # checking if notes are written to model
+    assert model_after_reading.notes["Remark"] == "...Model Notes..."
+
+    # checking notes for metabolite and reaction
+    assert met_after_reading.notes["Remark"] == "Note with \n newline"
+    assert reaction_after_reading.notes["Remark"] == "What about me?"


=====================================
cobra/test/test_io/test_sbml.py
=====================================
@@ -282,7 +282,7 @@ def test_validate(data_directory):
                                              check_modeling_practice=True)
         assert model1
         assert errors
-        assert len(errors["SBML_WARNING"]) == 23
+        assert len(errors["SBML_WARNING"]) == 0
 
 
 def test_validation_warnings(data_directory):


=====================================
release-notes/0.18.0.md
=====================================
@@ -0,0 +1,29 @@
+# Release notes for cobrapy 0.18.0
+
+## New features
+
+* Support writing SBML notes on model objects
+
+## Fixes
+
+* Test alternative solver
+* Handle repeated infeasible optimizations in `minimal_medium`
+* Allow newline characters in SBML notes
+
+## Backwards incompatible changes
+
+* Change the container type of `groups` from `set` to `DictList`
+* Expect annotation attributes to be of type `dict`
+
+## Internal
+
+* Update Travis CI configuration
+* Add Python 3.8 to PyPI classifiers
+
+## Contributors
+
+* @BenjaSanchez
+* @cdiener
+* @ecederstrand
+* @Hemant27031999
+


=====================================
setup.cfg
=====================================
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 0.17.1
+current_version = 0.18.0
 commit = True
 tag = True
 parse = (?P<major>\d+)


=====================================
setup.py
=====================================
@@ -38,7 +38,7 @@ except IOError:
 if __name__ == "__main__":
     setup(
         name="cobra",
-        version="0.17.1",
+        version="0.18.0",
         packages=find_packages(),
         setup_requires=setup_requirements,
         install_requires=[
@@ -85,11 +85,10 @@ if __name__ == "__main__":
             'License :: OSI Approved :: GNU General Public License v2'
                 ' or later (GPLv2+)',
             'Operating System :: OS Independent',
-            'Programming Language :: Python :: 2.7',
-            'Programming Language :: Python :: 3.4',
             'Programming Language :: Python :: 3.5',
             'Programming Language :: Python :: 3.6',
             'Programming Language :: Python :: 3.7',
+            'Programming Language :: Python :: 3.8',
             'Programming Language :: Python :: Implementation :: CPython',
             'Topic :: Scientific/Engineering',
             'Topic :: Scientific/Engineering :: Bio-Informatics'


=====================================
tox.ini
=====================================
@@ -1,15 +1,16 @@
 [tox]
-envlist = pep8, isort, safety, py{27,35,36,37}
+envlist = pep8, isort, safety, py3{5,6,7,8,9}
 
 [travis]
 os =
-    linux: pep8, isort, safety, py{27,35,36,37}
-    osx: py{27,35}
+    linux: pep8, isort, safety, py3{5,6,7,8,9}
+    osx: py35
 python =
-    2.7: py27, pep8, safety
     3.5: py35, pep8, isort, safety
     3.6: py36
     3.7: py37
+    3.8: py38
+    3.9: py39
 
 [testenv]
 extras =



View it on GitLab: https://salsa.debian.org/med-team/python-cobra/-/commit/04049da7c230ede7cef68265d88477767a29257d

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-cobra/-/commit/04049da7c230ede7cef68265d88477767a29257d
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200404/b07010d3/attachment-0001.html>


More information about the debian-med-commit mailing list