-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1579 from opencobra/develop
Develop
- Loading branch information
Showing
334 changed files
with
36,538 additions
and
2,995 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
function [model,rxnNames] = addDemandReactionOri(model,metaboliteNameList, addRxnGeneMat) | ||
% addDemandReaction adds demand reactions for a set of metabolites | ||
% The reaction names for the demand reactions will be DM_[metaboliteName] | ||
% | ||
% model = addDemandReaction(model,metaboliteNameList) | ||
% | ||
% INPUTS | ||
% model COBRA model structure | ||
% metaboliteNameList List of metabolite names (cell array) | ||
% addRxnGeneMat Adds rxnGeneMat to model structure (default = true) | ||
% | ||
% OUTPUTS | ||
% model COBRA model structure with added demand reactions | ||
% rxnNames List of added reactions | ||
% | ||
% Markus Herrgard 5/8/07 | ||
% Ines Thiele 03/09 - Corrected reaction coefficient for demand reaction | ||
% Ines Thiele 08/03/2015, made rxnGeneMat optional | ||
if ~exist('addRxnGeneMat','var') | ||
addRxnGeneMat = 1; | ||
end | ||
|
||
if (~iscell(metaboliteNameList)) | ||
tmp = metaboliteNameList; | ||
clear metaboliteNameList; | ||
metaboliteNameList{1} = tmp; | ||
end | ||
|
||
for i = 1:length(metaboliteNameList) | ||
rxnName = ['DM_' metaboliteNameList{i}]; | ||
rxnNames{i}=rxnName; | ||
metaboliteList = {metaboliteNameList{i}}; | ||
% [model,rxnIDexists] = addReaction(model,rxnName,metaboliteList,stoichCoeffList,revFlag,lowerBound,upperBound,objCoeff,subSystem,grRule,geneNameList,systNameList,checkDuplicate, addRxnGeneMat) | ||
model = addReactionOri(model,rxnName,metaboliteList,-1,false,0,1000,0,'Demand','',[],[],0, addRxnGeneMat); | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
function [newModel,AddedExchRxn] = addExchangeRxn(model,metList,lb,ub) | ||
%addExchangeRxn adds exchange reactions | ||
% | ||
% newModel = addExchangeRxn(model,metList,lb,ub) | ||
% | ||
%INPUTS | ||
% model Cobra model structure | ||
% metList List of metabolites | ||
% | ||
%OPTIONAL INPUTS | ||
% lb Array of lower bounds | ||
% ub Array of upper bounds | ||
% | ||
%OUTPUT | ||
% newModel COBRA model with added exchange reactions | ||
% | ||
% Ines Thiele 02/2009 | ||
|
||
if nargin < 3 | ||
lb = ones(length(metList),1)*min(model.lb); | ||
end | ||
if nargin < 4 | ||
ub = ones(length(metList),1)*max(model.ub); | ||
end | ||
Revs = zeros(length(metList),1); | ||
Revs(lb<0) = 1; | ||
|
||
newModel = model; | ||
AddedExchRxn = ''; | ||
for i = 1 : length(metList) | ||
[newModel,rxnIDexists] = addReactionOri(newModel,strcat('EX_',metList{i}),metList(i),-1,Revs(i),... | ||
lb(i),ub(i)); | ||
AddedExchRxn=[AddedExchRxn;strcat('EX_',metList(i))]; | ||
end |
Oops, something went wrong.