diff --git a/core/getAllowedBounds.m b/core/getAllowedBounds.m index babad784..ed580fd0 100755 --- a/core/getAllowedBounds.m +++ b/core/getAllowedBounds.m @@ -49,24 +49,25 @@ tmpModel = model; tmpModel.c = c; + % Get maximal flux + tmpModel.c(rxns(i)) = 1; + [solMax,hsSol]=solveLP(tmpModel); + if ~isempty(solMax.f) + maxFluxes(i) = solMax.x(rxns(i)); + else + maxFluxes(i) = NaN; + end + % Get minimal flux tmpModel.c(rxns(i)) = -1; - solMin = solveLP(tmpModel); + solMin = solveLP(tmpModel,[],[],hsSol); if ~isempty(solMin.f) minFluxes(i) = solMin.x(rxns(i)); else minFluxes(i) = NaN; end - - % Get maximal flux - tmpModel.c(rxns(i)) = 1; - solMax=solveLP(tmpModel); exitFlags(i,:) = [solMin.stat solMax.stat]; - if ~isempty(solMax.f) - maxFluxes(i) = solMax.x(rxns(i)); - else - maxFluxes(i) = NaN; - end + end % Reset original Parallel setting ps.Pool.AutoCreate = oldPoolAutoCreateSetting; diff --git a/core/getGenesFromGrRules.m b/core/getGenesFromGrRules.m index ac97c771..a251d6bd 100755 --- a/core/getGenesFromGrRules.m +++ b/core/getGenesFromGrRules.m @@ -54,7 +54,7 @@ % construct new gene list nonEmpty = ~cellfun(@isempty,rxnGenes); -genes = unique([rxnGenes{nonEmpty}]'); +genes = unique(transpose([rxnGenes{nonEmpty}])); genes(cellfun(@isempty,genes)) = []; if ~isempty(originalGenes) diff --git a/core/haveFlux.m b/core/haveFlux.m index 92f211e2..01215959 100755 --- a/core/haveFlux.m +++ b/core/haveFlux.m @@ -1,23 +1,25 @@ function I=haveFlux(model,cutOff,rxns) % haveFlux -% Checks which reactions can carry a (positive or negative) flux. -% Is used as a faster version of getAllowedBounds if it is only interesting +% Checks which reactions can carry a (positive or negative) flux. Is used +% as a faster version of getAllowedBounds if it is only interesting % whether the reactions can carry a flux or not % +% Input: % model a model structure % cutOff the flux value that a reaction has to carry to be % identified as positive (optional, default 10^-8) % rxns either a cell array of IDs, a logical vector with the -% same number of elements as metabolites in the model, -% of a vector of indexes (optional, default model.rxns) +% same number of elements as metabolites in the model, or a +% vector of indexes (optional, default model.rxns) % -% I logical array with true if the corresponding -% reaction can carry a flux +% Output: +% I logical array with true if the corresponding reaction can +% carry a flux % -% NOTE: If a model has +/- Inf bounds then those are replaced with an -% arbitary large value of +/- 10000 prior to solving +% If a model has +/- Inf bounds then those are replaced with an arbitary +% large value of +/- 10000 prior to solving % -% Usage: I=haveFlux(model,cutOff, rxns) +% Usage: I = haveFlux(model, cutOff, rxns) if nargin<2 cutOff=10^-6; diff --git a/doc/core/getAllowedBounds.html b/doc/core/getAllowedBounds.html index 51d69e29..ec6855e9 100644 --- a/doc/core/getAllowedBounds.html +++ b/doc/core/getAllowedBounds.html @@ -118,28 +118,29 @@