Skip to content

Commit

Permalink
Merge pull request #475 from SysBioChalmers/develop
Browse files Browse the repository at this point in the history
RAVEN 2.8.0
  • Loading branch information
edkerk authored Mar 21, 2023
2 parents 6638c2b + c12f5de commit fe08c08
Show file tree
Hide file tree
Showing 79 changed files with 1,400 additions and 1,296 deletions.
16 changes: 11 additions & 5 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ INSERT CODE HERE
```

#### System information
* Please report:
1. RAVEN version (stabile [release](https://github.com/SysBioChalmers/RAVEN/releases), `devel` branch?)
2. Operating system (Windows/Mac/Linux; include version)
<!-- Please report the complete output from checkInstallation, for instance:
> Installing from location C:\Work\GitHub\RAVEN
> Checking RAVEN release 2.7.12
> You are running the latest RAVEN release
> Checking MATLAB release 2022a
> Checking system architecture win64
> Set RAVEN in MATLAB path Pass
> Save MATLAB path Pass
etc. etc.
-->

**I hereby confirm that I have:**
<!-- Note: replace [ ] with [X] to check the box -->
- [ ] Followed the [guidelines](https://github.com/SysBioChalmers/RAVEN/wiki/Installation) to install RAVEN.
- [ ] Checked that a similar issue does not [already exist](https://github.com/SysBioChalmers/RAVEN/issues?utf8=%E2%9C%93&q=is%3Aissue)
- [ ] If suitable, needed, asked first in the [Gitter chat room](https://gitter.im/SysBioChalmers/RAVEN) about the issue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
This PR has been [automatically tested with GH Actions](https://github.com/SysBioChalmers/RAVEN/actions/runs/{GH_ACTION_RUN}). Here is the output of the tests:

```
<pre>
{TEST_RESULTS}
```
</pre>

> _Note: In the case of multiple test runs, this post will be edited._
> _Note: In the case of multiple test runs, this post will be edited._
30 changes: 0 additions & 30 deletions .github/workflows/testing.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Tests

on: [pull_request]

jobs:
matlab-tests:
runs-on: self-hosted

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Run tests
id: matlab-test
run: |
TEST_RESULTS=$(/usr/local/bin/matlab -nodisplay -nosplash -nodesktop -r "warning('off', 'MATLAB:rmpath:DirNotFound'); rmpath(genpath('/home/m/ecModels-dependencies/RAVEN')); rmpath(genpath('/home/m/actions-runner')); addpath(genpath('.')); checkInstallation; cd('testing/unit_tests'); runtests(struct2table(dir('*.m')).name); exit;" | awk 'NR>13 && !/^(___|===|---)/')
PARSED_RESULTS="${TEST_RESULTS//'%'/'%25'}"
PARSED_RESULTS="${PARSED_RESULTS//$'\n'/'<br>'}"
PARSED_RESULTS="${PARSED_RESULTS//$'\r'/'<br>'}"
echo "results=$PARSED_RESULTS" >> $GITHUB_OUTPUT
- name: Post comment
uses: NejcZdovc/comment-pr@v2
with:
file: "commentsFromTests.md"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
TEST_RESULTS: ${{steps.matlab-test.outputs.results}}
GH_ACTION_RUN: ${{github.run_id}}
2 changes: 1 addition & 1 deletion INIT/ftINITFillGapsForAllTasks.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
rxnScores=ones(numel(refModel.rxns),1)*-1;
end

if isempty(taskStructure) && ~(exist(inputFile,'file')==2)
if isempty(taskStructure) && ~isfile(inputFile)
error('Task file %s cannot be found',string(inputFile));
end

Expand Down
34 changes: 14 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
# ![The RAVEN Toolbox 2](RAVEN2.png)
<img src="./RAVEN2.png" width="200px">

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3689518.svg)](https://doi.org/10.5281/zenodo.3689518) [![GitHub release](https://img.shields.io/github/release/SysBioChalmers/RAVEN/all.svg)](https://GitHub.com/SysBioChalmers/RAVEN/releases/) [![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) [![View RAVEN Toolbox on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://se.mathworks.com/matlabcentral/fileexchange/112330-raven-toolbox)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3689518.svg)](https://doi.org/10.5281/zenodo.3689518)
[![GitHub release](https://img.shields.io/github/release/SysBioChalmers/RAVEN/all.svg)](https://GitHub.com/SysBioChalmers/RAVEN/releases/)
[![Tests
passing](https://github.com/SysBioChalmers/RAVEN/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/SysBioChalmers/RAVEN/actions)
[![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)
[![View RAVEN Toolbox on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://se.mathworks.com/matlabcentral/fileexchange/112330-raven-toolbox)

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.


## Documentation
The information about downloading, installing and developing RAVEN is included in the [Wiki](https://github.com/SysBioChalmers/RAVEN/wiki)
The information about downloading, installing and developing RAVEN is included in the [Wiki](https://github.com/SysBioChalmers/RAVEN/wiki). The source code documentation is also available
[online](http://sysbiochalmers.github.io/RAVEN/doc/).


## Cite Us
If you use RAVEN 2.0 in your scientific work, please cite:
If you use RAVEN 2 in your scientific work, please cite:
> Wang H, Marcišauskas S, Sánchez BJ, Domenzain I, Hermansson D, Agren R, Nielsen J, Kerkhoven EJ. (2018) RAVEN 2.0: A versatile toolbox for metabolic network reconstruction and a case study on _Streptomyces coelicolor_. PLoS Comput Biol 14(10): e1006541. doi:[10.1371/journal.pcbi.1006541](https://doi.org/10.1371/journal.pcbi.1006541).
Starting with RAVEN v2.3.1, all the releases are also archived in [Zenodo](https://doi.org/10.5281/zenodo.3689518), for you to cite the specific version of RAVEN that you used in your study

If you use ftINIT in your scientific work, please cite:
> Gustafsson J, Anton M, Roshanzamir F, Jörnsten R, Kerkhoven EJ, Robinson JL, Nielsen J. (2023) Generation and analysis of context-specific genome-scale metabolic models derived from single-cell RNA-Seq data. Proc Natl Acad Sci 120(6): e2217868120. doi:[10.1073/pnas.2217868120](https://doi.org/10.1073/pnas.2217868120)
If you use any of the following functions, please also cite the relevant paper:

* `getInitModel` and similar _INIT_ functions:
>Agren R _et al_. (2012) PLoS Comput Biol 8(5): e1002518. doi:[10.1371/journal.pcbi.1002518](http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002518).
* `getInitModel` with a `taskFile` and similar _tINIT_ functions:
>Agren R _et al_. (2014) Mol Syst Biol 10(3): 721. doi:[10.1002/msb.145122](http://msb.embopress.org/content/10/3/721).
* `randomSampling`:
>Bordel S _et al_. (2010) PLoS Comput Biol 6(7): e1000859. doi:[10.1371/journal.pcbi.1000859](http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1000859).
* If you only use RAVEN 1.0 in your scientific work, please cite:
>Agren R _et al_. (2013) PLoS Comput Biol 9(3): e1002980. doi:[10.1371/journal.pcbi.1002980](http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002980).
For crediting supporting work, please cite doi:[10.1002/msb.145122](http://msb.embopress.org/content/10/3/721) (`tInit`); doi:[10.1371/journal.pcbi.1000859](http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1000859) (`randomsampling`). For crediting RAVEN 1, cite doi:[10.1371/journal.pcbi.1002980](http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1002980). For more details, see [wiki#cite-us](https://github.com/SysBioChalmers/RAVEN/wiki#cite-us).

## 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).

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://www.chalmers.se/en/persons/eduardk/).

## More from SysBio Chalmers
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](https://www.sysbio.se/).
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
theme: jekyll-theme-minimal
logo: RAVEN2.png
show_downloads: true
keep_files: ["doc/"]
6 changes: 5 additions & 1 deletion core/addRxns.m
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@
for i = 1:length(rxnsToAdd.mets)
mets = rxnsToAdd.mets{i};
stoichCoeffs = rxnsToAdd.stoichCoeffs{i};
isrev = rxnsToAdd.lb(i) < 0;
if isfield(rxnsToAdd,'ub')
isrev = rxnsToAdd.lb(i) < 0 && rxnsToAdd.ub(i) > 0;
else
isrev = rxnsToAdd.lb(i) < 0;
end
rxnsToAdd.equations{i} = buildEquation(mets,stoichCoeffs,isrev);
end
end
Expand Down
10 changes: 3 additions & 7 deletions core/findRAVENroot.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@

ST=dbstack('-completenames');
prevDir = pwd();
if length(ST)>1
ravenPath=ST(2).file; % In case findRAVENroot is run via another function
else
ravenPath=ST(1).file;
end
ravenPath = ST(strcmp({ST.name},'findRAVENroot')).file;
rootFound = 0;
while rootFound == 0
isRoot = exist(fullfile(ravenPath,'RAVEN2.png'),'file');
if isRoot == 2
isRoot = isfile(fullfile(ravenPath,'RAVEN2.png'));
if isRoot
rootFound = 1;
else
ravenPathOld = ravenPath;
Expand Down
2 changes: 1 addition & 1 deletion core/fitTasks.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
params=[];
end

if isempty(taskStructure) && ~(exist(inputFile,'file')==2)
if isempty(taskStructure) && ~isfile(inputFile)
error('Task file %s cannot be found',string(inputFile));
end

Expand Down
95 changes: 64 additions & 31 deletions core/getAllowedBounds.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,72 @@
minFluxes=zeros(numel(rxns),1);
maxFluxes=zeros(numel(rxns),1);
exitFlags=zeros(numel(rxns),2);

c=zeros(numel(model.rxns),1);
hsSolMin=[];
hsSolMax=[];
fprintf('Getting minimal and maximal fluxes... 0%% complete');
for i=1:numel(rxns)
model.c=c;

%Get minimal flux
model.c(rxns(i))=-1;
[solution, hsSolMin]=solveLP(model,0,[],hsSolMin);
exitFlags(i,1)=solution.stat;
if ~isempty(solution.f)
minFluxes(i)=solution.x(rxns(i));
else
minFluxes(i)=NaN;
end

%Get maximal flux
model.c(rxns(i))=1;
[solution, hsSolMax]=solveLP(model,0,[],hsSolMax);
exitFlags(i,2)=solution.stat;
if ~isempty(solution.f)
maxFluxes(i)=solution.x(rxns(i));
else
maxFluxes(i)=NaN;

N = numel(rxns);
p = 1;
h = waitbar(0, 'Please wait ...');

addonList = matlab.addons.installedAddons;
if any(strcmpi(addonList.Name,'Parallel Computing Toolbox'))
D = parallel.pool.DataQueue;
afterEach(D, @nUpdateWaitbar);

parfor i=1:N
tmpModel=model;
tmpModel.c=c;

%Get minimal flux
tmpModel.c(rxns(i))=-1;
solMin=solveLP(tmpModel);
if ~isempty(solMin.f)
minFluxes(i)=solMin.x(rxns(i));
else
minFluxes(i)=NaN;
end

%Get maximal flux
tmpModel.c(rxns(i))=1;
solMax=solveLP(tmpModel);
exitFlags(i,:)=[solMin.stat solMax.stat];
if ~isempty(solMax.f)
maxFluxes(i)=solMax.x(rxns(i));
else
maxFluxes(i)=NaN;
end
send(D, i);
end
%Print the progress every 25 reactions
if rem(i-1,25) == 0
progress=num2str(floor(100*i/numel(rxns)));
progress=pad(progress,3,'left');
fprintf('\b\b\b\b\b\b\b\b\b\b\b\b\b%s%% complete',progress);
else
for i=1:N
tmpModel=model;
tmpModel.c=c;

%Get minimal flux
tmpModel.c(rxns(i))=-1;
solMin=solveLP(tmpModel);
if ~isempty(solMin.f)
minFluxes(i)=solMin.x(rxns(i));
else
minFluxes(i)=NaN;
end

%Get maximal flux
tmpModel.c(rxns(i))=1;
solMax=solveLP(tmpModel);
exitFlags(i,:)=[solMin.stat solMax.stat];
if ~isempty(solMax.f)
maxFluxes(i)=solMax.x(rxns(i));
else
maxFluxes(i)=NaN;
end
nUpdateWaitbar;
end
end
fprintf('\b\b\b\b\b\b\b\b\b\b\b\b\bCOMPLETE\n');

close(h)

function nUpdateWaitbar(~)
waitbar(p/N, h);
p = p + 1;
end
end
2 changes: 1 addition & 1 deletion core/parseTaskList.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
%
% Usage: taskStruct=parseTaskList(inputFile)

if ~(exist(inputFile,'file')==2)
if ~isfile(inputFile)
error('Task list %s cannot be found',string(inputFile));
end

Expand Down
2 changes: 1 addition & 1 deletion doc/INIT/ftINITFillGapsForAllTasks.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0043 rxnScores=ones(numel(refModel.rxns),1)*-1;
0044 <span class="keyword">end</span>
0045
0046 <span class="keyword">if</span> isempty(taskStructure) &amp;&amp; ~(exist(inputFile,<span class="string">'file'</span>)==2)
0046 <span class="keyword">if</span> isempty(taskStructure) &amp;&amp; ~isfile(inputFile)
0047 error(<span class="string">'Task file %s cannot be found'</span>,string(inputFile));
0048 <span class="keyword">end</span>
0049
Expand Down
Loading

0 comments on commit fe08c08

Please sign in to comment.