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

yeast 8.6.1 #321

Merged
merged 73 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
fb1d630
feat-rxns: add a unique subsystem for each rxn
Jul 23, 2020
e661e51
Fix: update the subsystem information
hongzhonglu Dec 17, 2021
80fbf30
fix: correct subsystem for ATP consumption
hongzhonglu Dec 17, 2021
7f83202
feat: Complex curation and annotation
cheng-yu-zhang Jan 26, 2022
8be4ef3
feat: Complex curation and annotation
cheng-yu-zhang Jan 26, 2022
123eef9
chore: rerun after merge, with RAVEN functions
edkerk May 9, 2022
a8db8b1
feat-rxns: add a unique subsystem for each rxn
Jul 23, 2020
e15537f
Fix: update the subsystem information
hongzhonglu Dec 17, 2021
28cdacb
fix: correct subsystem for ATP consumption
hongzhonglu Dec 17, 2021
e8e25f6
fix: increaseVersion check file change
edkerk May 18, 2022
95cab7c
reason_of_changes
cheng-yu-zhang May 23, 2022
7f68ee7
latest
cheng-yu-zhang May 23, 2022
8765d24
Merge branch 'complex-annotation' of https://github.com/SysBioChalmer…
cheng-yu-zhang May 23, 2022
977c796
Update DBnewRxnsGenes.tsv
cheng-yu-zhang May 23, 2022
4a14d90
feat:add new GPR for transport rxns
cheng-yu-zhang Jan 12, 2022
38e0e2a
feat: change GPR for transport reaction r_2101
cheng-yu-zhang Jan 26, 2022
5de9d8c
feat: correct 18 existing annotations of transport reactions and add …
cheng-yu-zhang Apr 15, 2022
2101832
refactor: adjust data and code for RAVEN
edkerk May 9, 2022
6a0556e
reasons of changes
cheng-yu-zhang May 23, 2022
bbaefdb
feat: refactor adding of new grRules
edkerk May 23, 2022
1014a41
fix: remove old GPR curations
edkerk May 23, 2022
9db28d9
chore: output model
edkerk May 23, 2022
6b873a0
Merge branch 'develop' into complex-annotation
edkerk May 23, 2022
ce75352
feat: refactor adding of new grRules
edkerk May 23, 2022
4bcfa9b
feat: reorganize files complex annotation
edkerk May 23, 2022
a271a05
chore: output model
edkerk May 23, 2022
759801a
fix: accept change in README.md
edkerk May 23, 2022
75598c5
add a higher level explanation and update "complexAnnotation" and "co…
cheng-yu-zhang May 26, 2022
4d80ae3
update "Rxn_unique_subsystem"
cheng-yu-zhang May 26, 2022
b55b7c0
Merge branch 'unique_subsystem_of_rxn' of https://github.com/SysBioCh…
cheng-yu-zhang May 26, 2022
aaecdd6
refactor: essentialGenes no longer COBRA dependent
edkerk May 26, 2022
7e36266
fix: remove word document
edkerk May 26, 2022
c9ddfce
chore: write new model files
edkerk May 26, 2022
182cead
fix: remove COBRA dependency
edkerk May 26, 2022
eb80b90
update “transRxnNewGPR”
cheng-yu-zhang May 26, 2022
f01c2d2
chore: remove .idea folder
edkerk May 26, 2022
ec131ef
chore: update model files
edkerk May 26, 2022
5de624b
fix: essentialGenes correct output
edkerk May 26, 2022
9980a70
add_19_new_GPR
cheng-yu-zhang May 26, 2022
fca543a
Merge branch 'complex-annotation' into add_new_GPR
edkerk May 26, 2022
8a643e6
Merge branch 'transporter-annotation-for-transport-rxns' into add_new…
edkerk May 26, 2022
204b568
feat: consolidated curation between releases
edkerk May 26, 2022
dbaa751
chore: generate model files
edkerk May 26, 2022
b1912a7
feat: more info in readme.md when release is made
edkerk May 26, 2022
dea4961
feat: template curation script
edkerk May 26, 2022
d144c89
resolve the mentioned questions
cheng-yu-zhang May 28, 2022
4306061
resolve the mentioned problems
cheng-yu-zhang May 28, 2022
f5390f0
Merge pull request #306 from SysBioChalmers/transporter-annotation-fo…
edkerk May 28, 2022
5fee12b
Merge remote-tracking branch 'origin/develop' into complex-annotation
edkerk May 28, 2022
63e1de0
chore: regenerate models
edkerk May 28, 2022
42a3fb0
Merge pull request #305 from SysBioChalmers/complex-annotation
edkerk May 28, 2022
7d08c62
Merge remote-tracking branch 'origin/develop' into add_new_GPR
edkerk May 28, 2022
bfb9e5d
chore: regenerate model files
edkerk May 28, 2022
9f0b0aa
fix: curation script
edkerk May 28, 2022
38b0bee
doc: contributing guidelines
edkerk May 28, 2022
bbd46f6
resolve the mentioned problem
cheng-yu-zhang May 29, 2022
eab45b9
remove r_4566 and make r_4232 reversible
cheng-yu-zhang May 30, 2022
ce5a927
refactor: use consolidate curation script
edkerk May 29, 2022
43d4d14
feat: remove duplicate reactions
edkerk May 30, 2022
8d36a96
Update subsystem files; add the "addRxnSubsystem.m"
cheng-yu-zhang Jun 1, 2022
d63a9ce
chore: remove backup file
edkerk Jun 5, 2022
fa480e0
refactor: remove capitalization of subsystems
edkerk Jun 5, 2022
a3bea04
Merge pull request #313 from SysBioChalmers/add_new_GPR
edkerk Jun 5, 2022
25d5335
Merge remote-tracking branch 'origin/develop' into unique_subsystem_o…
edkerk Jun 5, 2022
c690e4d
fix: remove GPRs of deleted reactions
edkerk Jun 5, 2022
dba987b
chore: regenerated models
edkerk Jun 5, 2022
3b1a641
Update uniqueSubsystems.tsv and delete keggpathway.tsv
cheng-yu-zhang Jun 7, 2022
ae0fa27
chore: generate new model files
edkerk Jun 7, 2022
7ed59d5
refactor: reorganize old curation data and scripts
edkerk Jun 7, 2022
7a25007
fix: capitalization gluconeogenesis
edkerk Jun 15, 2022
5f49f66
Merge pull request #307 from SysBioChalmers/unique_subsystem_of_rxn
edkerk Jun 16, 2022
fdd0f2f
Merge branch 'main' into develop
edkerk Jun 16, 2022
dcf1cae
refactor: move requirements/ to code/requirements/
edkerk Jun 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Contributor guidelines

