0001 function [metInfo,mets] = readSimPhenyCMPD(fileName)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 fid = fopen(fileName,'r');
0016
0017 cnt = 0;
0018 while 1
0019 line = fgetl(fid);
0020 if ~ischar(line), break, end
0021 fields = splitString(line,'","');
0022 for j = 1:length(fields)
0023 fields{j} = strrep(fields{j},',"','');
0024 fields{j} = strrep(fields{j},'",','');
0025 fields{j} = strrep(fields{j},'"','');
0026 end
0027 if (length(fields) == 9)
0028 cnt = cnt+1;
0029 mets{cnt} = fields{1};
0030 metInfo(cnt).ID = fields{1};
0031 metInfo(cnt).name = fields{2};
0032 metInfo(cnt).formula = fields{3};
0033 metInfo(cnt).charge = str2double(fields{5});
0034 metInfo(cnt).casNumber = fields{6};
0035 metInfo(cnt).neutralFormula = fields{7};
0036 metInfo(cnt).altNames = splitString(fields{8},'/');
0037 for j = 1:length(metInfo(cnt).altNames)
0038 metInfo(cnt).altNames{j} = deblank(metInfo(cnt).altNames{j});
0039 end
0040 metInfo(cnt).KEGGID = fields{9};
0041 end
0042 end
0043
0044 mets = columnVector(mets);
0045 fclose(fid);