0001 function [rxnInfo,rxns,allGenes] = readSimPhenyGPR(fileName)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
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);