mapMetName2KEGGID

PURPOSE ^

UNTITLED Summary of this function goes here

SYNOPSIS ^

function model = mapMetName2KEGGID(model, Dictionary)

DESCRIPTION ^

UNTITLED Summary of this function goes here
   Detailed explanation goes here

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function model = mapMetName2KEGGID(model, Dictionary)
0002 %UNTITLED Summary of this function goes here
0003 %   Detailed explanation goes here
0004 
0005 %Hash all KEGG ID's
0006 HTABLE = java.util.Hashtable;
0007 CompAbr = Dictionary(:, 1);
0008 KEGGID = Dictionary(:, 2);
0009 for i = 1:length(KEGGID);
0010     if strcmp(KEGGID{i}, ''),continue,end
0011     if HTABLE.get(KEGGID{i}) ~= 0
0012         if HTABLE.get(KEGGID{i}) > 0
0013             disp(strcat('multiple matches    ', KEGGID{i}))
0014         end
0015         HTABLE.put(KEGGID{i},-1);
0016     else
0017         HTABLE.put(KEGGID{i},i);
0018     end
0019 end
0020 
0021 model.KEGGID = model.mets;
0022 for i = 1 : length(model.mets)
0023     % finds compartment of model metabolite
0024     MetTmp=regexprep(model.mets(i),'[','-');
0025     MetTmp=regexprep( MetTmp,']','-');
0026     if (~isempty(strfind(char(MetTmp),'-c-')))
0027         MetTmp=regexprep(MetTmp,'-c-','');
0028         KEGGComp='[c]';
0029     elseif (~isempty(strfind(char(MetTmp),'-p-')))
0030         MetTmp=regexprep(MetTmp,'-p-','');
0031         KEGGComp='[p]';
0032     elseif(~isempty(strfind(char(MetTmp),'-e-')))
0033         MetTmp=regexprep(MetTmp,'-e-','');
0034         KEGGComp='[e]';
0035     else
0036         MetTmp = model.mets(i); % assuming that no compartment is associated with compound
0037     end
0038     
0039     %Match =strmatch(MetTmp, KEGGID,'exact')
0040     Match = HTABLE.get(MetTmp{1});
0041 
0042     
0043     if (~isempty(Match) && Match > 0 && ~isempty(CompAbr{Match}))
0044         % associates KEGGID with model metabolte - KEGGID is compartment
0045         % dependent!
0046         
0047         KEGGTmp=[char(CompAbr(Match)) char(KEGGComp)];
0048         model.metsAbr{i,1}=KEGGTmp;
0049     elseif (length(Match) < 0) %&& length(CompAbr{Match})>0)
0050         model.metsAbr{i,1}=[];
0051         disp(strcat('multiple matches ', MetTmp))
0052         
0053         %warning(['multiple matchings for' MetTmp]);
0054             pause;
0055     else
0056    
0057         model.metsAbr{i,1}=[];
0058     end
0059     clear MetTmp KEGGTmp
0060 end
0061 end
0062

Generated on Thu 21-Jun-2012 15:39:23 by m2html © 2003