Home > src > geckomat > model_adapter > ModelAdapter.m

ModelAdapter

PURPOSE ^

Abstract Base class for adapters for different species

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

Abstract Base class for adapters for different species

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 %Abstract Base class for adapters for different species
0002 classdef (Abstract) ModelAdapter
0003     methods (Abstract)
0004         [spont,spontRxnNames] = getSpontaneousReactions(obj,model);
0005     end
0006     methods
0007         %not really needed, we could access it directly. Not very nice, but practical
0008         function parameters = getParameters(obj)
0009             parameters = obj.params;
0010         end
0011 
0012         %This allows for changing parameters in an adapter without
0013         %creating a new class. May be convenient, although less clean
0014         %function obj = setParameters(obj, parameters)
0015         %    obj.mParams = parameters;
0016         %end
0017 
0018         %The genes returned here should match the gene id set in the parameter params.uniprot.geneIDfield
0019         function genes = getUniprotCompatibleGenes(obj,inGenes)
0020             genes = inGenes;
0021         end
0022 
0023         function uniprotIDs = getUniprotIDsFromTable(obj,modelGenes)
0024             conversionTable = fullfile(obj.params.path,'data','uniprotConversion.tsv');
0025             if exist(conversionTable,'file')
0026                 fID=fopen(conversionTable,'r');
0027                 conversionTable = textscan(fID,'%q %q','Delimiter','\t','HeaderLines',1);
0028                 fclose(fID);
0029 
0030                 modelIDs    = conversionTable{1,1};
0031                 uniprots    = conversionTable{1,2};
0032 
0033                 [a,b] = ismember(modelGenes,modelIDs);
0034 
0035                 uniprotIDs  = strings(numel(modelGenes),1);
0036                 uniprotIDs(a)  = uniprots(b(a));
0037                 disp('The model genes are matched to Uniprot via the table at data/uniprotConversion.tsv.')
0038             else
0039                 uniprotIDs = modelGenes;
0040             end
0041         end
0042 
0043         function folder = getBrendaDBFolder(obj)
0044             folder = fullfile(findGECKOroot(),'databases');
0045         end
0046 
0047         function x = getPhylDistStructPath(obj)
0048             x =  fullfile(findRAVENroot(),'external','kegg','keggPhylDist.mat');
0049         end
0050     end
0051 
0052     %To have the params public is a bit "ugly", but very practical
0053     %if we want to change a parameter
0054     properties (Access = public)
0055         params;
0056     end
0057 end

Generated by m2html © 2005