Fix gene field alignment in removeLowScoreGenes - #706
Merged
edkerk merged 1 commit intoAug 28, 2026
Conversation
Ports the fix from #670 (merged to develop) to develop3, which carried the identical bug in its reworked removeLowScoreGenes. removeLowScoreGenes regenerated model.genes from getGenesFromGrRules, which returns a sorted list, but trimmed the gene-associated fields (geneShortNames, proteins, geneMiriams, geneFrom, geneComps) with a mask in the original gene order. When model.genes was not already sorted, this left every annotation field shifted relative to model.genes, corrupting the gene ID to gene symbol mapping in ftINIT-reconstructed models (removeGenes=true). Retain the remaining genes in their original order and reorder the rxnGeneMat columns to match, so the trimmed annotation fields stay aligned. Reproduced on develop3 with an unsorted-genes model: removing one isozyme gene paired G2->short3 and G3->short2; after the fix G2->short2, G3->short3. Adds removeLowScoreGenesKeepsFieldsAligned to tINIT covering exactly this.
Function test results303 tests 277 ✅ 1m 8s ⏱️ Results for commit 8f6b233. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the fix from #670 (merged to
develop) todevelop3, which carried the identical bug in its reworkedremoveLowScoreGenes.removeLowScoreGenesregeneratedmodel.genesfromgetGenesFromGrRules, which returns a sorted list, but trimmed the gene-associated fields (geneShortNames,proteins,geneMiriams,geneFrom,geneComps) with a mask in the original gene order. Whenmodel.geneswas not already sorted, every annotation field ended up shifted relative tomodel.genes, corrupting the gene-ID → gene-symbol mapping in ftINIT-reconstructed models (removeGenes=true).The retained genes are now kept in their original order and the
rxnGeneMatcolumns reordered to match, so the trimmed annotation fields stay aligned.Reproduced on develop3 with an unsorted-genes model: removing one isozyme gene paired
G2 -> short3andG3 -> short2; after the fixG2 -> short2,G3 -> short3. AddsremoveLowScoreGenesKeepsFieldsAlignedto tINIT covering exactly this.