-
Notifications
You must be signed in to change notification settings - Fork 47
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 #132 from SysBioChalmers/feat/SBOterms
Feat/SBOterms
- Loading branch information
Showing
4 changed files
with
45,711 additions
and
6,917 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
% model = addSBOterms(model) | ||
% | ||
% Benjamín J. Sánchez | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
function model = addSBOterms(model) | ||
|
||
%Get RAVEN model for matching names & compartments | ||
model_r = ravenCobraWrapper(model); | ||
|
||
%Add SBO terms for mets: | ||
model.metSBOTerms = cell(size(model.mets)); | ||
for i = 1:length(model.mets) | ||
metName = model_r.metNames{i}; | ||
if ismember(metName,{'biomass','DNA','RNA','protein','carbohydrate','lipid'}) ... | ||
|| endsWith(metName,' backbone') || endsWith(metName,' chain') | ||
model.metSBOTerms{i} = 'SBO:0000649'; %Biomass | ||
else | ||
model.metSBOTerms{i} = 'SBO:0000247'; %Simple chemical | ||
end | ||
end | ||
|
||
%Add SBO terms for rxns: | ||
model.rxnSBOTerms = cell(size(model.rxns)); | ||
for i = 1:length(model.rxns) | ||
rxnName = model_r.rxnNames{i}; | ||
metNames = model_r.metNames(model.S(:,i) ~= 0); | ||
metComps = model_r.metComps(model.S(:,i) ~= 0); | ||
metStoich = model_r.S(model.S(:,i) ~= 0,i); | ||
|
||
if length(metNames) == 1 | ||
if strcmp(model_r.comps{metComps},'e') | ||
model.rxnSBOTerms{i} = 'SBO:0000627'; %Exchange rxn | ||
|
||
elseif metStoich > 0 | ||
model.rxnSBOTerms{i} = 'SBO:0000628'; %Demand rxn | ||
else | ||
model.rxnSBOTerms{i} = 'SBO:0000632'; %Sink rxn | ||
end | ||
|
||
elseif strcmp(rxnName,'biomass pseudoreaction') | ||
model.rxnSBOTerms{i} = 'SBO:0000629'; %Biomass pseudo-rxn | ||
|
||
elseif strcmp(rxnName,'non-growth associated maintenance reaction') | ||
model.rxnSBOTerms{i} = 'SBO:0000630'; %ATP maintenance | ||
|
||
elseif contains(rxnName,'pseudoreaction') || contains(rxnName,'SLIME rxn') | ||
model.rxnSBOTerms{i} = 'SBO:0000395'; %Encapsulating process | ||
|
||
elseif length(unique(metComps)) > 1 && length(unique(metNames)) < length(metNames) | ||
model.rxnSBOTerms{i} = 'SBO:0000655'; %Transport rxn | ||
|
||
else | ||
model.rxnSBOTerms{i} = 'SBO:0000176'; %Metabolic rxn | ||
end | ||
end | ||
|
||
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
Oops, something went wrong.