Skip to content

feat: add descriptive names to all reactions (100% coverage) - #1052

Merged
edkerk merged 8 commits into
developfrom
feat/reaction-names
Jul 11, 2026
Merged

feat: add descriptive names to all reactions (100% coverage)#1052
edkerk merged 8 commits into
developfrom
feat/reaction-names

Conversation

@edkerk

@edkerk edkerk commented Jul 11, 2026

Copy link
Copy Markdown
Member

Main improvements in this PR:

Addresses #181 by filling in a descriptive name for every reaction that had none. Reaction name coverage goes from 56% to 100% (all 12877 reactions named). The change is confined to the name field, so model structure and balance are unchanged, and the generation is scripted so it can be re-run as the model grows.

Names come from six sources, in priority order:

  • Transport reactions (2457): the transported metabolite and its compartments, e.g. transport of GSH (cytosol to mitochondria).
  • EC number (1526): the ExPASy/IUBMB enzyme name for the reaction's EC plus the primary substrate, e.g. carboxylesterase (substrate) (transferred ECs resolved to the current entry first).
  • Single gene (934): the gene's enzyme name, trimmed of nomenclature suffixes like "family N member M", plus the primary substrate, e.g. cytochrome P450 (ethanol).
  • Gene consensus (184): multi-gene reactions where the genes agree on one enzyme name (unanimously or by clear majority), plus the substrate.
  • Reaction chemistry (553): for reactions with no EC, gene agreement or KEGG name, the transformation is reconstructed from the stoichiometry in the style <substrate> <transformation>, e.g. fructose phosphorylation (ATP to ADP), retinoate activation (ATP to AMP + PPi + CoA), <substrate> to <product> conversion otherwise. These are derived from the reaction's own chemistry rather than an external database, so a few edge cases may be approximate.
  • KEGG systematic name (6): the few reactions whose KEGG entry provides a real name (equation-only entries skipped).

Only previously unnamed reactions were touched.

Follow-up commits also normalise problematic characters across all reaction names (collapse --/--- to -, remove stray spaces left by ExPASy line-wrapping while keeping genuine elisions like "formate- and CO-forming", replace semicolons with commas, collapse double spaces, trim trailing punctuation and leading/trailing whitespace) and shorten the longest names so they roughly convey the reaction rather than fully specify it. Any name over ~80 characters is regenerated to a short form (gene or EC enzyme name, else a transport/exchange or chemistry-derived form), with long metabolite names taken to their KEGG glycan id where present or truncated. The longest name drops from 324 to 90 characters (median 45). This deliberately replaces some official systematic names with rougher, shorter ones.

I hereby confirm that I have:

  • Tested my code on my own computer for running the model
  • Selected develop as a target branch
  • Any removed reactions and metabolites have been moved to the corresponding deprecated identifier lists

Fill in descriptive names for reactions that had none, a long-standing
request in #181. Names come from three sources:

- Transport reactions (2457): generated from the transported metabolite
  and its compartments, e.g. "transport of GSH (cytosol to mitochondria)".
- Single-gene reactions (934): named from the gene's enzyme name plus the
  primary substrate, e.g. "cytochrome P450 (ethanol)".
- KEGG reaction names (6): remaining reactions whose KEGG entry has a
  systematic name.

Only reactions that had no name were touched and the change is confined to
the name field, so model structure and balance are unchanged. This leaves
2263 reactions still unnamed (mostly metabolic reactions without a KEGG
name or with several genes), for a later pass.
@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown

This PR has been automatically tested with GH Actions. Here are the results of the quality-control tests:

MACAW: dead-end and duplicate tests

Mass and charge balance

(balance report unavailable)

More detailed output is committed to data/testResults/ (macaw_results.csv and balance_results.csv).

Note: In the case of multiple test runs, this post will be edited.

Extend the reaction naming to reactions with an EC code or several genes:

- EC-based (1526): the ExPASy/IUBMB enzyme name for the reaction's EC,
  plus the primary substrate, e.g. "carboxylesterase (substrate)".
  Transferred EC numbers are resolved to the current entry first.
- Gene consensus (184): where a reaction's genes share one enzyme name,
  unanimously or by clear majority, that name plus the substrate, e.g.
  "sulfotransferase (PAPS)".

