0001 function reducedModel=deleteUnusedGenes(model,verbose)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 if nargin<2
0014 verbose=1;
0015 end
0016 reducedModel=model;
0017
0018
0019 [~, b]=find(reducedModel.rxnGeneMat);
0020 toKeep=false(numel(reducedModel.genes),1);
0021 toKeep(b)=true;
0022
0023 switch verbose
0024 case 1
0025 disp('Number of unused genes removed from the model:')
0026 disp(numel(toKeep(~toKeep)))
0027 case 2
0028 disp('The following genes were removed from the model:')
0029 disp(reducedModel.genes(~toKeep))
0030 case 0
0031 end
0032
0033 reducedModel.genes=reducedModel.genes(toKeep);
0034 reducedModel.rxnGeneMat=reducedModel.rxnGeneMat(:,toKeep);
0035
0036 if isfield(reducedModel,'geneShortNames')
0037 reducedModel.geneShortNames=reducedModel.geneShortNames(toKeep);
0038 end
0039
0040 if isfield(reducedModel,'proteins')
0041 reducedModel.proteins=reducedModel.proteins(toKeep);
0042 end
0043
0044 if isfield(reducedModel,'geneMiriams')
0045 reducedModel.geneMiriams=reducedModel.geneMiriams(toKeep);
0046 end
0047
0048 if isfield(reducedModel,'geneFrom')
0049 reducedModel.geneFrom=reducedModel.geneFrom(toKeep);
0050 end
0051
0052 if isfield(reducedModel,'geneComps')
0053 reducedModel.geneComps=reducedModel.geneComps(toKeep);
0054 end
0055 end