History of bacillus_megaterium_metabolism
The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.
[entries] Remove superfluous details of the upstream distribution from the descriptions dc07aa0
The descriptions mentioned incidental details of how the upstream data are made available: the file formats (CSV, JSON, XML, GEXF, SBML, HIF, Pajek, UCINET, ...), file names, where the files were published or obtained from (Zenodo, figshare, Kaggle, the Pajek datasets page, the Internet Archive), and that some networks are only available in the gt format. These are left out; caveats about the data themselves are kept, referring to "the data" instead of "the file". The description of sp_baboons now lists its properties instead of the upstream columns, and says that events without a recipient are left out.
diff --git a/entries/bacillus_megaterium_metabolism/__init__.py b/entries/bacillus_megaterium_metabolism/__init__.py
index 8fb85b8..727056d 100644
--- a/entries/bacillus_megaterium_metabolism/__init__.py
+++ b/entries/bacillus_megaterium_metabolism/__init__.py
@@ -21,14 +21,14 @@ from .. import *
import xml.etree.ElementTree as ET
title = "Bacillus megaterium metabolic network (2019)"
-description = """Metabolic network of the bacterium *Bacillus megaterium* strain DSM319, from the manually curated genome-scale metabolic model iJA1121 of Aminian-Dehkordi et al. The model was reconstructed from a draft network obtained by aligning the genome of DSM319 with those of other *B. megaterium* strains and comparing with the existing models of the strain WSH002 and of *B. subtilis*, followed by manual curation and gap filling, and was validated against growth phenotypes on different carbon and nitrogen sources. The model contains 1,709 reactions, 1,349 metabolites in two compartments (cytosol and extracellular space), and 1,121 genes, and it is distributed in the SBML format for flux balance analysis.
+description = """Metabolic network of the bacterium *Bacillus megaterium* strain DSM319, from the manually curated genome-scale metabolic model iJA1121 of Aminian-Dehkordi et al. The model was reconstructed from a draft network obtained by aligning the genome of DSM319 with those of other *B. megaterium* strains and comparing with the existing models of the strain WSH002 and of *B. subtilis*, followed by manual curation and gap filling, and was validated against growth phenotypes on different carbon and nitrogen sources. The model contains 1,709 reactions, 1,349 metabolites in two compartments (cytosol and extracellular space), and 1,121 genes, for flux balance analysis.
The network is bipartite and directed, with reactions on one side, and metabolites and genes on the other. Each reactant (substrate) of a reaction points to the reaction, and each reaction points to its products, as written in the model (reversible reactions can also proceed in the reverse direction). Each gene associated with a reaction (as a catalysing enzyme, or a subunit of an enzyme complex) points to the reaction. The same compound in different compartments corresponds to different metabolite nodes. Exchange reactions, which model the uptake and secretion of extracellular metabolites, have a single metabolite. The 46 genes of the model that are not associated with any reaction (some of which have malformed identifiers in the model, such as "orBMD_0557") are isolated nodes.
The network has the following properties:
- (Node) `name`: the name of the metabolite or reaction, or the locus tag of the gene.
-- (Node) `id`: the identifier in the SBML model.
+- (Node) `id`: the identifier in the model.
- (Node) `kind`: either "metabolite", "reaction", or "gene".
- (Node) `is_reaction`: whether the node is a reaction.
- (Node) `compartment` (metabolites): "c" for cytosol, "e" for extracellular.
[entries] Add the date when each entry was added, and remove icon_hash beff7c9
The dates are those of the commits that first added the entries' files (2020-08-11 for the entries of the initial commit); renamed entries keep the date of their first name. Changed: none
diff --git a/entries/bacillus_megaterium_metabolism/__init__.py b/entries/bacillus_megaterium_metabolism/__init__.py
index 3f04b45..8fb85b8 100644
--- a/entries/bacillus_megaterium_metabolism/__init__.py
+++ b/entries/bacillus_megaterium_metabolism/__init__.py
@@ -45,7 +45,7 @@ The network has the following properties:
tags = ['Biological', 'Metabolic', 'Unweighted', 'Metadata']
url = 'https://doi.org/10.1038/s41598-019-55041-w'
citation = [('J. Aminian-Dehkordi, S. M. Mousavi, A. Jafari, I. Mijakovic, S.-A. Marashi, "Manually curated genome-scale reconstruction of the metabolic network of Bacillus megaterium DSM319." Scientific Reports 9, 18762 (2019)', 'https://doi.org/10.1038/s41598-019-55041-w')]
-icon_hash = '5df95cc24bbf13da17de2268'
+date_added = '2026-10-25'
upstream_license = ("CC BY 4.0", "https://creativecommons.org/licenses/by/4.0/")
upstream_prefix = 'https://static-content.springer.com/esm/art%3A10.1038%2Fs41598-019-55041-w/MediaObjects'
files = [('41598_2019_55041_MOESM2_ESM.xml', None, None)]
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) bc3dbbd
The lists of properties at the end of the descriptions marked edge properties with "Edge" but left node properties unmarked, or grouped them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property was often unclear. Every item now starts with (Node), (Edge) or (Graph), followed by the property names, a colon and the explanation, one item per property or group of properties; qualifications (kinds of nodes, networks) follow the names in parentheses. Properties that were only named got a short explanation, and a few items that named the wrong kind of property were corrected.
diff --git a/entries/bacillus_megaterium_metabolism/__init__.py b/entries/bacillus_megaterium_metabolism/__init__.py
index e754ef7..3f04b45 100644
--- a/entries/bacillus_megaterium_metabolism/__init__.py
+++ b/entries/bacillus_megaterium_metabolism/__init__.py
@@ -27,10 +27,21 @@ The network is bipartite and directed, with reactions on one side, and metabolit
The network has the following properties:
-- All nodes: `name`, the name of the metabolite or reaction, or the locus tag of the gene; `id`, the identifier in the SBML model; `kind`, either "metabolite", "reaction", or "gene"; `is_reaction`, whether the node is a reaction.
-- Metabolites: `compartment` ("c" for cytosol, "e" for extracellular); `formula`, the chemical formula; `charge`; `kegg`, the KEGG compound identifier, if available.
-- Reactions: `subsystem`, the metabolic subsystem (e.g. "Amino acid metabolism", "Transporting system"); `ec`, the EC number(s) of the enzyme, if available; `reversible`, whether the reaction is reversible; `lower_bound` and `upper_bound`, the flux bounds in the model (in mmol per gram dry weight per hour); `gene_rule`, the gene-reaction rule, as a boolean expression of the genes required by the reaction ("and" for enzyme complexes and "or" for isozymes).
-- Edges: `role`, either "reactant", "product", or "gene"; `stoichiometry`, the stoichiometric coefficient of the metabolite in the reaction (1 for genes)."""
+- (Node) `name`: the name of the metabolite or reaction, or the locus tag of the gene.
+- (Node) `id`: the identifier in the SBML model.
+- (Node) `kind`: either "metabolite", "reaction", or "gene".
+- (Node) `is_reaction`: whether the node is a reaction.
+- (Node) `compartment` (metabolites): "c" for cytosol, "e" for extracellular.
+- (Node) `formula` (metabolites): the chemical formula.
+- (Node) `charge` (metabolites): the charge.
+- (Node) `kegg` (metabolites): the KEGG compound identifier, if available.
+- (Node) `subsystem` (reactions): the metabolic subsystem (e.g. "Amino acid metabolism", "Transporting system").
+- (Node) `ec` (reactions): the EC number(s) of the enzyme, if available.
+- (Node) `reversible` (reactions): whether the reaction is reversible.
+- (Node) `lower_bound` and `upper_bound` (reactions): the flux bounds in the model (in mmol per gram dry weight per hour).
+- (Node) `gene_rule` (reactions): the gene-reaction rule, as a boolean expression of the genes required by the reaction ("and" for enzyme complexes and "or" for isozymes).
+- (Edge) `role`: either "reactant", "product", or "gene".
+- (Edge) `stoichiometry`: the stoichiometric coefficient of the metabolite in the reaction (1 for genes)."""
tags = ['Biological', 'Metabolic', 'Unweighted', 'Metadata']
url = 'https://doi.org/10.1038/s41598-019-55041-w'
citation = [('J. Aminian-Dehkordi, S. M. Mousavi, A. Jafari, I. Mijakovic, S.-A. Marashi, "Manually curated genome-scale reconstruction of the metabolic network of Bacillus megaterium DSM319." Scientific Reports 9, 18762 (2019)', 'https://doi.org/10.1038/s41598-019-55041-w')]
[entries] Remove unneeded code from the entries 2c69f19
Unneeded "global files" statements, unused imports and variables, f-strings without placeholders, duplicate keys in foodweb_little_rock (keeping the order and the values used), and the second definition of get_lines() in twitter_higgs. Nothing changes in the networks or descriptions. Changed: none
diff --git a/entries/bacillus_megaterium_metabolism/__init__.py b/entries/bacillus_megaterium_metabolism/__init__.py
index 8b47e6f..e754ef7 100644
--- a/entries/bacillus_megaterium_metabolism/__init__.py
+++ b/entries/bacillus_megaterium_metabolism/__init__.py
@@ -73,7 +73,6 @@ def fetch_upstream(force=False):
@coerce_props()
@annotate()
def parse(alts=None):
- global files
name = __name__.split(".")[-1]
for fname, alt, fmt in files:
if alts is not None and alt not in alts:
[entries] New entry: bacillus_megaterium_metabolism 3920434
diff --git a/entries/bacillus_megaterium_metabolism/__init__.py b/entries/bacillus_megaterium_metabolism/__init__.py
new file mode 100644
index 0000000..8b47e6f
--- /dev/null
+++ b/entries/bacillus_megaterium_metabolism/__init__.py
@@ -0,0 +1,155 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+from .. import *
+import xml.etree.ElementTree as ET
+
+title = "Bacillus megaterium metabolic network (2019)"
+description = """Metabolic network of the bacterium *Bacillus megaterium* strain DSM319, from the manually curated genome-scale metabolic model iJA1121 of Aminian-Dehkordi et al. The model was reconstructed from a draft network obtained by aligning the genome of DSM319 with those of other *B. megaterium* strains and comparing with the existing models of the strain WSH002 and of *B. subtilis*, followed by manual curation and gap filling, and was validated against growth phenotypes on different carbon and nitrogen sources. The model contains 1,709 reactions, 1,349 metabolites in two compartments (cytosol and extracellular space), and 1,121 genes, and it is distributed in the SBML format for flux balance analysis.
+
+The network is bipartite and directed, with reactions on one side, and metabolites and genes on the other. Each reactant (substrate) of a reaction points to the reaction, and each reaction points to its products, as written in the model (reversible reactions can also proceed in the reverse direction). Each gene associated with a reaction (as a catalysing enzyme, or a subunit of an enzyme complex) points to the reaction. The same compound in different compartments corresponds to different metabolite nodes. Exchange reactions, which model the uptake and secretion of extracellular metabolites, have a single metabolite. The 46 genes of the model that are not associated with any reaction (some of which have malformed identifiers in the model, such as "orBMD_0557") are isolated nodes.
+
+The network has the following properties:
+
+- All nodes: `name`, the name of the metabolite or reaction, or the locus tag of the gene; `id`, the identifier in the SBML model; `kind`, either "metabolite", "reaction", or "gene"; `is_reaction`, whether the node is a reaction.
+- Metabolites: `compartment` ("c" for cytosol, "e" for extracellular); `formula`, the chemical formula; `charge`; `kegg`, the KEGG compound identifier, if available.
+- Reactions: `subsystem`, the metabolic subsystem (e.g. "Amino acid metabolism", "Transporting system"); `ec`, the EC number(s) of the enzyme, if available; `reversible`, whether the reaction is reversible; `lower_bound` and `upper_bound`, the flux bounds in the model (in mmol per gram dry weight per hour); `gene_rule`, the gene-reaction rule, as a boolean expression of the genes required by the reaction ("and" for enzyme complexes and "or" for isozymes).
+- Edges: `role`, either "reactant", "product", or "gene"; `stoichiometry`, the stoichiometric coefficient of the metabolite in the reaction (1 for genes)."""
+tags = ['Biological', 'Metabolic', 'Unweighted', 'Metadata']
+url = 'https://doi.org/10.1038/s41598-019-55041-w'
+citation = [('J. Aminian-Dehkordi, S. M. Mousavi, A. Jafari, I. Mijakovic, S.-A. Marashi, "Manually curated genome-scale reconstruction of the metabolic network of Bacillus megaterium DSM319." Scientific Reports 9, 18762 (2019)', 'https://doi.org/10.1038/s41598-019-55041-w')]
+icon_hash = '5df95cc24bbf13da17de2268'
+upstream_license = ("CC BY 4.0", "https://creativecommons.org/licenses/by/4.0/")
+upstream_prefix = 'https://static-content.springer.com/esm/art%3A10.1038%2Fs41598-019-55041-w/MediaObjects'
+files = [('41598_2019_55041_MOESM2_ESM.xml', None, None)]
+
+NS = {"s": "http://www.sbml.org/sbml/level3/version1/core",
+ "fbc": "http://www.sbml.org/sbml/level3/version1/fbc/version2",
+ "groups": "http://www.sbml.org/sbml/level3/version1/groups/version1",
+ "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#"}
+
+def _fbc(a):
+ return "{%s}%s" % (NS["fbc"], a)
+
+def _identifiers(el, kind):
+ return [li.get("{%s}resource" % NS["rdf"]).rsplit("/", 1)[-1]
+ for li in el.iterfind(".//rdf:li", NS)
+ if f"identifiers.org/{kind}/" in li.get("{%s}resource" % NS["rdf"], "")]
+
+def _gene_rule(el, labels):
+ tag = el.tag.split("}")[-1]
+ if tag == "geneProductRef":
+ return labels[el.get(_fbc("geneProduct"))]
+ args = [_gene_rule(c, labels) for c in el]
+ if tag in ("and", "or"):
+ return "(" + f" {tag} ".join(args) + ")"
+ return " ".join(args)
+
+def _genes(el):
+ return [r.get(_fbc("geneProduct"))
+ for r in el.iter("{%s}geneProductRef" % NS["fbc"])]
+
+def fetch_upstream(force=False):
+ return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+ force)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+ global files
+ name = __name__.split(".")[-1]
+ for fname, alt, fmt in files:
+ if alts is not None and alt not in alts:
+ continue
+ with open_upstream_file(name, fname, "rb") as f:
+ model = ET.parse(f).getroot().find("s:model", NS)
+
+ g = Graph(directed=True)
+ vp = {k: g.new_vp(t) for k, t in
+ [("name", "string"), ("id", "string"), ("kind", "string"),
+ ("is_reaction", "bool"), ("compartment", "string"),
+ ("formula", "string"), ("charge", "int"), ("kegg", "string"),
+ ("subsystem", "string"), ("ec", "string"),
+ ("reversible", "bool"), ("lower_bound", "double"),
+ ("upper_bound", "double"), ("gene_rule", "string")]}
+ g.ep.role = g.new_ep("string")
+ g.ep.stoichiometry = g.new_ep("double")
+
+ params = {p.get("id"): float(p.get("value"))
+ for p in model.iterfind("s:listOfParameters/s:parameter", NS)}
+ subsystem = {}
+ for grp in model.iterfind("groups:listOfGroups/groups:group", NS):
+ for m in grp.iterfind("groups:listOfMembers/groups:member", NS):
+ subsystem[m.get("{%s}idRef" % NS["groups"])] = \
+ grp.get("{%s}name" % NS["groups"])
+
+ vs = {}
+ for sp in model.iterfind("s:listOfSpecies/s:species", NS):
+ v = vs[sp.get("id")] = g.add_vertex()
+ vp["name"][v] = sp.get("name")
+ vp["id"][v] = sp.get("id")
+ vp["kind"][v] = "metabolite"
+ vp["compartment"][v] = sp.get("compartment")
+ vp["formula"][v] = sp.get(_fbc("chemicalFormula"), "")
+ vp["charge"][v] = int(sp.get(_fbc("charge"), 0))
+ vp["kegg"][v] = ";".join(_identifiers(sp, "kegg.compound"))
+
+ labels = {}
+ for gp in model.iterfind("fbc:listOfGeneProducts/fbc:geneProduct", NS):
+ gid = gp.get(_fbc("id"))
+ labels[gid] = gp.get(_fbc("label"))
+ v = vs[gid] = g.add_vertex()
+ vp["name"][v] = labels[gid]
+ vp["id"][v] = gid
+ vp["kind"][v] = "gene"
+
+ for r in model.iterfind("s:listOfReactions/s:reaction", NS):
+ v = g.add_vertex()
+ rid = r.get("id")
+ vp["name"][v] = r.get("name")
+ vp["id"][v] = rid
+ vp["kind"][v] = "reaction"
+ vp["is_reaction"][v] = True
+ vp["subsystem"][v] = subsystem.get(rid, "")
+ vp["ec"][v] = ";".join(_identifiers(r, "ec-code"))
+ vp["reversible"][v] = r.get("reversible") == "true"
+ vp["lower_bound"][v] = params[r.get(_fbc("lowerFluxBound"))]
+ vp["upper_bound"][v] = params[r.get(_fbc("upperFluxBound"))]
+ for sr in r.iterfind("s:listOfReactants/s:speciesReference", NS):
+ e = g.add_edge(vs[sr.get("species")], v)
+ g.ep.role[e] = "reactant"
+ g.ep.stoichiometry[e] = float(sr.get("stoichiometry"))
+ for sr in r.iterfind("s:listOfProducts/s:speciesReference", NS):
+ e = g.add_edge(v, vs[sr.get("species")])
+ g.ep.role[e] = "product"
+ g.ep.stoichiometry[e] = float(sr.get("stoichiometry"))
+ gpa = r.find("fbc:geneProductAssociation", NS)
+ if gpa is not None:
+ rule = _gene_rule(gpa, labels)
+ if rule.startswith("(") and rule.endswith(")"):
+ rule = rule[1:-1]
+ vp["gene_rule"][v] = rule
+ for gid in sorted(set(_genes(gpa))):
+ e = g.add_edge(vs[gid], v)
+ g.ep.role[e] = "gene"
+ g.ep.stoichiometry[e] = 1
+ for k, p in vp.items():
+ g.vp[k] = p
+ yield alt, g