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

Complex annotation #305

Merged
merged 21 commits into from
May 28, 2022
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ helpsearch*/
*.pyc
*.env

# Non-complying tables #
########################
*.xls
# Non-complying tables and files #
##################################
*.xls*
*.doc*
*.ppt*
*.tab
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This repository contains the current consensus genome-scale metabolic model of _

| Taxonomy | Latest update | Version | Reactions | Metabolites | Genes |
|:-------|:--------------|:------|:------|:----------|:-----|
| _Saccharomyces cerevisiae_ | 14-May-2022 | develop | 4069 | 2749 | 1151 |
| _Saccharomyces cerevisiae_ | 26-May-2022 | develop | 4069 | 2749 | 1162 |

# Installation & usage

Expand Down
14 changes: 14 additions & 0 deletions code/curateMetsRxnsGenes.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@
% Output:
% newModel curated RAVEN model structure

if nargin==4
error('Provide both a ''rxnsInfo'' and a ''rxnsCoeffs'' file')
end
if nargin<4
rxnsInfo='none';
rxnsCoeffs='none';
end
if nargin<3
genesInfo='none';
end
newModel=model;

%% Metabolites
if ~strcmp(metsInfo,'none')
fid = fopen(metsInfo);
Expand Down Expand Up @@ -302,6 +313,9 @@
emptyMiriam = all(cellfun(@isempty,miriamValues),1);
miriamName(emptyMiriam) = [];
miriamValues(:,emptyMiriam) = [];
if ~isfield(newModel,[type 'Miriams']);
newModel.([type 'Miriams'])=cell(numel(newModel.([type 's'])),1);
end
if ~isempty(miriamName)
for i=1:numel(miriamName)
newModel = editMiriam(newModel,type,modelIndex,miriamName{i},miriamValues(:,i),'replace');
Expand Down
2 changes: 1 addition & 1 deletion code/getEarlierModelVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

if any(regexp(version,'^\d+\.\d+\.\d+$')) % Tag is a version number
tagpath=['git show refs/tags/v' version ':'];
elseif any(contains(tag,{'main','develop'}))
elseif any(contains(version,{'main','develop'}))
tagpath=['git show ' version ':'];
else
error('version should be ''main'', ''develop'', or a specific release, e.g. ''8.1.0''')
Expand Down
1 change: 1 addition & 0 deletions code/loadYeastModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@
model = ravenCobraWrapper(model);
end
end
disp('If there is only 1 warning and no errors, it can savely be ignored.')
end
50 changes: 0 additions & 50 deletions code/modelCuration/addDBNewGeneAnnotation.m

This file was deleted.

28 changes: 28 additions & 0 deletions code/modelCuration/complexAnnotation.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% complexAnnotation
% Correct complex annotation
% As for the reference of new GPRs, please find detailed information in:
% data/modelCuration/complexAnnotation/complexAnnotation.tsv
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Load model
cd ..
model = loadYeastModel;

% Add new genes
newModel = curateMetsRxnsGenes(model,'none','../data/modelCuration/complexAnnotation/complexAnnotationGenes.tsv');

% Add gene standard name for new genes
fid = fopen('../data/modelCuration/complexAnnotation/complexAnnotation.tsv');
complexAnnot = textscan(fid,'%q %q %q %q %q %q %q','Delimiter','\t','HeaderLines',1);
fclose(fid);
newGPR.ID = complexAnnot{1};
newGPR.GPR = complexAnnot{3};
newModel=changeGrRules(newModel,newGPR.ID,newGPR.GPR);

% Delete unused genes (if any)
newModel = deleteUnusedGenes(newModel);

% Save model:
saveYeastModel(newModel)
cd modelCuration
27 changes: 12 additions & 15 deletions code/modelTests/essentialGenes.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [accurancy,tp,tn,fn,fp] = essentialGenes
function [accuracy,tp,tn,fn,fp] = essentialGenes(model)
% essentialGenes
% Modify media + find essential genes in model. Adapted from:
% https://doi.org/10.1371/journal.pcbi.1004530
Expand All @@ -12,11 +12,11 @@
% Usage: [accurancy,tp,tn,fn,fp] = essentialGenes
%

initCobraToolbox
cd ..
model = loadYeastModel;
model = ravenCobraWrapper(model);
cd modelTests
if nargin<1;
cd ..
model = loadYeastModel;
cd modelTests
end
ko_tol = 1e-6;

%constraints from genotype: check the genotype of the strains used in deletion experiment
Expand All @@ -41,7 +41,7 @@
exp_viable = intersect(exp_viable,verifiedORFs);

%calculate the growth rate after the single gene deletion using the original model and update model
grRatio = singleGeneDeletion(model);
[~, ~, ~, ~, grRatio]=findGeneDeletions(model,'sgd','fba');
mod_viable = model.genes(grRatio >= ko_tol);
mod_viable = intersect(mod_viable,verifiedORFs);
mod_inviable = model.genes(grRatio < ko_tol );
Expand All @@ -59,7 +59,7 @@
%compare the prediction performances of two models
%prediction accuracy was used to evaluate the quality of model update in
%each step
accurancy = (n_tp+n_tn)/(n_tp+n_tn+n_fn+n_fp);
accuracy = (n_tp+n_tn)/(n_tp+n_tn+n_fn+n_fp);
sensitivity = (100*n_tp/(n_tp+n_fn));
specificity = (100*n_tn/(n_tn+n_fp));
positivePredictive = (100*n_tp/(n_tp+n_fp));
Expand All @@ -75,7 +75,7 @@

% start with a clean slate: set all exchange reactions to upper bound =
% 1000 and lower bound = 0 (ie, unconstrained excretion, no uptake)
exchangeRxns = findExcRxns(model);
[~, exchangeRxns] = getExchangeRxns(model);
model.lb(exchangeRxns) = 0;
model.ub(exchangeRxns) = 1000;

Expand Down Expand Up @@ -106,12 +106,9 @@
'r_4600'; ... % Ca(2+) exchange
'r_2020' };

constrainedUptakeRxnIndexes = findRxnIDs(model,constrainedUptake);
glucoseExchangeIndex = findRxnIDs(model,glucoseExchange);
unconstrainedUptakeRxnIndexes = findRxnIDs(model,unconstrainedUptake);
model.lb(constrainedUptakeRxnIndexes) = -0.5;
model.lb(glucoseExchangeIndex) = -20;
model.lb(unconstrainedUptakeRxnIndexes) = -1000;
model=setParam(model,'lb',constrainedUptake,-0.5);
model=setParam(model,'lb',glucoseExchange,-20);
model=setParam(model,'lb',unconstrainedUptake,-1000);
end

function genes = inviableORFs
Expand Down
Loading