First of all, thank you for contributing to yeast-GEM!! Anybody is welcome to contribute, but please abide by the following guidelines.
First of all, thank you for contributing to yeast-GEM! Anybody is welcome to contribute, but please abide by the following guidelines.

You can contribute in 2 main ways: by creating issues, and by sending pull requests (PRs) with additions, deletions, corrections, etc. to the model.

Expand All @@ -14,7 +14,7 @@ Report an issue at https://github.com/SysBioChalmers/yeast-GEM/issues if you not
* Lacking documentation.
* Any type of feedback.

If you are unsure about the issue, consider asking first in our [Gitter chat room](https://gitter.im/SysBioChalmers/yeast-GEM).
If you are unsure about the issue, consider asking first in our [Gitter chat room](https://gitter.im/SysBioChalmers/yeast-GEM) or [GitHub Discussion forum](https://github.com/SysBioChalmers/yeast-GEM/discussions).

When creating the issue, please make sure:

Expand All @@ -29,11 +29,11 @@ Finally, if you like yeast-GEM please remember to 'star' our Github page (click

### Contributing to the model

Want to contribute to the model with some additions or improvements? Consider starting by raising an issue and assign it to yourself to describe what you want to achieve. This way, we reduce the risk of duplicated efforts and you may also get suggestions on how to best proceed, e.g. there may be half-finished work in some branch that you could start with. Also, feel free to browse our [open issues](https://github.com/SysBioChalmers/yeast-GEM/issues) and our [ongoing projects](https://github.com/SysBioChalmers/yeast-GEM/projects): Anything tagged with "help wanted" is open to whoever wants to implement it!
Do you want to contribute to the model with some additions or improvements? Consider starting by raising an issue and assign it to yourself to describe what you want to achieve. This way, we reduce the risk of duplicated efforts and you may also get suggestions on how to best proceed, e.g. there may be half-finished work in some branch that you could start with. Also, feel free to browse our [open issues](https://github.com/SysBioChalmers/yeast-GEM/issues) and our [ongoing projects](https://github.com/SysBioChalmers/yeast-GEM/projects): Anything tagged with "help wanted" is open to whoever wants to implement it!

Here's how to set up yeast-GEM for local development to contribute smaller features or changes that you can implement yourself:
Here is how to set up yeast-GEM for local development to contribute smaller features or changes that you can implement yourself:

1. First of all, make sure that you have all [requirements](https://github.com/SysBioChalmers/yeast-GEM#required-software---contributor) for contributing to yeast-GEM. Note that COBRA and RAVEN should be cloned in your computer and not just downloaded.
1. First of all, make sure that you have all [requirements](https://github.com/SysBioChalmers/yeast-GEM#developer) for contributing to yeast-GEM.

2. Fork the yeast-GEM repository on GitHub (go to https://github.com/SysBioChalmers/yeast-GEM & click on the upper right corner).

Expand All @@ -53,15 +53,13 @@ Here's how to set up yeast-GEM for local development to contribute smaller featu
```

6. Now you can make your changes locally!
* Always make your changes in Matlab and never directly editing the model files. For loading the model use `loadYeastModel.m`, and for saving the model use `saveYeastModel.m`. The latter will ensure all 3 versions of the model (`.xml`, `.yml` & `.txt`) get updated in the same way.
* If your changes are minor (e.g. a single chemical formula you wish to correct), you can do it directly from the command line.
* If your changes are not so small and require several steps, create a script that loads the model, reads data (if applicable), changes the model accordingly, and saves the model back.
* Each script should start with a commented section describing the script, explaining the parameters, and indicating your name and the date it was written. Existing functions can clarify what style should be used.
* Always make your changes in MATLAB and never directly editing the model files. For loading the model use `loadYeastModel.m`, and for saving the model use `saveYeastModel.m`. The latter will ensure all 3 versions of the model (`.xml`, `.yml` & `.txt`) get updated in the same way.
* Curations to the model are consolidated in scripts that can convert a model from one yeast-GEM release (=version) to the next. Therefore, use the `/code/modelCuration/TEMPLATEcuration.m` file, or contribute directly to an existing `v$VERSION.m` script, where `$VERSION` matches the most recent yeast-GEM release. If the most recent release is 8.6.0, there will be a `/code/modelCuration/v8_6_0.m` script that consolidates curations to be applied to release 8.6.0.
* See the `TEMPLATEcuration.m` script with more description on how to use this file. Look at previous curations files (e.g. `v8_6_0.m`) to get an idea of how this works.
* As much as possible follow the model conventions:
- For new metabolites and/or reactions, please use `/code/otherChanges/getNewIndex.m` for obtaining new ids.
- For metabolite and/or reaction names, please avoid any unconventional characters (e.g. Greek letters).
- For new genes, please use as id the [systematic names from SGD](http://seq.yeastgenome.org/help/community/nomenclature-conventions).
* Store scripts in the appropriate folder in `/code` and data (as `.tsv` files) in the appropriate folder in `/data`. If you think no folder is adequate for your script/data, feel free to create your own folder. Note that binary data such as `.mat` structures or `.xls` tables cannot be stored in the repo (as they cannot be version-controlled, and they increment too much the size of the repo).
* Store generic scripts in the appropriate folder in `/code` and data (as `.tsv` files) in the appropriate folder in `/data`. If a data file is just to apply one round of curation (for instance a table with selected gene associations to be corrected), it should be stored in the appropriate subfolder in `/code/modelCuration`. If you think no folder is adequate for your script/data, feel free to create your own folder. Note that binary data such as `.mat` structures or `.xls` tables cannot be stored in the repo (as they cannot be version-controlled, and they increment too much the size of the repo).
* When you are done making changes, review locally your changes with `git diff` or any git client, to make sure you are modifying the model as you intended.

7. Commit your changes and push your branch to GitHub.
Expand Down
11 changes: 6 additions & 5 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
### Description of the issue:
*Try to be as clear as possible: Is it something wrong/missing in the model? Is it a simulation issue? PLEASE DELETE THIS LINE.*
<!-- Try to be as clear as possible: Is it something wrong/missing in the model? Is it a simulation issue -->


#### Expected feature/value/output:
*How the reaction/metabolite/gene/simulation result should look (cite literature if needed). PLEASE DELETE THIS LINE.*
<!-- How the reaction/metabolite/gene/simulation result should look (cite literature if needed). -->


#### Current feature/value/output:
*How the reaction/metabolite/gene/simulation actually looks in the `main` branch. PLEASE DELETE THIS LINE.*
<!-- How the reaction/metabolite/gene/simulation actually looks in the `main` branch. -->


#### Reproducing these results:
*Please attach any code used below (if it's python code replace the word "matlab" with "python". PLEASE DELETE THIS LINE.*
<!-- Please attach any code used below (if it's python code replace the word "matlab" with "python". -->
```matlab

```

**I hereby confirm that I have:**
<!-- Note: replace [ ] with [X] to check the box -->
- [ ] Tested my code with [all requirements](https://github.com/SysBioChalmers/yeast-GEM#required-software---user) for running the model
- [ ] Done this analysis in the `main` branch of the repository
- [ ] Done this analysis in the `develop` branch of the repository
- [ ] Checked that a similar issue does not exist already
- [ ] If needed, asked first in the [Gitter chat room](https://gitter.im/SysBioChalmers/yeast-GEM) about the issue
2 changes: 1 addition & 1 deletion .github/workflows/memote-history.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
python-version: '3.9.7'

- name: Install memote
run: pip install -r requirements/ci-requirements.txt
run: pip install -r code/requirements/ci-requirements.txt

- name: Setup variables
id: setup
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/memote-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
python-version: '3.9.7'

- name: Install memote
run: pip install -r requirements/ci-requirements.txt
run: pip install -r code/requirements/ci-requirements.txt

- name: Convert model
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/memote_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
python-version: '3.9.7'

- name: Install memote
run: pip install -r requirements/requirements.txt
run: pip install -r code/requirements/requirements.txt

- name: Memote run
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yaml-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ jobs:

- name: Import with cobrapy
run: |
pip install -r requirements/ci-requirements.txt
pip install -r code/requirements/ci-requirements.txt
python -c "import cobra ; cobra.io.load_yaml_model('model/yeast-GEM.yml')"
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
.Trashes
ehthumbs.db
Thumbs.db
.idea

# Matlab generated files #
##########################
Expand All @@ -51,7 +52,10 @@ helpsearch*/
*.pyc
*.env

# Non-complying tables #
########################
*.xls
# Non-complying tables and files #
##################################
*.xls*
*.tab
*.doc*
*.ppt*
*.bak
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This repository contains the current consensus genome-scale metabolic model of _

| Taxonomy | Latest update | Version | Reactions | Metabolites | Genes |
|:-------|:--------------|:------|:------|:----------|:-----|
| _Saccharomyces cerevisiae_ | 18-May-2022 | 8.6.0 | 4069 | 2749 | 1151 |
| _Saccharomyces cerevisiae_ | 15-Jun-2022 | develop | 4063 | 2744 | 1163 |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, is it expected to have develop here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, new readme.md will be generated as part of making new release.


# Installation & usage

Expand Down Expand Up @@ -69,7 +69,7 @@ Please see the installation instructions for each software package.

If you want to use any of the [provided](https://github.com/SysBioChalmers/yeast-GEM/tree/main/code) Python functions, you may create an environment with all requirements:
```bash
pip install -r requirements/requirements.txt # installs all dependencies
pip install -r code/requirements/requirements.txt # installs all dependencies
touch .env # creates a .env file for locating the root
```

Expand Down
File renamed without changes.
30 changes: 30 additions & 0 deletions code/deprecated/modelCuration/addRxnSubsystem.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
% This Function is for adding new subsystem into model.
% Input: model, keggPathways.tsv.
% NOTE: Before run the codes below, the file should be manually editted.
% COBRA required.
% New subsystem should be in .tsv format.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Load model
cd ..
model = loadYeastModel;

%newsubsystem:
fid = fopen('../data/modelCuration/v8_6_0/keggPathways.tsv');
sub_data = textscan(fid,'%s %s %s','Delimiter','\t','HeaderLines',1);
id = sub_data{1};
subSystems = sub_data{2};
fclose(fid);
for i = 1:length(model.rxns)
if i <= length(id)
subIndex = find(strcmp(model.rxns, id(i)));
model.subSystems{subIndex, 1} = subSystems{i};
else
model.subSystems{i, 1} = 'nan';
end
end

% Save model:
cd ..
saveYeastModel(model)
cd modelCuration
File renamed without changes.
2 changes: 1 addition & 1 deletion code/getEarlierModelVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

if any(regexp(version,'^\d+\.\d+\.\d+$')) % Tag is a version number
tagpath=['git show refs/tags/v' version ':'];
elseif any(contains(tag,{'main','develop'}))
elseif any(contains(version,{'main','develop'}))
tagpath=['git show ' version ':'];
else
error('version should be ''main'', ''develop'', or a specific release, e.g. ''8.1.0''')
Expand Down
48 changes: 44 additions & 4 deletions code/increaseVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function increaseVersion(bumpType)

%Check if in main:
[~,currentBranch] = system('git rev-parse --abbrev-ref HEAD');
if ~strcmp(currentBranch,'main')
if ~strcmp(strtrim(currentBranch),'main')
error('ERROR: not in main')
end

Expand Down Expand Up @@ -46,8 +46,48 @@ function increaseVersion(bumpType)
end

%Load model:
disp('Loading model file')
model = importModel('../model/yeast-GEM.xml');

%Run tests
cd modelTests
disp('Running gene essentiality analysis')
[new.accuracy,new.tp,new.tn,new.fn,new.fp] = essentialGenes(newModel);
disp('Run growth analysis')
new.R2=growth(newModel);
saveas(gcf,'../../growth.png');

copyfile('../README.md','backup.md')
fin = fopen('backup.md','r');
fout = fopen('../README.md','w');
searchStats1 = '^(- Accuracy\: )0\.\d+';
searchStats2 = '^(- True positive genes\: )\d+';
searchStats3 = '^(- True negative genes\: )\d+';
searchStats4 = '^(- False positive genes\: )\d+';
searchStats5 = '^(- False negative genes\: )\d+';
newStats1 = ['$1' num2str(new.accuracy)];
newStats2 = ['$1' num2str(numel(new.tp))];
newStats3 = ['$1' num2str(numel(new.tn))];
newStats4 = ['$1' num2str(numel(new.fp))];
newStats5 = ['$1' num2str(numel(new.fn))];

searchStats6 = '^(- R<sup>2<\/sup>\: )0\.\d+';
newStats6 = ['$1' num2str(new.R2)];

while ~feof(fin)
str = fgets(fin);
inline = regexprep(str,searchStats1,newStats1);
inline = regexprep(inline,searchStats2,newStats2);
inline = regexprep(inline,searchStats3,newStats3);
inline = regexprep(inline,searchStats4,newStats4);
inline = regexprep(inline,searchStats5,newStats5);
inline = regexprep(inline,searchStats6,newStats6);
inline = unicode2native(inline,'UTF-8');
fwrite(fout,inline);
end
fclose('all');
delete('backup.md');

%Allow .mat & .xlsx storage:
copyfile('../.gitignore','backup')
fin = fopen('backup','r');
Expand Down Expand Up @@ -77,14 +117,14 @@ function increaseVersion(bumpType)
if length(diff_i) == 3
switch diff_i{3}
case 'model/yeast-GEM.xml'
%.xml file: 2 line2 should be added & 2 line2 should be deleted
%.xml file: 2 lines should be added & 2 lines should be deleted
if eval([diff_i{1} ' > 2']) || eval([diff_i{2} ' > 2'])
disp(['NOTE: File ' diff_i{3} ' is changing more than expected'])
change = true;
end
case 'model/yeast-GEM.yml'
%.yml file: 1 line should be added & 1 line should be deleted
if eval([diff_i{1} ' > 1']) || eval([diff_i{2} ' > 1'])
%.yml file: 2 lines should be added & 2 lines should be deleted
if eval([diff_i{1} ' > 2']) || eval([diff_i{2} ' > 2'])
disp(['NOTE: File ' diff_i{3} ' is changing more than expected'])
change = true;
end
Expand Down
1 change: 1 addition & 0 deletions code/loadYeastModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@
model = ravenCobraWrapper(model);
end
end
disp('If there is only 1 warning and no errors, it can savely be ignored.')
end
6 changes: 2 additions & 4 deletions code/missingFields/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## Missing Fields
## Missing fields

Scripts for adding fields to the model.

**NOTE:** These scripts are provided as documentation + eventual re-use for developers. They are NOT intended to be used by regular users.
Various scripts for adding and curating various annotation fields to the model, that are useful for model curation. These functions should be written in a generic format, so that they could be reused for future curations.
8 changes: 6 additions & 2 deletions code/modelCuration/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Model Curation
## Model curation

Scripts for curating different parts of the model.

**NOTE:** These scripts are provided as documentation + eventual re-use for developers. They are NOT intended to be used by regular users.
Curations between each model release are gathered in consolidated curation scripts that are named after the model version that they are curation. E.g. v8_6_0.m includes updates that should be applied to model version 8.6.0 to result in the next model release.

TEMPLATEcuration.m is the template script that should be used to generate a new consolidated curation script after a new model has just been released.

In addition, this folder contains generic functions that are useful for model curation. These functions should be written in a generic format, so that they could be reused for future curations.
64 changes: 64 additions & 0 deletions code/modelCuration/TEMPLATEcuration.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
%% TEMPLATE FOR SCRIPT THAT CONSOLIDATES CURATIONS THAT ARE MADE TO A MODEL
% RELEASE. EACH RELEASE (e.g. yeast-GEM v8.6.1) WILL HAVE ITS OWN SCRIPT WHERE
% CURATIONS TO THAT MODEL RELEASE ARE CONSOLIDATED, MATCHING A DEDICATED FOLDER
% WITH DATA IN code/modelCuration/. SEE EARLIER SCRIPTS AS EXAMPLE. AFTER A NEW
% RELEASE IS MADE ON GITHUB, COPY-PASTE THIS TEMPLATE, REMOVE THIS LEADING
% CAPITALIZED TEXT, AND REPLACE $VERSION WITH THE VERSION NUMBER OF THE RECENT
% YEAST-GEM RELEASE (e.g. $VERSION --> 8.6.1).

% This scripts applies curations to be applied on yeast-GEM release $VERSION.
% Indicate which Issue/PR are addressed. If multiple curations are performed
% before a new release is made, just add the required code to this script. If
% more extensive coding is required, you can write a separate (generic) function
% that can be kept in the /code/modelCuration folder. Otherwise, try to use
% existing functions whenever possible. In particular /code/curateMetsRxnsGenes
% can do many types of curation.

%% Load yeast-GEM $VERSION (requires local yeast-GEM git repository)
cd ..
model = getEarlierModelVersion('$VERSION');
model.id='yeastGEM_develop';
cd modelCuration

%% Brief description of curation to be performed (PR #xxx) [include correct PR or Issue number]
% Potential longer description of curation to be performed.
% If any data files need to be loaded, keep these in the dedicated folder at
% data/modelCuration/v$VERSION

% Example [DELETE WHEN NOT USED]:

%% Curate gene association for transport rxns (PR #306)
% Add new genes
model = curateMetsRxnsGenes(model,'none','../../data/modelCuration/curationsOnV8_6_0/transRxnNewGPRGenes.tsv');

% Change GPR relations
fid = fopen('../../data/modelCuration/curationsOnV8_6_0/TransRxnNewGPR.tsv');
changegpr = textscan(fid,'%q %q %q %q %q %q %q %q','Delimiter','\t','HeaderLines',1);
newGPR.ID = changegpr{1};
newGPR.GPR = changegpr{2};
fclose(fid);

model=changeGrRules(model,newGPR.ID,newGPR.GPR);

% Delete unused genes (if any)
model = deleteUnusedGenes(model);

%% DO NOT CHANGE OR REMOVE THE CODE BELOW THIS LINE.
% Show some metrics:
cd ../modelTests
disp('Run gene essentiality analysis')
[new.accuracy,new.tp,new.tn,new.fn,new.fp] = essentialGenes(model);
fprintf('Genes in model: %d\n',numel(model.genes));
fprintf('Gene essentiality accuracy: %.4f\n', new.accuracy);
fprintf('Gene essentiality TP: %d\n', numel(new.tp));
fprintf('Gene essentiality TN: %d\n', numel(new.tn));
fprintf('Gene essentiality FP: %d\n', numel(new.fp));
fprintf('Gene essentiality FN: %d\n', numel(new.fn));
fprintf('\nRun growth analysis\n')
R2=growth(model);
fprintf('R2 of growth prediction: %.4f\n', R2);

% Save model:
cd ..
saveYeastModel(model)
cd modelCuration
Loading