Skip to content

Commit

Permalink
Merge branch 'develop' into fix/exprotModel
Browse files Browse the repository at this point in the history
  • Loading branch information
edkerk committed Sep 18, 2024
2 parents ce973b3 + bb2a13e commit 8ee9328
Show file tree
Hide file tree
Showing 683 changed files with 61,896 additions and 28,029 deletions.
6 changes: 5 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Ensure that EOL characters are properly converted for all files
* text=auto
# Use MATLAB style diff
*.m text diff=matlab
*.m text diff=matlab
# Mark as binary to prevent EOL changes. Also no need to track
mafft.bat binary
mafft/ binary
mafft binary
# Files/folders that should not be included when downloading repo as ZIP
.gitattributes export-ignore
.gitignore export-ignore
Expand Down
29 changes: 29 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### Description of the issue:
<!-- Try to be as clear as possible, e.g.
- Is there a functionality missing?
- Did an existing function fail?
- What is the exact error message, and other output that you got?
- What have you tried yourself to fix it? -->

#### Reproducing this issue:
<!-- If applicable, please attach the problematic code. -->
```matlab
INSERT CODE HERE
```

#### System information
<!-- Please report the complete output from checkInstallation, for instance:
> Installing from location C:\Work\GitHub\RAVEN
> Checking RAVEN release 2.8.6
> You are running the latest RAVEN release
> Checking MATLAB release 2023b
> 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 -->
- [ ] Checked that a similar issue does not [already exist](https://github.com/SysBioChalmers/RAVEN/issues?q=is%3Aissue) or is already [discussed](https://github.com/SysBioChalmers/RAVEN/discussions).
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Main improvements in this PR:
<!-- Pointwise mention what changes were made in what function. Examples:
- Fixes:
- `functionName` failed to do action X
- Documentation:
- Updated all documentation
- Features:
- Introduced option to do function Y (issue #12345) -->

#### Instructions on merging this PR:
<!-- Chose ONE of the following two options
and replace [ ] with [X] to check the box.-->
- [ ] This PR has `develop` as target branch, and will be resolved with a *squash-merge*.
- [ ] This PR has `main` as target branch, and will be resolved with a *merge commit*.
7 changes: 7 additions & 0 deletions .github/workflows/commentsFromTests.md
Original file line number Diff line number Diff line change
@@ -0,0 +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._
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@v4

- 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}}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ Temporary Items
#external/kegg/keggRxns.mat
external/kegg/keggModel.mat
#software
software/scip/
!.keep
#doc

# IDE stuff #
################
.idea/
*.iml
75 changes: 75 additions & 0 deletions INIT/INITStepDesc.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
classdef INITStepDesc
% Describes a step in the ftINIT algorithm. A cell array of objects of this
% class is used as input to ftINIT to specify how the algorithm should be run.
properties
PosRevOff
AllowMetSecr
HowToUsePrevResults %'ignore', 'exclude', 'essential'
RxnsToIgnoreMask %Specifies reactions to leave outside the problem in
%the MILP.
% [b1,b2,b3,b4,b5,b6,b7,b8], bx is either 0 or 1,
% where 1 means that the group is excluded.
% b1 - Exchange rxns
% b2 - Import rxns without GPRs (from s into the cell)
% b3 - Simple transport reactions without GPRs (moves one metabolite between compartments)
% b4 - Advanced transport reactions without GPRs (moves metabolites between compartments, more complex function such as antiporter)
% b5 - Spontaneous reactions
% b6 - Reactions in the s compartment without GPRs
% b7 - Customly specified rxns (sent in when generating prepData)
% b8 - All rxns without GPRs

MetsToIgnore % Structure describing mets that can be removed from the model
% before running ftINIT, such as water etc.
% .simpleMets
% .mets Names of metabolites to remove
% .compsToKeep Compartments for which metabolites should be kept.
MILPParams %Cell array of MILPparams - dictates how many iterations that will be run in this step.
%Typically, MIPGap and TimeLimit is specified
AbsMIPGaps %If the objective is close to zero, a percentage of that is very small.
%Therefore, also set an absolut value for this (typically 10 or 20).
%For practical reasons, the first number is not used
end
methods
function obj = INITStepDesc(posRevOff_, AllowMetSecr_, howToUsePrevResults_, rxnsToIgnoreMask_, metsToIgnore_, MILPParams_, absMIPGaps_)
if nargin > 0
obj.PosRevOff = posRevOff_;
else
obj.PosRevOff = false;
end
if nargin > 1
obj.AllowMetSecr = AllowMetSecr_;
else
obj.AllowMetSecr = false;
end
if nargin > 2
obj.HowToUsePrevResults = howToUsePrevResults_;
else
obj.HowToUsePrevResults = 'essential';
end
if nargin > 3
obj.RxnsToIgnoreMask = rxnsToIgnoreMask_;
else
obj.RxnsToIgnoreMask = [1;0;0;0;0;0;0;0];
end
if nargin > 4
obj.MetsToIgnore = metsToIgnore_;
else
obj.MetsToIgnore = [1;0;0;0;0;0;0;0];
end
if nargin > 5
obj.MILPParams = MILPParams_;
else
params = struct();
params.TimeLimit = 5000;
params.MIPGap = 0.0004;
obj.MILPParams = {params};
end

if nargin > 6
obj.AbsMIPGaps = absMIPGaps_;
else
obj.AbsMIPGaps = 10;
end
end
end
end
Loading

0 comments on commit 8ee9328

Please sign in to comment.