Reaction name coverage is now 96% (12324 of 12877). The change is confined
to the name field. The ~553 still unnamed have no EC, no gene agreement and
no usable KEGG name.
@edkerk
edkerk force-pushed the feat/reaction-names branch from f2fee9b to 575419b Compare July 11, 2026 19:19
@edkerk edkerk changed the title feat: add descriptive names to 3397 reactions feat: add descriptive names to 5107 reactions Jul 11, 2026
@edkerk edkerk added this to the 2.0.1 milestone Jul 11, 2026
@edkerk edkerk changed the title feat: add descriptive names to 5107 reactions feat: add descriptive names to all reactions (100% coverage) Jul 11, 2026
Name the reactions that have no EC, no gene agreement and no KEGG name by
reconstructing the transformation from the reaction stoichiometry, in the
style "<substrate> <transformation>":

- cofactor signature (262): e.g. "fructose phosphorylation" (ATP -> ADP),
  "propane-1,2-diol oxidation" (NAD+), "retinoate activation" (ATP ->
  AMP + PPi + CoA), "5-hydroxyisourate decarboxylation" (CO2 released),
  "3,3-diiodo-L-thyronine sulfation" (PAPS).
- pool reactions (39): "<pool> formation".
- remaining conversions (252): "<substrate> to <product> conversion".

Reaction name coverage is now 100% (12877 of 12877). Names are derived
from the reaction's own chemistry rather than an external database, so a
few edge cases are approximate. The change is confined to the name field.
edkerk added 4 commits July 11, 2026 21:47
Follow-up cleanup of the reaction names:

- Normalise problematic characters: collapse double/triple hyphens from
  IUBMB-style names (e.g. "glutamic--pyruvic" -> "glutamic-pyruvic",
  "NADPH---hemoprotein" -> "NADPH-hemoprotein"), remove the stray space
  left by ExPASy line-wrapping ("4-beta-N- acetyl..." -> "4-beta-N-acetyl..."
  while keeping genuine elisions like "formate- and CO-forming"), replace
  semicolons with commas, collapse double spaces, and trim trailing
  punctuation and leading/trailing whitespace.
- Shorten 117 over-long names (>100 characters) by dropping the appended
  substrate where the enzyme name alone is descriptive, e.g.
  "mannosyl-oligosaccharide 1,2-alpha-mannosidase (long glycan)" ->
  "mannosyl-oligosaccharide 1,2-alpha-mannosidase".

Change is confined to the name field. The names that are still long are
driven by long metabolite names (transport of large N-glycans, conversions
of complex lipids) or are pre-existing systematic KEGG names, and would
need metabolite-name abbreviation to shorten further.
Where a reaction name is long because of a long glycan metabolite name and
that metabolite has a KEGG glycan identifier (Gxxxxx), use the identifier
as the abbreviation, e.g. "transport of fucacgalfucgalacglcgalgluside
heparan sulfate (cytosol to Golgi apparatus)" -> "transport of G00043
(cytosol to Golgi apparatus)".

Only whole metabolite names are replaced (boundary-checked), so a glycan
name that is a substring of a larger metabolite is not touched. Most of the
longest glycan names (e.g. the N-glycan transport reactions) have no KEGG
glycan id in the model and are unchanged; adding those identifiers is a
metabolite-annotation task.
Aggressively shorten reaction names over ~80 characters so they roughly
convey the reaction rather than fully specifying it: names represent
meaning, they do not need to match a systematic string. 730 names
shortened; the longest drops from 324 to 90 characters (median 45).

For each long name a short one is generated in priority order:
- gene or EC enzyme name (plus the primary substrate when short), so the
  324-character "dolichyl ... glucosyltransferase" systematic names become
  "ALG6/ALG8 alpha-1,3-glucosyltransferase", and cytochrome P450 systematic
  names become "cytochrome P450 (substrate)";
- transport reactions become "transport of <metabolite> (<c1> to <c2>)"
  and exchanges "Exchange of <metabolite>", taking the primary metabolite
  name and dropping synonyms and lipid-detail parentheticals;
- otherwise a chemistry-derived name ("<substrate> <transformation>" or
  "<substrate> to <product> conversion").

Long metabolite names are abbreviated to their KEGG glycan id where present,
otherwise truncated. Change is confined to the name field.
@edkerk

edkerk commented Jul 11, 2026

Copy link
Copy Markdown
Member Author

No structural model changes

@edkerk
edkerk merged commit c813b92 into develop Jul 11, 2026
1 of 6 checks passed
@edkerk
edkerk deleted the feat/reaction-names branch July 11, 2026 20:46
@edkerk edkerk mentioned this pull request Jul 15, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant