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

feat: add metadata and miscellaneous adjustments #95

Merged
merged 13 commits into from
Mar 28, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: writeHumanYaml add metadata section
Much of the metadata is currently hard-coded, but this can be updated with future model iterations.
JonathanRob authored and haowang-bioinfo committed Mar 20, 2019

Verified

This commit was signed with the committer’s verified signature.
ken-matsui Ken Matsui
commit 36c5f1b753f40c3d05932ed9bd987861d6c13366
36 changes: 36 additions & 0 deletions ComplementaryScripts/Functions/writeHumanYaml.m
Original file line number Diff line number Diff line change
@@ -51,6 +51,9 @@ function writeHumanYaml(model,name)
fid = fopen(name,'wt');
fprintf(fid,'!!omap\n');

% insert file header (metadata)
writeMetadata(model,fid);

% metabolites
fprintf(fid,'- metabolites:\n');
[~,pos] = sort(model.mets);
@@ -232,5 +235,38 @@ function writeField(model,fid,fieldName,type,pos,name)
end
end

end


function writeMetadata(model,fid)
% Writes model metadata to the yaml file. This information will eventually
% be extracted entirely from the model, but for now, many of the entries
% are hard-coded defaults for HumanGEM.

fprintf(fid, '- metadata:\n');
fprintf(fid,[' id : "',model.id,'"\n']);
fprintf(fid, ' short_name : "human"\n');
fprintf(fid, ' full_name : "Human metabolic model v1"\n');
fprintf(fid,[' description: "',model.description,'"\n']);
fprintf(fid,[' version : "',model.version,'"\n']);
fprintf(fid, ' author:\n');
fprintf(fid, ' - first_name : "Jonathan"\n');
fprintf(fid, ' last_name : "Robinson"\n');
fprintf(fid, ' email : "[email protected]"\n');
fprintf(fid, ' organization: "Chalmers University of Technology"\n');
fprintf(fid, ' - first_name : "Pinar"\n');
fprintf(fid, ' last_name : "Kocabas"\n');
fprintf(fid, ' email : "[email protected]"\n');
fprintf(fid, ' organization: "Chalmers University of Technology"\n');
fprintf(fid, ' - first_name : "Hao"\n');
fprintf(fid, ' last_name : "Wang"\n');
fprintf(fid, ' email : "[email protected]"\n');
fprintf(fid, ' organization: "Chalmers University of Technology"\n');
fprintf(fid,[' date : "',datestr(now,29),'"\n']); % 29=YYYY-MM-DD
fprintf(fid, ' sample : "Generic human"\n');
fprintf(fid, ' condition : "Generic metabolism"\n');
% fprintf(fid, ' PMID:\n');
% fprintf(fid, ' - "########"\n');
fprintf(fid, ' github : "https://github.com/SysBioChalmers/human-GEM"\n');

end