Description of AllKEGG2BiGGmet

Home > BiKEGG > AllKEGG2BiGGmet.m

# AllKEGG2BiGGmet

## PURPOSE

AllKEGG2BiGGmet

## SYNOPSIS

function AllKEGG2BiGGmet

## DESCRIPTION

     AllKEGG2BiGGmet
     Extracts all KEGG metabolites from BIGG API and save them
     as a mat file (AllKEGG2BiGGmet.mat), which is used in MapAdjuster for
     displaying compound details on created customized maps by NetDraw.

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

## SOURCE CODE

    0001 function AllKEGG2BiGGmet
    0002 % AllKEGG2BiGGmet
    0003 % Extracts all KEGG metabolites from BIGG API and save them
    0004 % as a mat file (AllKEGG2BiGGmet.mat), which is used in MapAdjuster for
    0005 % displaying compound details on created customized maps by NetDraw.
    0006
    0007 % O. Jamialahmadi
    0008 % TMU, Chem. Eng. Dept., Biotech. Group
    0009 % July 2016
    0010 %--------------------------------------------------------------------------
    0011
    0012 Pth1 = which ('Bigg2Kegg.m');
    0013 tind = find(Pth1=='\',1,'last');
    0014 Pth = Pth1(1:tind-1);
    0015 Fileid3 = fopen(fullfile(Pth,'bigg_models_metabolites.txt'),'r');
    0016 biggmets = textscan(Fileid3,'%s %s %[^\n]');
    0017 fclose(Fileid3);
    0018 biggmetid = biggmets{1}; biggmetdes = biggmets{3}; clear biggmets
    0019 Metkegg = ({}); Metbigg = ({});
    0020 ct3 = 1;
    0021 for ct1 = 2:numel(biggmetid)
    0022     temploci = regexp(biggmetdes{ct1},...
    0023         'http://identifiers.org/kegg.compound/C\S{5}','match');
    0024     if isempty(temploci)
    0025         continue
    0026     end
    0027     if iscell(temploci{1})
    0028         temploci = temploci{1};
    0029     end
    0030     if isempty(temploci)
    0031         continue
    0032     else
    0033         for ct2 = 1:numel(temploci)
    0034             regtemp = regexp(temploci{ct2},'C\S{5}','match');
    0035             Metkegg{ct3}{ct2} = regtemp{1};
    0036             Metbigg{ct3}{ct2} = biggmetid{ct1};
    0037         end
    0038         ct3 = ct3 + 1;
    0039     end
    0040 end
    0041 for ct1 = 2:numel(biggmetid) % KEGG glycan
    0042     temploci = regexp(biggmetdes{ct1},...
    0043         'http://identifiers.org/kegg.compound/G\S{5}','match');
    0044     if isempty(temploci)
    0045         continue
    0046     end
    0047     if iscell(temploci{1})
    0048         temploci = temploci{1};
    0049     end
    0050     if isempty(temploci)
    0051         continue
    0052     else
    0053         for ct2 = 1:numel(temploci)
    0054             regtemp = regexp(temploci{ct2},'G\S{5}','match');
    0055             Metkegg{ct3}{ct2} = regtemp{1};
    0056             Metbigg{ct3}{ct2} = biggmetid{ct1};
    0057         end
    0058         ct3 = ct3 + 1;
    0059     end
    0060 end
    0061 AllKEGG2BiGGmet.Metkegg = Metkegg; AllKEGG2BiGGmet.Metbigg = Metbigg;
    0062 save('AllKEGG2BiGGmet.mat','AllKEGG2BiGGmet')