Skip to content

sigmaFitter, getStandardKcat and getSubsetEcModel: plateau, subsystem case, empty subsystems, light ecModels - #15

Merged
edkerk merged 2 commits into
developfrom
fix/parity-round-3
Oct 30, 2026
Merged

edkerk merged 2 commits into
developfrom
fix/parity-round-3

Conversation

@edkerk

@edkerk edkerk commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Fixes in sigmaFitter, getStandardKcat and getSubsetEcModel that the comparison with geckopy (CompMetEng/raven-gecko-parity#141) turned up.

  • sigmaFitter returns the start of the growth plateau on every solver. When several sigma values give the same error, the error values on a plateau carry noise of about 1e-14 on GLPK, so min picked a point inside the plateau. It now takes the first sigma whose error is within a tolerance of the minimum, which gives 0.06 with GLPK and with Gurobi in the case of a binding uptake cap.
  • getStandardKcat treats subsystem names that differ only in letter case as one subsystem. The list was built with a case-sensitive unique and looked up with strcmpi, so a model with Pentose phosphate pathway and Pentose Phosphate Pathway (Human-GEM) failed with "Unable to perform assignment because the left and right sides have a different number of elements".
  • getStandardKcat handles a reaction with an empty subsystem, which gets the model-wide standard kcat. It raised "Index exceeds array bounds" when other reactions had a subsystem (iYali5-GEM).
  • getSubsetEcModel returns the model unchanged when no gene has to be removed. removeGenes was called with an empty list and raised.
  • getSubsetEcModel keeps the ec entries of the reactions that stay in a light ecModel. The ids in ec.rxns carry the 001_ prefix and the ids in model.rxns do not, so every ec entry was dropped.

Growth that is flat from some sigma on is returned with rounding noise by some solvers. The smallest sigma whose growth is within 1e-9 (relative) of the best growth is now chosen instead of the exact minimum error.
…bSystems, models without genes to remove, light ecModels

getStandardKcat treats subSystem names that differ only in letter case as one subSystem, as its lookup already did, instead of raising when two list entries match. A reaction with an empty subSystem gets the model-wide standard kcat instead of raising an index error.

getSubsetEcModel returns the model when no gene has to be removed, instead of raising in removeGenes. In a light ecModel the reaction identifiers of the ec structure carry the prefix 001_ and were all compared to the model reactions with it, so every entry was removed. The prefix is now removed before the comparison.
@github-actions

Copy link
Copy Markdown

Unit test results

63 tests   63 ✅  13s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 793593c.

@edkerk
edkerk merged commit fd640ca into develop Oct 30, 2026
2 checks passed
@edkerk
edkerk deleted the fix/parity-round-3 branch October 30, 2026 16:15
@edkerk edkerk mentioned this pull request Nov 2, 2026
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