Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix-add a error report in the import/export cycle #629

Merged
merged 5 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions code/io/importYaml.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@
if ~silentMode
fprintf('\t%d\n', section);
end
if readSubsystems
model.subSystems(end+1,1) = {subSystems}; %last entry from section 3
readSubsystems = false;
end
continue
case '- compartments: !!omap'
section = 5;
Expand Down Expand Up @@ -218,15 +214,15 @@

case 'confidence_score'
model = readFieldValue(model, 'rxnConfidenceScores', tline_value);
if readSubsystems
model.subSystems(end+1,1) = {subSystems};
readSubsystems = false;
end

case 'metabolites'
readEquation = true;
leftEquation = '';
rightEquation = '';
if readSubsystems
model.subSystems(end+1,1) = {subSystems};
readSubsystems = false;
end

otherwise
if readSubsystems
Expand Down
8 changes: 6 additions & 2 deletions code/test/testYamlConversion.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@


% export to yml and then import back
exportYaml(model,'testYamlConversion.yml');
importedHumanGEM = importYaml('testYamlConversion.yml', true);
try
exportYaml(model,'testYamlConversion.yml');
importedHumanGEM = importYaml('testYamlConversion.yml', true);
catch
error('There are problems during the conversion import and export');
end

% remove intermediate Yaml file
delete testYamlConversion.yml;
Expand Down
4 changes: 2 additions & 2 deletions model/Human-GEM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307292,8 +307292,8 @@
- !!omap
- id: "MAR20111"
- name: "MAR20111"
- metabolties: !!omap
- MAM1261m: -1
- metabolites: !!omap
- MAM01261m: -1
- MAM01597m: 1
- MAM02007m: -1
- MAM02040m: -1
Expand Down