Skip to content

Fix changeGrRules leaving an unparseable grRule when appending onto an empty one - #701

Merged
edkerk merged 1 commit into
develop3from
fix/changegrrules-empty-grrule-append
Aug 28, 2026
Merged

Fix changeGrRules leaving an unparseable grRule when appending onto an empty one#701
edkerk merged 1 commit into
develop3from
fix/changegrrules-empty-grrule-append

Conversation

@edkerk

@edkerk edkerk commented Aug 28, 2026

Copy link
Copy Markdown
Member

Fixes SysBioChalmers/raven-gecko-parity#12.

model.grRules(idx)=strcat('(',model.grRules(idx),') or (',grRules,')') ran
unconditionally, so appending a new isozyme onto a reaction with no existing
grRule produced () or (new rule) — an empty first clause that
grRuleToDNF, isDnfGrRule, standardizeGrRules and expandModel all fail
to parse. rxnGeneMat came out populated correctly regardless, so the model
looked built successfully until something later re-derived the DNF from the
text.

Reactions with an existing rule still get it wrapped and merged with or; a
reaction with none gets the new rule directly, mirroring how raven-toolbox's
change_gene_reaction_rules already guards this case.

…n empty one

model.grRules(idx)=strcat('(',model.grRules(idx),') or (',grRules,')')
ran unconditionally, so appending a new isozyme onto a reaction with no
existing grRule produced "() or (new rule)" -- an empty first clause
that grRuleToDNF, isDnfGrRule, standardizeGrRules and expandModel all
fail to parse. rxnGeneMat came out populated correctly regardless, so
the model looked built successfully until something later re-derived
the DNF from the text.

Reactions with an existing rule still get it wrapped and merged with
'or'; a reaction with none gets the new rule directly, mirroring how
change_gene_reaction_rules already guards this case.
@github-actions

Copy link
Copy Markdown

Function test results

300 tests   274 ✅  1m 12s ⏱️
 25 suites   26 💤
  1 files      0 ❌

Results for commit 6cf3260.

@edkerk
edkerk merged commit cf05acf into develop3 Aug 28, 2026
4 checks passed
@edkerk
edkerk deleted the fix/changegrrules-empty-grrule-append branch August 28, 2026 07:07
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