readSimPhenyGPR

PURPOSE ^

readSimPhenyGPR Read SimPheny gene-protein-reaction association file obtained from admin console

SYNOPSIS ^

function [rxnInfo,rxns,allGenes] = readSimPhenyGPR(fileName)

DESCRIPTION ^

readSimPhenyGPR Read SimPheny gene-protein-reaction association file obtained from admin console

 [rxnInfo,rxns] = readSimPhenyGPR(fileName)

INPUT
 fileName      SimPheny GPR file

OUTPUTS
 rxnInfo       Structure containing data for each reaction
 rxns          List of reactions
 allGenes      List of all genes
 Markus Herrgard 6/4/07

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [rxnInfo,rxns,allGenes] = readSimPhenyGPR(fileName)
0002 %readSimPhenyGPR Read SimPheny gene-protein-reaction association file obtained from admin console
0003 %
0004 % [rxnInfo,rxns] = readSimPhenyGPR(fileName)
0005 %
0006 %INPUT
0007 % fileName      SimPheny GPR file
0008 %
0009 %OUTPUTS
0010 % rxnInfo       Structure containing data for each reaction
0011 % rxns          List of reactions
0012 % allGenes      List of all genes
0013 % Markus Herrgard 6/4/07
0014 
0015 fid = fopen(fileName,'r');
0016 
0017 allGenes = [];
0018 cnt = 0;
0019 while 1
0020     line = fgetl(fid);
0021     if ~ischar(line),   break,   end
0022     fields = splitString(line,'","');
0023     for j = 1:length(fields)
0024         fields{j} = strrep(fields{j},',"','');
0025         fields{j} = strrep(fields{j},'",','');
0026         fields{j} = strrep(fields{j},'"','');
0027     end
0028     if (length(fields) == 8)
0029         cnt = cnt+1;
0030         rxns{cnt} = fields{1};
0031         rxnInfo(cnt).ID = fields{1};
0032         rxnInfo(cnt).name = fields{2};
0033         rxnInfo(cnt).subSystem = fields{4};
0034         rxnInfo(cnt).EC = fields{5};
0035         rxnInfo(cnt).gra = fields{7};
0036         [genes,rule] = parseBoolean(rxnInfo(cnt).gra);
0037         rxnInfo(cnt).rule = rule;
0038         rxnInfo(cnt).genes = genes;
0039         allGenes = [allGenes genes];
0040         rxnInfo(cnt).gpa = fields{8};
0041     end
0042 end
0043 
0044 allGenes = unique(allGenes);
0045 rxns = columnVector(rxns);
0046 fclose(fid);

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