diff --git a/core/checkModelStruct.m b/core/checkModelStruct.m index 26ba7b7f..c958247d 100755 --- a/core/checkModelStruct.m +++ b/core/checkModelStruct.m @@ -363,39 +363,6 @@ function checkModelStruct(model,throwErrors,trimWarnings) EM='The following InChI strings are associated to more than one unique metabolite name:'; dispEM(EM,false,allInchis(hasMultiple),trimWarnings); end - -%Check if there are metabolites with different names but the same SMILES -if isfield(model,'metSmiles') - metSmiles=containers.Map(); - for i=1:numel(model.mets) - if ~isempty(model.metSmiles{i}) - %Get existing metabolite indexes - if isKey(metSmiles,model.metSmiles{i}) - existing=metSmiles(model.metSmiles{i}); - else - existing=[]; - end - metSmiles(model.metSmiles{i})=[existing;i]; - end - end - - %Get all keys - allmetSmiles=keys(metSmiles); - - hasMultiple=false(numel(metSmiles),1); - for i=1:numel(metSmiles) - if numel(metSmiles(metSmiles{i}))>1 - %Check if they all have the same name - if numel(unique(model.metNames(metSmiles(allmetSmiles{i}))))>1 - hasMultiple(i)=true; - end - end - end - - %Print output - EM='The following metSmiles strings are associated to more than one unique metabolite name:'; - dispEM(EM,false,allmetSmiles(hasMultiple),trimWarnings); -end end function I=duplicates(strings) diff --git a/doc/core/checkModelStruct.html b/doc/core/checkModelStruct.html index aa97a7b9..18a56263 100644 --- a/doc/core/checkModelStruct.html +++ b/doc/core/checkModelStruct.html @@ -422,50 +422,17 @@

SOURCE CODE ^'The following InChI strings are associated to more than one unique metabolite name:'; 0364 dispEM(EM,false,allInchis(hasMultiple),trimWarnings); 0365 end -0366 -0367 %Check if there are metabolites with different names but the same SMILES -0368 if isfield(model,'metSmiles') -0369 metSmiles=containers.Map(); -0370 for i=1:numel(model.mets) -0371 if ~isempty(model.metSmiles{i}) -0372 %Get existing metabolite indexes -0373 if isKey(metSmiles,model.metSmiles{i}) -0374 existing=metSmiles(model.metSmiles{i}); -0375 else -0376 existing=[]; -0377 end -0378 metSmiles(model.metSmiles{i})=[existing;i]; -0379 end -0380 end -0381 -0382 %Get all keys -0383 allmetSmiles=keys(metSmiles); -0384 -0385 hasMultiple=false(numel(metSmiles),1); -0386 for i=1:numel(metSmiles) -0387 if numel(metSmiles(metSmiles{i}))>1 -0388 %Check if they all have the same name -0389 if numel(unique(model.metNames(metSmiles(allmetSmiles{i}))))>1 -0390 hasMultiple(i)=true; -0391 end -0392 end -0393 end -0394 -0395 %Print output -0396 EM='The following metSmiles strings are associated to more than one unique metabolite name:'; -0397 dispEM(EM,false,allmetSmiles(hasMultiple),trimWarnings); -0398 end -0399 end -0400 -0401 function I=duplicates(strings) -0402 I=false(numel(strings),1); -0403 [J, K]=unique(strings); -0404 if numel(J)~=numel(strings) -0405 L=1:numel(strings); -0406 L(K)=[]; -0407 I(L)=true; -0408 end -0409 end +0366 end +0367 +0368 function I=duplicates(strings) +0369 I=false(numel(strings),1); +0370 [J, K]=unique(strings); +0371 if numel(J)~=numel(strings) +0372 L=1:numel(strings); +0373 L(K)=[]; +0374 I(L)=true; +0375 end +0376 end
Generated by m2html © 2005
\ No newline at end of file