Skip to content

Commit

Permalink
fix: pmids now in rxnReferences
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaSanchez committed Apr 20, 2018
1 parent 346d382 commit df918f5
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions struct_conversion/ravenCobraWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
% Usage: newModel=ravenCobraWrapper(model)
%
% Simonas Marcisauskas, 2018-03-17
% Benjamin J. Sanchez, 2018-04-12
% Benjamin J. Sanchez, 2018-04-20
%

if isfield(model,'rules')
Expand Down Expand Up @@ -248,7 +248,7 @@
if isfield(model,'rxnECNumbers')
newModel.eccodes=regexprep(model.rxnECNumbers,'EC|EC:','');
end;
if isfield(model,'rxnKEGGID') || isfield(model,'rxnNotes')
if isfield(model,'rxnKEGGID') || isfield(model,'rxnReferences')
for i=1:numel(model.rxns)
counter=1;
newModel.rxnMiriams{i,1}=[];
Expand All @@ -259,23 +259,14 @@
counter=counter+1;
end;
end;
if isfield(model,'rxnNotes')
if ~isempty(model.rxnNotes{i})
rxnNote=model.rxnNotes{i};
if length(rxnNote) > 5
if strcmp(rxnNote(1:5),'pmid:') %field starts with pmid
pmids = strrep(rxnNote,'pmid:','');
pmids = strsplit(pmids,'; ');
for j = 1:length(pmids)
newModel.rxnMiriams{i,1}.name{counter,1} = 'pmid';
newModel.rxnMiriams{i,1}.value{counter,1} = pmids{j};
counter=counter+1;
end;
else
newModel.rxnNotes{i}=rxnNote;
end;
else
newModel.rxnNotes{i}=rxnNote;
if isfield(model,'rxnReferences')
if ~isempty(model.rxnReferences{i})
pmids = model.rxnReferences{i};
pmids = strsplit(pmids,'; ');
for j = 1:length(pmids)
newModel.rxnMiriams{i,1}.name{counter,1} = 'pmid';
newModel.rxnMiriams{i,1}.value{counter,1} = pmids{j};
counter=counter+1;
end;
end;
end;
Expand Down

0 comments on commit df918f5

Please sign in to comment.