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

Apply JSON files for storing curation/annotation information #75

Closed
1 task done
haowang-bioinfo opened this issue Jan 8, 2019 · 2 comments
Closed
1 task done

Comments

@haowang-bioinfo
Copy link
Member

haowang-bioinfo commented Jan 8, 2019

Description of the issue:

  • This issue is derived from another ongoing issue (Migrating toward a binary-free repo #27), which aims to drive the repo toward binary-free mode eventually
  • JSON is an open-standard and language-independent file format. It is human-readable text and commonly used for data interchange
  • JSON files appear to be ideal for archiving information in GEM-type repo and helping the migration to binary-free mode, given that Matlab recently started to support JSON by providing built-in functions (jsondecode, jsonencode) for import/export.

Expected feature/value/output:

  • It is attempted here to utilize JSON files for storing the model annotation information and curation results that are often cell array type variables in humanGEM and previously saved as .mat files
  • Develop necessary tailored functions (e.g. prettyJson) to support the smooth application of JSON files
  • Utilization examples are given below, and will be updated if modified

I hereby confirm that I have:

  • Checked that a similar issue does not exist already
haowang-bioinfo added a commit that referenced this issue Jan 25, 2019
- This new function is to help the application of JSON format files into GEM-type repo, as addressed in issue #75
haowang-bioinfo added a commit that referenced this issue Jan 25, 2019
- This script is to sort out and clean up the previous .mat files generated during reaction association/curation of human-GEM, and then attempt to properly convert remaining ones to JSON format as discussed in #75.
haowang-bioinfo added a commit that referenced this issue Feb 1, 2019
- ihumanRxns2BiGG.mat is removed because all information in this file has been included in another file ihumanRxns2MNX.mat
- Recon3Rxns2MNX.mat is removed because all information in this file has been included in another file Recon3Rxns2HMR.mat
- this commit can be referenced to #27 and #75
haowang-bioinfo added a commit that referenced this issue Feb 1, 2019
- these two .mat files are now replaced with corresponding JSON format files that have the same content.
- this commit is directly associated with #75
@haowang-bioinfo
Copy link
Member Author

The .mat files under RxnAssociation subfolder have been processed according to above guidelines in PR #79. Next step probably is moving forward to MetAssociation subfolder.

@haowang-bioinfo
Copy link
Member Author

haowang-bioinfo commented Jun 5, 2019

Examples for loading/exporting cell array structure from/to a JSON file:

  • Load JSON file abc.json to a variable:
variableName = jsondecode(fileread('abc.JSON'));
  • Export a variable to a abc.json file to :
jsonStr = jsonencode(variableName);
fid = fopen('abc.json', 'w');
fwrite(fid, prettyJson(jsonStr));
fclose(fid);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants