Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/SBOterms #132

Merged
merged 3 commits into from
Jul 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions ComplementaryScripts/missingFields/addSBOterms.m
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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 changes: 5 additions & 0 deletions ComplementaryScripts/saveYeastModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ function saveYeastModel(model,upDATE)
scriptFolder = fileparts(which(mfilename));
currentDir = cd(scriptFolder);

%Update SBO terms in model:
cd missingFields
model = addSBOterms(model);
cd ..

%Check if model is a valid SBML structure:
writeCbModel(model,'sbml','tempModel.xml');
[~,errors] = TranslateSBML('tempModel.xml');
Expand Down
Loading