Skip to content

fix: four writer, task and gene-pruning problems from #178 - #179

Merged
edkerk merged 5 commits into
developfrom
fix/178-writers-and-tasks
Oct 21, 2026
Merged

edkerk merged 5 commits into
developfrom
fix/178-writers-and-tasks

Conversation

@edkerk

@edkerk edkerk commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Closes #178.

  • io/yaml.py _QUOTE_RESOLVER_PATTERN: the YAML writer left NO, yes, on and the other YAML 1.1 booleans unquoted, so a YAML 1.1 loader such as PyYAML read nitric oxide's name: NO as False. They are quoted in any case, as true and false already were. RAVEN's writeYAMLmodel.m (needsQuote) needs the same change.
  • io/git.py _write_sbml (new): cobra writes the gene id as fbc:label, so RAVEN's importModel, which reads geneShortNames from fbc:label before fbc:name, read the gene ids as gene short names. The label is now the gene name; a gene without a name keeps its id.
  • tasks/check.py _metabolite_bounds: the outputs overwrote the bounds set by the inputs, and a metabolite listed twice on one side kept its last line. Both now raise a ValueError with the messages of RAVEN's checkTasks. A task list with such a line (for example task 21 of Human-GEM's CellFie consensus list) now stops check_tasks, find_task_essential_reactions and the ftINIT gap-filling until the list is fixed.
  • init/genes.py remove_low_score_genes: when every alternative of an OR rule scored negative and several shared the best score, the first one was kept without a trace. The new keyword-only argument tied_reactions receives the ids of these reactions; the return value is unchanged.

A YAML 1.1 loader such as PyYAML read an unquoted `name: NO` (nitric
oxide) as False. y, n, yes, no, on and off are now quoted in any case,
as true and false already were.

#178
cobra's writer puts the gene product id in fbc:label, and RAVEN's
importModel reads geneShortNames from fbc:label before fbc:name, so it
read the gene ids as gene short names. Genes without a name keep the id
as label.

#178
The outputs of a task were applied after its inputs and overwrote their
bounds, so a metabolite that is both IN and OUT with nonzero lower bounds
became "produce exactly LB", and a metabolite listed twice on one side
kept its last line. Both now raise a ValueError with the messages of
RAVEN's checkTasks.

#178
When all alternatives of an OR rule score negative and several share the
best score, remove_low_score_genes keeps the first, so the result depends
on the order of the rule. A list passed as tied_reactions receives the
ids of these reactions.

#178
pip 26.2.2 refuses to replace itself on Windows when run as plain pip and exits 1, so every Windows job failed before running any test.
@edkerk
edkerk merged commit 516b001 into develop Oct 21, 2026
8 checks passed
@edkerk
edkerk deleted the fix/178-writers-and-tasks branch October 21, 2026 17:54
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.

YAML and SBML writers, check_tasks and remove_low_score_genes: four problems seen in Human-GEM

1 participant