Skip to content

Commit

Permalink
Merge pull request #62 from SysBioChalmers/devel
Browse files Browse the repository at this point in the history
Pull from devel to master for rc-1.1
  • Loading branch information
edkerk authored Mar 15, 2018
2 parents cc33c9b + 5672b87 commit 175e00e
Show file tree
Hide file tree
Showing 190 changed files with 7,236 additions and 5,164 deletions.
71 changes: 38 additions & 33 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
# Mac OS X
#############
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
###############
#external/kegg/keggGenes.mat
#external/kegg/keggMets.mat
#external/kegg/keggPhylDist.mat
#external/kegg/keggRxns.mat
#software
#doc
# Mac OS X
#############
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# MATLAB
#############
*.asv

###############
#external/kegg/keggGenes.mat
#external/kegg/keggMets.mat
#external/kegg/keggPhylDist.mat
#external/kegg/keggRxns.mat
#software
#doc
Binary file added RAVEN2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
122 changes: 9 additions & 113 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,124 +1,20 @@
# The RAVEN Toolbox
# ![The RAVEN Toolbox 2](RAVEN2.png)

[![Join the chat at https://gitter.im/SysBioChalmers/RAVEN](https://badges.gitter.im/SysBioChalmers/RAVEN.svg)](https://gitter.im/SysBioChalmers/RAVEN?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join the chat at https://gitter.im/SysBioChalmers/RAVEN](https://badges.gitter.im/SysBioChalmers/RAVEN.svg)](https://gitter.im/SysBioChalmers/RAVEN?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![GitHub release](https://img.shields.io/github/release/SysBioChalmers/RAVEN/all.svg)](https://GitHub.com/SysBioChalmers/RAVEN/releases/)

The RAVEN (Reconstruction, Analysis and Visualization of Metabolic Networks) Toolbox is a software suite for Matlab that allows for semi-automated reconstruction of genome-scale models (GEMs). It makes use of published models and/or KEGG, MetaCyc databases, coupled with extensive gap-filling and quality control features. The software suite also contains methods for visualizing simulation results and omics data, as well as a range of methods for performing simulations and analyzing the results. The software is a useful tool for system-wide data analysis in a metabolic context and for streamlined reconstruction of metabolic networks based on protein homology.
The RAVEN (Reconstruction, Analysis and Visualization of Metabolic Networks) Toolbox 2 is a software suite for Matlab that allows for semi-automated reconstruction of genome-scale models (GEMs). It makes use of published models and/or KEGG, MetaCyc databases, coupled with extensive gap-filling and quality control features. The software suite also contains methods for visualizing simulation results and omics data, as well as a range of methods for performing simulations and analyzing the results. The software is a useful tool for system-wide data analysis in a metabolic context and for streamlined reconstruction of metabolic networks based on protein homology.

If you are using RAVEN in any scientific work, please cite: [R. Agren, et. al, “The RAVEN Toolbox and Its Use for Generating a Genome-scale Metabolic Model for Penicillium chrysogenum,” PLoS Comput. Biol., vol. 9, no. 3, p. e1002980, Mar. 2013.](http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002980).

> A manuscript describing RAVEN Toolbox 2.0 is currently being prepared. Citation details will therefore be updated in the near future.
> A manuscript describing RAVEN Toolbox 2 is currently being prepared. Citation details will therefore be updated in the near future.
Please report any technical issues and bugs [here](https://github.com/SysBioChalmers/RAVEN/issues). For other issues, please contact [Eduard Kerkhoven](https://github.com/edkerk).
## Documentation
The information about downloading, installing and developing RAVEN is included in the [Wiki](https://github.com/SysBioChalmers/RAVEN/wiki)

## Releases
RAVEN can be installed via cloning the GitHub repository as per below or by downloading and extracting one of the a zipped [release](https://github.com/SysBioChalmers/RAVEN/releases). Please note that the releases do not always represent the most up to date version.

## Installation
### Required software
* A functional [MATLAB](mathworks.com/products/matlab.html) installation (version 2013b or later).

### Dependencies
* [libSBML MATLAB API](https://sourceforge.net/projects/sbml/files/libsbml/5.15.0/stable/MATLAB%20interface/) (version 5.15 or higher), which is utilised for importing and exporting GEMs in SBML format. Note: not needed if [COBRA Toolbox](https://github.com/opencobra/cobratoolbox) is installed.
* At least one solver for linear programming:
* Preferred: [Gurobi Optimizer](http://www.gurobi.com/downloads/gurobi-optimizer) (version 7.5 or higher), academic license is available [here](https://user.gurobi.com/download/licenses/free-academic).
* Alternative/legacy: [MOSEK](https://www.mosek.com/downloads/details/5/) (version 7 only), academic license is available [here](https://www.mosek.com/products/academic-licenses/).
* If the user has [COBRA Toolbox](https://github.com/opencobra/cobratoolbox) installed, it is possible to use the default COBRA solver (the one which is set by _changeCobraSolver_).


### Instructions
#### RAVEN Toolbox
Obtain a RAVEN Toolbox in one of the following ways:
* In Terminal/Command Prompt, navigate to the desired installation directory and run the following Git command:
```bash
git clone git@github.com:SysBioChalmers/RAVEN.git
```
* Alternatively, download the latest [release](https://github.com/SysBioChalmers/RAVEN/releases) of RAVEN Toolbox as a ZIP file, and extracted to your favourite directory.

Once extracted, ensure that all other software dependencies (e.g. libSBML, Gurobi) are installed (see above for [list](#dependencies), below for [instructions](#libSBML). Then, open MATLAB and run the following command:
```matlab
cd('[location]/RAVEN/installation'))
checkInstallation
```
where ```[location]``` is the directory where you installed RAVEN.

This function checks the functionality for libSBML MATLAB API and solver software. It automatically recognises which solvers are installed and sets the first functional solver as the default RAVEN solver. The default RAVEN solver be changed any time by typing in Matlab:

```matlab
setRavenSolver('solverName')
```

Available solver names are ```gurobi```, ```mosek``` and ```cobra```.

In Unix-based systems _checkInstallation_ also checks the consistency of external binary programs. If these binaries are broken, they need to be re-compiled from their corresponding source codes. See the documentation for the corresponding software for more details.

#### libSBML
1. Download libSBML from the link [above](#dependencies) and install to your favourite directory.
2. In MATLAB, run the following command:

```matlab
addpath('[location]/libSBML-5.x.0-matlab')
savepath
```

where ```[location]``` is where you installed libSBML and ```5.x.0``` is your libSBML version (5.15.0 or higher).

#### Gurobi
1. Download from the link [above](#dependencies) and install Gurobi to your favourite location.
2. Make sure you obtained a [license](https://user.gurobi.com/download/licenses/free-academic) following instructions for [Windows](https://www.gurobi.com/documentation/7.5/quickstart_windows/retrieving_and_setting_up_.html), [Mac](https://www.gurobi.com/documentation/7.5/quickstart_mac/retrieving_and_setting_up_.html) or [Unix](https://www.gurobi.com/documentation/7.5/quickstart_linux/retrieving_and_setting_up_.html).
3. To install Gurobi in MATLAB, follow the instructions for [Windows](https://www.gurobi.com/documentation/7.5/quickstart_windows/matlab_setting_up_gurobi_f.html), [Mac](https://www.gurobi.com/documentation/7.5/quickstart_mac/matlab_setting_up_gurobi_f.html) or [Unix](https://www.gurobi.com/documentation/7.5/matlab_setting_up_gurobi_f.html).
4. Make sure that MATLAB remembers the Gurobi installation for next time, by running the following command:

```matlab
savepath
```

#### Mosek
1. Download from the link [above](#dependencies) and install Mosek to your favourite location.
2. Make sure you obtained a [license](https://www.mosek.com/products/academic-licenses/) following [instructions] (https://docs.mosek.com/8.0/install/installation.html#setting-up-the-license).
3. To install Mosek in MATLAB, follow [instructions](https://docs.mosek.com/8.0/toolbox/installation.html#id1). Note: the documentation mentions version 8, but RAVEN only works with version 7 of Mosek.
4. Make sure that MATLAB remembers the Mosek installation for next time, by running the following command:

```matlab
savepath
```

#### COBRA Toolbox
1. To gain access to functions from COBRA Toolbox, follow installation instructions provided [here](https://opencobra.github.io/cobratoolbox/latest/installation.html).
2. To use COBRA-specified solvers (e.g. open-source GLPK solver), configure COBRA and RAVEN with the following commands:

```matlab
changeCobraSolver('glpk')
setRavenSolver('cobra')
```

## Tutorials
Some tutorials highlighting basic RAVEN functionality can be found in the 'tutorial' folder in the installation directory.

## Pre-trained Hidden Markov Models (HMMs) for KEGG Orthology (KO) protein sets
_For RAVEN 2.0_

For _de novo_ reconstruction of a GEM, the RAVEN function _getKEGGModelForOrganism_ can use HMMs trained on KO protein sets. Provided are HMMs trained on KEGG Release 82.0. CD-HIT was used to obtain non-redundant representative KO protein sets thereby clustering proteins with the defined identity and overlap with the longest protein in the corresponding cluster threshold values. Multisequence alignment with MAFFT and training with HMMER 3.1b2 were then performed. The provided archives contain only pre-trained HMMs.

HMM sets can be downloaded **automatically** during GEM reconstruction from KEGG (set the *dataDir* parameter in *getKEGGModelForOrganism*). Alternatively, download links are provided below. The following HMM sets are available:

| dataDir | KEGG version | Phylogeny | Identity (%) | Overlap (%) |
|:-------:|:------------:|:---------:|:------------:|:-----------:|
|[euk100_kegg82](http://biomet-toolbox.org/tools/downloadable/files/euk100_kegg82.zip)|82.0|eukaryota|100|90
|[euk90_kegg82](http://biomet-toolbox.org/tools/downloadable/files/euk100_kegg82.zip)|82.0|eukaryota|90|90
|[euk50_kegg82](http://biomet-toolbox.org/tools/downloadable/files/euk100_kegg82.zip)|82.0|eukaryota|50|90
|[prok100_kegg82](http://biomet-toolbox.org/tools/downloadable/files/euk100_kegg82.zip)|82.0|prokaryota|100|90
|[prok90_kegg82](http://biomet-toolbox.org/tools/downloadable/files/euk100_kegg82.zip)|82.0|prokaryota|90|90
|[prok50_kegg82](http://biomet-toolbox.org/tools/downloadable/files/euk100_kegg82.zip)|82.0|prokaryota|50|90

_For RAVEN 1.9.0 or older_

HMMs were trained from KO protein sets, based on KEGG Release 58.1. Multisequence alignment was performed with ClustalW2, whereas HMMs were trained with HMMER 2.3. All the associated proteins were used in multisequence alignment and HMMs training. In addition to pre-trained HMMs, the archives also contain multisequence alignment data. The following HMM sets are available:

| Dataset | KEGG version | Phylogeny |
|:-------:|:------------:|:---------:|
|[eukaryota](http://biomet-toolbox.org/tools/downloadable/files/euk100_kegg82.zip)|58.1|eukaryota
|[prokaryota](http://biomet-toolbox.org/tools/downloadable/files/euk100_kegg82.zip)|58.1|eukaryota
## Contact Us
For support, technical issues, bug reports etc., please [![Join the chat at https://gitter.im/SysBioChalmers/RAVEN](https://badges.gitter.im/SysBioChalmers/RAVEN.svg)](https://gitter.im/SysBioChalmers/RAVEN?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge). For other issues, please contact [Eduard Kerkhoven](https://github.com/edkerk).

-----

## Links
For more systems biology related software and recently published genome-scale models from the Systems and Synthetic Biology group at Chalmers University of Technology, please visit the [Github page](https://github.com/SysBioChalmers). For more information and publications by the Systems and Synthetic Biology please visit [SysBio](www.sysbio.se).
6 changes: 1 addition & 5 deletions core/addGenes.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
%
% Usage: newModel=addGenes(model,genesToAdd)
%
% Rasmus Agren, 2014-01-08
% Eduard Kerkhoven, 2018-02-23
%

newModel=model;
Expand All @@ -42,10 +42,6 @@
dispEM(EM);
end

illegalCells=regexp(genesToAdd.genes,'[();:]', 'once');
EM='Illegal character(s) in gene names:';
dispEM(EM,true,genesToAdd.genes(~cellfun(@isempty,illegalCells)));

%Number of genes
nGenes=numel(genesToAdd.genes);
nOldGenes=numel(model.genes);
Expand Down
45 changes: 18 additions & 27 deletions core/addRxns.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
%
% Usage: newModel=addRxns(model,rxnsToAdd,eqnType,compartment,allowNewMets)
%
% Eduard Kerkhoven, 2017-12-05
% Eduard Kerkhoven, 2018-02-23
%

if nargin<4
Expand Down Expand Up @@ -152,17 +152,6 @@
rxnsToAdd.equations=cellstr(rxnsToAdd.equations);
end

%Check some formatting
illegalCells=regexp(rxnsToAdd.rxns,'[^a-z_A-Z0-9]', 'once');
EM='Illegal character(s) in reaction IDs:';
dispEM(EM,true,rxnsToAdd.rxns(~cellfun(@isempty,illegalCells)));

if isfield(rxnsToAdd,'rxnNames')
illegalCells=regexp(rxnsToAdd.rxnNames,'["%<>\\]', 'once');
EM='Illegal character(s) in reaction names:';
dispEM(EM,true,rxnsToAdd.rxnNames(~cellfun(@isempty,illegalCells)));
end

nRxns=numel(rxnsToAdd.rxns);
nOldRxns=numel(model.rxns);
filler=cell(nRxns,1);
Expand Down Expand Up @@ -392,6 +381,23 @@
end
end

if isfield(rxnsToAdd,'pwys')
if numel(rxnsToAdd.pwys)~=nRxns
EM='rxnsToAdd.pwys must have the same number of elements as rxnsToAdd.rxns';
dispEM(EM);
end
%Fill with standard if it doesn't exist
if ~isfield(newModel,'pwys')
newModel.pwys=largeFiller;
end
newModel.pwys=[newModel.pwys;rxnsToAdd.pwys(:)];
else
%Fill with standard if it doesn't exist
if isfield(newModel,'pwys')
newModel.pwys=[newModel.pwys;filler];
end
end

if isfield(rxnsToAdd,'rxnConfidenceScores')
if numel(rxnsToAdd.rxnConfidenceScores)~=nRxns
EM='rxnsToAdd.rxnConfidenceScores must have the same number of elements as rxnsToAdd.rxns';
Expand All @@ -409,21 +415,6 @@
end
end

%Check that ids contain no weird characters. This is only done if the
%equations are with metabolite ids
if eqnType==1
illegalCells=regexp(mets,'[^a-z_A-Z0-9]', 'once');
EM='Illegal character(s) in metabolite IDs:';
dispEM(EM,true,mets(~cellfun(@isempty,illegalCells)));
else
%If the mets are metNames
if ~any(~cellfun(@isempty,strfind(mets,'->')))
illegalCells=regexp(mets,'["%<>\\]', 'once');
EM='Illegal character(s) in metabolite names:';
dispEM(EM,true,mets(~cellfun(@isempty,illegalCells)));
end
end

%***Start parsing the equations and adding the info to the S matrix
%The mets are matched to model.mets
if eqnType==1
Expand Down
30 changes: 23 additions & 7 deletions core/addRxnsGenesMets.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
% model draft model where reactions should be copied to
% sourceModel model where reactions and metabolites are sourced from
% rxns cell array with reaction IDs (from source model)
% addGene logical whether genes should be copied or not (opt,
% default false)
% addGene three options:
% false no genes are annotated to the new reactions
% true grRules ared copied from the sourceModel and
% new genes are added when required
% string or cell array
% new grRules are specified as string or cell
% array, and any new genes are added when
% required
% (opt, default false)
% rxnNote string explaining why reactions were copied to model,
% is included as newModel.rxnNotes (opt, default
% 'Added via addRxnsAndMets()')
Expand All @@ -34,7 +41,7 @@
%
% Usage: newModel=addRxnsGenesMets(model,sourceModel,rxns,addGene,rxnNote,confidence)
%
% Eduard Kerkhoven, 2017-12-08
% Eduard Kerkhoven, 2017-02-13
%

if nargin<6
Expand Down Expand Up @@ -127,9 +134,19 @@
fprintf('\n')

%% Add new genes
if addGene
rxnToAdd.grRules=sourceModel.grRules(rxnIdx); % Get the relevant grRules
geneList=strjoin(rxnToAdd.grRules);
if addGene ~= false
if ischar(addGene)
rxnToAdd.grRules={addGene};
elseif iscell(addGene)
rxnToAdd.grRules=addGene;
else
rxnToAdd.grRules=sourceModel.grRules(rxnIdx); % Get the relevant grRules
end
if length(rxnIdx)>1
geneList=strjoin(rxnToAdd.grRules);
else
geneList=rxnToAdd.grRules{1};
end
geneList=regexp(geneList,' |)|(|and|or','split');% Remove all grRule punctuation
geneList=geneList(~cellfun(@isempty,geneList)); % Remove spaces and empty genes
genesToAdd.genes=setdiff(unique(geneList),model.genes); % Only keep new genes
Expand All @@ -145,7 +162,6 @@
fprintf('\n\nNo genes added to the model, because no genes were annotated or all genes were already present.')
end
end

%% Add new reactions
rxnToAdd.equations=constructEquations(sourceModel,rxnIdx);
rxnToAdd.rxnNames=sourceModel.rxnNames(rxnIdx);
Expand Down
3 changes: 3 additions & 0 deletions core/changeRxns.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
if isfield(model,'rxnConfidenceScores')
rxnsToChange.rxnConfidenceScores=model.rxnConfidenceScores(J);
end
if isfield(model,'pwys')
rxnsToChange.pwys=model.pwys(J);
end

%Calculate the new order of reactions
order=ones(numel(model.rxns),1);
Expand Down
Loading

0 comments on commit 175e00e

Please sign in to comment.