From d9a3949569fa23623ac1f048ce3d742909a8b92a Mon Sep 17 00:00:00 2001 From: ThummaratPaklao <81726643+ThummaratPaklao@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:00:17 +0700 Subject: [PATCH 1/7] Update ICONGEMs.m --- src/analysis/ICONGEMs/ICONGEMs.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/analysis/ICONGEMs/ICONGEMs.m b/src/analysis/ICONGEMs/ICONGEMs.m index 9ea4672688..0dc71e19fc 100644 --- a/src/analysis/ICONGEMs/ICONGEMs.m +++ b/src/analysis/ICONGEMs/ICONGEMs.m @@ -1,4 +1,4 @@ -function [solICONGEMs, boundEf] = ICONGEMs(model, exp, genetxt, condition, threshold, alpha) +function [solICONGEMs, boundEf] = ICONGEMs(model, exp, genetxt, condition, threshold, alpha, numericFlag) % Algorithm to Integrate a Gene Co-expression Network and Genome-scale Metabolic Model: % This algorithm calculates the reaction flux distribution for each condition by applying % quadratic programming. @@ -14,6 +14,7 @@ % extract from gene expression profile file % genetxt: list of gene names that extract from gene expression profile % file +% numericFlag: 1 if using Human Recon (Default = 0). % % OPTIONAL INPUTS: % threshold: The value of the correlation coefficient for constructing @@ -47,6 +48,9 @@ if (nargin < 6 || isempty(alpha)) alpha = 0.99; end +if (nargin < 7 || isempty(numericFlag)) + numericFlag = 0; +end % construct the template model @@ -111,7 +115,7 @@ NameRxn={}; for i = 1:size(modelIrrev.genes) - [z1, NameRxn{i}] = findRxnsFromGenes(modelIrrev, modelIrrev.genes(i, 1), [], 1); + [z1, NameRxn{i}] = findRxnsFromGenes(modelIrrev, modelIrrev.genes(i, 1), numericFlag, 1); end % Find reactions that correspond to the gene @@ -244,7 +248,7 @@ model2.A = sparse(Aeq); model2.sense = [char('=' * ones(size(model2.A,1) - 1, 1)) ; char('>')]; model2.rhs = beq; -model2.modelsense = 'min'; +model2.modelsense = 'max'; numrxn = [1:length(modelIrrev.rxns)]; j = 1; for i = 1:length(model.rxns) From 131f5c9b57a4c6438386cb4a85f72c46ed7c4367 Mon Sep 17 00:00:00 2001 From: ThummaratPaklao <81726643+ThummaratPaklao@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:30:40 +0700 Subject: [PATCH 2/7] Update ICONGEMs.m --- src/analysis/ICONGEMs/ICONGEMs.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analysis/ICONGEMs/ICONGEMs.m b/src/analysis/ICONGEMs/ICONGEMs.m index 0dc71e19fc..a3a93bb284 100644 --- a/src/analysis/ICONGEMs/ICONGEMs.m +++ b/src/analysis/ICONGEMs/ICONGEMs.m @@ -115,7 +115,7 @@ NameRxn={}; for i = 1:size(modelIrrev.genes) - [z1, NameRxn{i}] = findRxnsFromGenes(modelIrrev, modelIrrev.genes(i, 1), numericFlag, 1); + [z1, NameRxn{i}] = findRxnsFromGenes(modelIrrev, modelIrrev.genes{i, 1}, numericFlag, 1); end % Find reactions that correspond to the gene From ac4005cffd8cc56a3bebbdad4e7bb446f308849a Mon Sep 17 00:00:00 2001 From: ThummaratPaklao <81726643+ThummaratPaklao@users.noreply.github.com> Date: Sat, 2 Nov 2024 14:30:14 +0700 Subject: [PATCH 3/7] Update ICONGEMs.m --- src/analysis/ICONGEMs/ICONGEMs.m | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/analysis/ICONGEMs/ICONGEMs.m b/src/analysis/ICONGEMs/ICONGEMs.m index a3a93bb284..228aa09538 100644 --- a/src/analysis/ICONGEMs/ICONGEMs.m +++ b/src/analysis/ICONGEMs/ICONGEMs.m @@ -228,19 +228,25 @@ Trans0 = zeros(size(modelIrrev.mets, 1),size(modelIrrev.rxns, 1)); Trans2 = -1 * eye(size(modelIrrev.rxns, 1)); S2 = zeros(size(modelIrrev.rxns, 1)); +bn = (-1) * ones(size(modelIrrev.rxns, 1), 1); for i = 1:length(modelIrrev.rxns) - S2(i, i) = 1 / max(nupb(i, :)); + if max(nupb(i, :)) ~= 0 + S2(i, i) = 1 / max(nupb(i, :)); + end + if max(nupb(i, :)) == 0 + Trans2(i, i) = 0; + bn(i, 1) = 0; + end end +Obj4 = [modelIrrev.c' zeros(1, size(modelIrrev.rxns, 1))]; -Obj4 = [modelIrrev.c' zeros(1, size(modelIrrev.rxns, 1))] ; - -lob = [model3.lb; (-1) * inf * ones(size(modelIrrev.rxns, 1), 1)]; -upb = [model3.ub; inf * ones(size(modelIrrev.rxns, 1), 1)]; +lob = [model3.lb; ones(size(modelIrrev.rxns, 1), 1)]; +upb = [model3.ub; 2 * ones(size(modelIrrev.rxns, 1), 1)]; O = [zeros(size(R)) zeros(size(R)); zeros(size(R)) R]; Aeq = [modelIrrev.S Trans0; S2 Trans2; Obj4]; -beq = [zeros(size(modelIrrev.mets, 1), 1); (-1) * ones(size(modelIrrev.rxns,1),1); alpha * solution1.f]; +beq = [zeros(size(modelIrrev.mets, 1), 1); bn; alpha * solution1.f]; model2 = struct; model2.lb = lob; From 81dc50a5394e982307c0ef47ec951f91e0e2b6c7 Mon Sep 17 00:00:00 2001 From: ThummaratPaklao <81726643+ThummaratPaklao@users.noreply.github.com> Date: Sun, 3 Nov 2024 16:25:46 +0700 Subject: [PATCH 4/7] Update ICONGEMs.m --- src/analysis/ICONGEMs/ICONGEMs.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/analysis/ICONGEMs/ICONGEMs.m b/src/analysis/ICONGEMs/ICONGEMs.m index 228aa09538..08acec93b7 100644 --- a/src/analysis/ICONGEMs/ICONGEMs.m +++ b/src/analysis/ICONGEMs/ICONGEMs.m @@ -54,6 +54,9 @@ % construct the template model +if ~isempty(model.rules) + model.grRules = model.rules; +end modelN = model; modelN.lb(modelN.lb >= 0) = 0; modelN.lb(modelN.lb < 0) = -1000; From 23ce0afcaa1992238e00dcaf18cbec54877418ff Mon Sep 17 00:00:00 2001 From: ThummaratPaklao <81726643+ThummaratPaklao@users.noreply.github.com> Date: Sun, 3 Nov 2024 16:31:42 +0700 Subject: [PATCH 5/7] Update ICONGEMs.m --- src/analysis/ICONGEMs/ICONGEMs.m | 1 + 1 file changed, 1 insertion(+) diff --git a/src/analysis/ICONGEMs/ICONGEMs.m b/src/analysis/ICONGEMs/ICONGEMs.m index 08acec93b7..d8978d6a93 100644 --- a/src/analysis/ICONGEMs/ICONGEMs.m +++ b/src/analysis/ICONGEMs/ICONGEMs.m @@ -57,6 +57,7 @@ if ~isempty(model.rules) model.grRules = model.rules; end + modelN = model; modelN.lb(modelN.lb >= 0) = 0; modelN.lb(modelN.lb < 0) = -1000; From 04a12a64595cad5b512b594ad038ae5d2d291353 Mon Sep 17 00:00:00 2001 From: ThummaratPaklao <81726643+ThummaratPaklao@users.noreply.github.com> Date: Mon, 4 Nov 2024 07:25:34 +0700 Subject: [PATCH 6/7] Update ICONGEMs.m --- src/analysis/ICONGEMs/ICONGEMs.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analysis/ICONGEMs/ICONGEMs.m b/src/analysis/ICONGEMs/ICONGEMs.m index d8978d6a93..c44c32a16d 100644 --- a/src/analysis/ICONGEMs/ICONGEMs.m +++ b/src/analysis/ICONGEMs/ICONGEMs.m @@ -30,7 +30,7 @@ % % EXAMPLES: % % This could be an example that can be copied from the documentation to MATLAB: -% solution = ICONGEMs(model, exp, genetxt, condition, threashold, alpha) +% solution = ICONGEMs(model, exp, genetxt, condition, threashold, alpha, numericFlag) % % without optional values: % solution = ICONGEMs(model, exp, genetxt) % From a747a6023bae37e5e6f32fbb712ea1598161ba3a Mon Sep 17 00:00:00 2001 From: ThummaratPaklao <81726643+ThummaratPaklao@users.noreply.github.com> Date: Mon, 4 Nov 2024 07:46:16 +0700 Subject: [PATCH 7/7] Update ICONGEMs.m --- src/analysis/ICONGEMs/ICONGEMs.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analysis/ICONGEMs/ICONGEMs.m b/src/analysis/ICONGEMs/ICONGEMs.m index c44c32a16d..01f106f563 100644 --- a/src/analysis/ICONGEMs/ICONGEMs.m +++ b/src/analysis/ICONGEMs/ICONGEMs.m @@ -5,7 +5,7 @@ % % USAGE: % -% [solICONGEMs, boundEf] = ICONGEMs(model, exp, genetxt, condition, threashold, alpha) +% [solICONGEMs, boundEf] = ICONGEMs(model, exp, genetxt, condition, threashold, alpha, numericFlag) % % INPUTS: %