From 58f4ef2fde45e1670a6eda046907d06c743277d3 Mon Sep 17 00:00:00 2001 From: Eduard Kerkhoven Date: Thu, 17 Oct 2024 20:12:46 +0200 Subject: [PATCH] fix: readYAMLmodel correct rxnEnzMat --- doc/io/readYAMLmodel.html | 2 +- io/readYAMLmodel.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/io/readYAMLmodel.html b/doc/io/readYAMLmodel.html index a76b6b12..348b94b7 100644 --- a/doc/io/readYAMLmodel.html +++ b/doc/io/readYAMLmodel.html @@ -682,7 +682,7 @@

SOURCE CODE ^%Parse ec-codes 0631 if ~isempty(ecGecko) diff --git a/io/readYAMLmodel.m b/io/readYAMLmodel.m index 19095d6c..dd5e692f 100755 --- a/io/readYAMLmodel.m +++ b/io/readYAMLmodel.m @@ -625,7 +625,7 @@ [~,enzIdx] = ismember(enzStoich(:,2),model.ec.enzymes); coeffs = cell2mat(enzStoich(:,3)); model.ec.rxnEnzMat = zeros(numel(model.ec.rxns), numel(model.ec.genes)); - linearIndices = sub2ind([max(rxnIdx), max(enzIdx)], rxnIdx, enzIdx); + linearIndices = sub2ind([numel(model.ec.rxns), numel(model.ec.genes)], rxnIdx, enzIdx); model.ec.rxnEnzMat(linearIndices) = coeffs; %Parse ec-codes if ~isempty(ecGecko)