Skip to content

Commit

Permalink
feat: check RAVEN version increaseHumanGEMVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
edkerk committed Dec 21, 2024
1 parent dfb4c72 commit de37bfb
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 58 deletions.
56 changes: 13 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
# Human-GEM: The generic genome-scale metabolic model of _Homo sapiens_

[![Join the chat at https://gitter.im/SysBioChalmers/Human-GEM](https://badges.gitter.im/SysBioChalmers/Human-GEM.svg)](https://gitter.im/SysBioChalmers/Human-GEM?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![GitHub version](https://badge.fury.io/gh/sysbiochalmers%2FHuman-GEM.svg)](https://badge.fury.io/gh/sysbiochalmers%2FHuman-GEM)
[![DOI](https://zenodo.org/badge/105752644.svg)](https://zenodo.org/badge/latestdoi/105752644)<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-31-success.svg)](#contributors)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

### Brief model description

This repository contains the latest version of Human-GEM, a human genome-scale metabolic model. We encourage [contributions](#contributing).

### Cite us:

If you use Human1 in your research, please cite:

> J. L. Robinson, P. Kocabasÿ, H. Wang, P.-E. Cholley, et al. An atlas of human metabolism. _Sci. Signal._ 13, eaaz1482 (2020). [doi:10.1126/scisignal.aaz1482](https://doi.org/10.1126/scisignal.aaz1482)
Starting from Human-GEM v1.5.0, all the releases are also archived in [Zenodo](https://doi.org/10.5281/zenodo.4099692) from which specific version can be cited if used.

If you use Mouse1, Rat1, Zebrafish1, Fruitfly1, or Worm1 in your research, please cite:

> H. Wang, J. L. Robinson, P. Kocabasÿ, J. Gustafsson, M. Anton, P.-E. Cholley, et al. Genome-scale metabolic network reconstruction of model animals as a platform for translational research. _PNAS_ 118, e2102344118 (2021). [doi.org/10.1073/pnas.2102344118](https://doi.org/10.1073/pnas.2102344118)


### Model keywords

**Utilisation:** predictive simulation, multi-omics integrative analysis, model template
**Field:** metabolic-network reconstruction
**Type of Model:** reconstruction, curated
Expand All @@ -34,44 +26,35 @@ If you use Mouse1, Rat1, Zebrafish1, Fruitfly1, or Worm1 in your research, pleas
**Metabolic System:** general metabolism
**Condition:** generic metabolism


### Model overview

|Taxonomy | Template Model | Reactions | Metabolites| Genes |
| ------------- |:-------------:|:-------------:|:-------------:|:-----:|
|_Homo sapiens_ | HMR2, Recon3D, iHsa| {{nRXN}}| {{nMET}}| {{nGENE}}|


## Contributing

Contributions are always welcome! Read more about the project's philosophy in our [wiki](https://github.com/SysBioChalmers/Human-GEM/wiki) or have a look at the [Contributing guidelines](https://github.com/SysBioChalmers/Human-GEM/blob/main/.github/CONTRIBUTING.md) before starting.


## User guide

Detailed instructions on the installation and use of the Human-GEM model and repository can be found in the [Human-GEM user guide](https://sysbiochalmers.github.io/Human-GEM-guide/).


# Installation

## Required software
### Basic user
If you want to use the model for your own model simulations, you can use any software that accepts **SBML L3V1 FBCv3** formatted model files. This includes any of the following:

#### MATLAB-based
* [RAVEN Toolbox](https://github.com/SysBioChalmers/RAVEN) v2.10.1+ (recommended, see [Installation instructions](https://github.com/SysBioChalmers/RAVEN/wiki/Installation#installation-instructions))
* [COBRA Toolbox](https://github.com/opencobra/cobratoolbox)
* [RAVEN Toolbox](https://github.com/SysBioChalmers/RAVEN) v2.10.3 or later (recommended, see [Installation instructions](https://github.com/SysBioChalmers/RAVEN/wiki/Installation#installation-instructions))
* [COBRA Toolbox](https://github.com/opencobra/cobratoolbox)

#### Python-based
* [cobrapy](https://github.com/opencobra/cobrapy)

Please see the installation instructions for each software package.

### Developer

#### MATLAB-based
If you want to contribute to the development of Human-GEM, or otherwise want to run any of the [provided](https://github.com/SysBioChalmers/Human-GEM/tree/main/code) MATLAB functions, then the following software is required:
* [RAVEN Toolbox](https://github.com/SysBioChalmers/RAVEN) v2.10.1+ (recommended, see [Installation instructions](https://github.com/SysBioChalmers/RAVEN/wiki/Installation#installation-instructions))
* [RAVEN Toolbox](https://github.com/SysBioChalmers/RAVEN) v2.10.3 or later (recommended, see [Installation instructions](https://github.com/SysBioChalmers/RAVEN/wiki/Installation#installation-instructions))

#### Python-based
You can also contribution to the development of Human-GEM via python (e.g. cobrapy), even if you would not be able to run any of the model-specific MATLAB functions. To curate the model, you can still edit `Human-GEM.yml`, `genes.tsv`, `metabolites.tsv` and `reactions.tsv`, all located in the `model/` folder.
Expand All @@ -92,45 +75,34 @@ HumanGEMInstaller.uninstall
```

## Model files
The model is available as `.xml`, `.xlsx`, `.txt`, `.yml`, and `.mat` in the `model/` directory.

The model is available as `.xml`, `.xlsx`, `.txt`, `.yml`, and `.mat` in the `model/` directory. Note that only the `.yml` version is available on branches other than `main` (e.g., `develop`), to facilitate tracking of model changes.
The model development is based on the `yml` file (to facilitate tracking of model changes), so that this is the only model format available on non-`main` branches (such as `develop`). See also the [location of annotation information](#reaction-metabolite-and-gene-annotations).

## Usage

#### Loading/saving the model in MATLAB

`Human-GEM.mat` (Recommended if on `main` branch)
`Human-GEM.mat` (Recommended if on `main` branch):
* Load and save using the built-in MATLAB `load()` and `save()` functions.

`Human-GEM.yml` (Recommended if on `develop` or other branches)
* Load using the `readYAMLmodel.m` function (from [RAVEN Toolbox](https://github.com/SysBioChalmers/RAVEN))
* Save using the `writeYAMLmodel.m` function (from [RAVEN Toolbox](https://github.com/SysBioChalmers/RAVEN))

`Human-GEM.xml` (SBML format)
* Load using the `importModel.m` function (from [RAVEN Toolbox](https://github.com/SysBioChalmers/RAVEN))
* Save using the `exportModel.m` function (from [RAVEN Toolbox](https://github.com/SysBioChalmers/RAVEN))
`Human-GEM.yml` (Recommended if on `develop` or other branches):
* Load using the `readYAMLmodel.m` function (from [RAVEN Toolbox](https://github.com/SysBioChalmers/RAVEN)).
* Save using the `writeYAMLmodel.m` function (from [RAVEN Toolbox](https://github.com/SysBioChalmers/RAVEN)).

`Human-GEM.xml` (SBML format):
* Load using the `importModel.m` function (from [RAVEN Toolbox](https://github.com/SysBioChalmers/RAVEN)).
* Save using the `exportModel.m` function (from [RAVEN Toolbox](https://github.com/SysBioChalmers/RAVEN)).

## Reaction, metabolite, and gene annotations

Additional annotation information and external identifiers for Human-GEM reactions, metabolites, and genes are provided as `tsv` files in the `model/` directory (`reactions.tsv`, `metabolites.tsv`, and `genes.tsv`, respectively).

To import/export this annotation data to/from MATLAB, use the `importTsvFile` and `exportTsvFile` functions, respectively.

By default, additional annotation information and external identifiers for Human-GEM reactions, metabolites, and genes are **not** kept in the `yml` file, but rather provided as `tsv` files in the `model/` directory (`reactions.tsv`, `metabolites.tsv`, and `genes.tsv`, respectively). The `annotateGEM` function can add those annotations in MATLAB, while direct import/export of this annotation data is done through the `importTsvFile` and `exportTsvFile` functions, respectively.

## Websites

- [Metabolic Atlas](https://metabolicatlas.org/) enables visualization and exploration of Human-GEM content.
- The [Human-GEM user guide](https://sysbiochalmers.github.io/Human-GEM-guide/) provides detailed instructions and examples for using the Human-GEM model and repository.


## Metabolic maps

A collection of manually curated 2D metabolic maps associated with Human-GEM are stored in the [Human-maps repository](https://github.com/SysBioChalmers/Human-maps). These maps can be downloaded from the repository or explored interactively using [Metabolic Atlas](https://metabolicatlas.org/explore/map-viewer/human1).


## Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
Expand Down Expand Up @@ -177,8 +149,6 @@ A collection of manually curated 2D metabolic maps associated with Human-GEM are
</tr>
</tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->
39 changes: 24 additions & 15 deletions code/io/increaseHumanGEMVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,28 @@ function increaseHumanGEMVersion(bumpType,test)
[ST, I]=dbstack('-completenames');
modelPath=fileparts(fileparts(fileparts(ST(I).file)));

%Check RAVEN version
currVer = checkInstallation('versionOnly');
if strcmp(currVer,'develop')
printOrange('WARNING: Cannot determine your RAVEN version as it is in a development branch.\n');
else
currVerNum = str2double(strsplit(currVer,'.'));
minmVer = '2.10.3';
minmVerNum = str2double(strsplit(minmVer,'.'));
if currVerNum(1) < minmVerNum(1)
wrongVersion = true;
elseif currVerNum(2) < minmVerNum(2)
wrongVersion = true;
elseif currVerNum(3) < minmVerNum(3)
wrongVersion = true;
else
wrongVersion = false;
end
end
if wrongVersion
error('Minimum required RAVEN version is %s.',minmVer);
end

%Check if in main:
if ~test
currentBranch = git('rev-parse --abbrev-ref HEAD');
Expand Down Expand Up @@ -46,21 +68,10 @@ function increaseHumanGEMVersion(bumpType,test)
error('ERROR: invalid input. Use either "major", "minor" or "patch"')
end
newVersion = num2str(newVersion,'%d.%d.%d');

%Check if history has been updated:
fid = fopen(fullfile(modelPath,'history.md'),'r');
history = fscanf(fid,'%s');
fclose(fid);
if ~contains(history,['human' newVersion ':'])
error('ERROR: update history.md first')
end
end

%Load model:
currDir = pwd;
cd(fullfile(modelPath,'code','io'))
ihuman = readYAMLmodel_HumanGEM(fullfile(modelPath,'model','Human-GEM.yml'));
cd(currDir)
ihuman = readYAMLmodel(fullfile(modelPath,'model','Human-GEM.yml'));

%Include tag and save model:
if ~test
Expand All @@ -80,9 +91,7 @@ function increaseHumanGEMVersion(bumpType,test)
end

%Export model to multiple formats, without annotation
cd(fullfile(modelPath,'code','io'))
writeYAMLmodel_HumanGEM(ihuman,fullfile(modelPath,'model','Human-GEM.yml'),true,false);
cd(currDir)
writeYAMLmodel(ihuman,fullfile(modelPath,'model','Human-GEM.yml'),true,false);
save(fullfile(modelPath,'model','Human-GEM.mat'),'ihuman');
ihuman = annotateGEM(ihuman); % Add annotation data to structure
exportForGit(ihuman,'Human-GEM',modelPath,{'xml', 'xlsx', 'txt'},'',false);
Expand Down

0 comments on commit de37bfb

Please sign in to comment.