From d461d3a8ab80bfc59045170b9f653e33653f63a2 Mon Sep 17 00:00:00 2001 From: Eduard Kerkhoven Date: Sun, 22 Sep 2024 15:47:28 +0200 Subject: [PATCH] fix: compatibility with RAVEN 2.10.0 (#391) * fix: compatible with next RAVEN release * fix: rename anaerobicModel A yeast-GEM-specific script that ideally should be refactored. For now, just rename to avoid conflict with the function in yeast-GEM repository --- doc/index.html | 2 +- .../Bayesian/abc_max.html | 4 +- ...icModel.html => anaerobicModel_GECKO.html} | 16 ++--- .../Bayesian/changeMedia.html | 4 +- .../Bayesian/index.html | 2 +- .../model_adapter/adapterTemplate.html | 27 ++++---- .../Bayesian/abc_max.m | 2 +- ...naerobicModel.m => anaerobicModel_GECKO.m} | 4 +- .../Bayesian/changeMedia.m | 2 +- test/unit_tests/ecTestGEM/data/smilesDB.tsv | 1 + .../unit_tests/ecTestGEM/models/testModel.xml | 69 ++++++++----------- test/unit_tests/getGeckoTestModel.m | 2 +- 12 files changed, 62 insertions(+), 73 deletions(-) rename doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/{anaerobicModel.html => anaerobicModel_GECKO.html} (98%) rename src/geckomat/kcat_sensitivity_analysis/Bayesian/{anaerobicModel.m => anaerobicModel_GECKO.m} (99%) diff --git a/doc/index.html b/doc/index.html index f332bb806..63add7002 100644 --- a/doc/index.html +++ b/doc/index.html @@ -25,7 +25,7 @@

Matlab Files found in these Directories

adapterTemplate fillEnzConcs getrSample sensitivityTuning addCarbonNum findECInDB loadBRENDAdata setKcatForReactions addNewRxnsToEC findGECKOroot loadConventionalGEM setProtPoolSize - anaerobicModel findMaxValue loadDatabases sigmaFitter + anaerobicModel_GECKO findMaxValue loadDatabases sigmaFitter applyComplexData findMetSmiles loadEcModel startGECKOproject applyCustomKcats flexibilizeEnzConcs loadFluxData truncateValues applyKcatConstraints fuzzyKcatMatching loadProtData updateGECKOdoc diff --git a/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/abc_max.html b/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/abc_max.html index b077b3f2f..8b53eca43 100644 --- a/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/abc_max.html +++ b/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/abc_max.html @@ -54,7 +54,7 @@

DESCRIPTION ^CROSS-REFERENCE INFORMATION ^

This function calls: +
  • addCarbonNum addCarbonNum
  • anaerobicModel_GECKO %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • changeMedia changeMedia
  • This function is called by: @@ -152,7 +152,7 @@

    SOURCE CODE ^'r_1631',0,'b'); 0086 0087 if strcmp(data(i,14),'anaerobic') ||strcmp(data(i,14),'limited') -0088 model_tmp = anaerobicModel(model_tmp); +0088 model_tmp = anaerobicModel_GECKO(model_tmp); 0089 end 0090 if strcmp(data(i,14),'limited') 0091 model_tmp.lb(strcmp(model_tmp.rxnNames,'oxygen exchange')) = -5;%TODO: Currently hard-coded for yeast diff --git a/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/anaerobicModel.html b/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/anaerobicModel_GECKO.html similarity index 98% rename from doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/anaerobicModel.html rename to doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/anaerobicModel_GECKO.html index 77886c37d..897661008 100644 --- a/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/anaerobicModel.html +++ b/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/anaerobicModel_GECKO.html @@ -2,8 +2,8 @@ "http://www.w3.org/TR/REC-html40/loose.dtd"> - Description of anaerobicModel - + Description of anaerobicModel_GECKO + @@ -12,23 +12,23 @@ -
    Home > src > geckomat > kcat_sensitivity_analysis > Bayesian > anaerobicModel.m
    +
    Home > src > geckomat > kcat_sensitivity_analysis > Bayesian > anaerobicModel_GECKO.m
    -

    anaerobicModel +

    anaerobicModel_GECKO

    PURPOSE ^

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    SYNOPSIS ^

    -
    function model = anaerobicModel(model)
    +
    function model = anaerobicModel_GECKO(model)

    DESCRIPTION ^

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    - anaerobicModel.m
    + anaerobicModel_GECKO.m
      Converts model to anaerobic
     
      Benjamin J. Sanchez
    @@ -52,14 +52,14 @@ 

    SUBFUNCTIONS ^SOURCE CODE ^

    0001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    -0002 % anaerobicModel.m
    +0002 % anaerobicModel_GECKO.m
     0003 % Converts model to anaerobic
     0004 %
     0005 % Benjamin J. Sanchez
     0006 % Feiran Li - 2019-09-24
     0007 % Feiran Li - Last update: 2019-10-02 modify the order of changes
     0008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    -0009 function model = anaerobicModel(model)
    +0009 function model = anaerobicModel_GECKO(model)
     0010 
     0011 %1th change: Refit GAM and NGAM to exp. data, change biomass composition
     0012 GAM   = 58.1988;  %Data from Nissen et al. 1997
    diff --git a/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/changeMedia.html b/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/changeMedia.html
    index f6d673531..f4202b402 100644
    --- a/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/changeMedia.html
    +++ b/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/changeMedia.html
    @@ -54,7 +54,7 @@ 

    DESCRIPTION ^CROSS-REFERENCE INFORMATION ^

    This function calls:
      -
    • anaerobicModel %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    +
  • anaerobicModel_GECKO %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • This function is called by: @@ -180,7 +180,7 @@

    SOURCE CODE ^% change aeerobic or anaerobic 0114 if strcmp(anox,'anaerobic') 0115 1 -0116 model = anaerobicModel(model); +0116 model = anaerobicModel_GECKO(model); 0117 end 0118 end 0119 diff --git a/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/index.html b/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/index.html index c6a86815b..5cade9575 100644 --- a/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/index.html +++ b/doc/src/geckomat/kcat_sensitivity_analysis/Bayesian/index.html @@ -19,7 +19,7 @@

    Index for src\geckomat\kcat_sensitivity_analysis\Bayesian

    Matlab files in this directory:

    -
     abc_maxsetProtPoolSize
     addCarbonNumaddCarbonNum
     anaerobicModel%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     bayesianSensitivityTuningbayesianSensitivityTuning
     changeMediachangeMedia
     getcarbonnumgetcarbonnum
     getrSamplegetrSample
     updatepriorupdateprior
    + abc_maxsetProtPoolSize  addCarbonNumaddCarbonNum  anaerobicModel_GECKO%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  bayesianSensitivityTuningbayesianSensitivityTuning  changeMediachangeMedia  getcarbonnumgetcarbonnum  getrSamplegetrSample  updatepriorupdateprior diff --git a/doc/src/geckomat/model_adapter/adapterTemplate.html b/doc/src/geckomat/model_adapter/adapterTemplate.html index f045cb472..bec5513e6 100644 --- a/doc/src/geckomat/model_adapter/adapterTemplate.html +++ b/doc/src/geckomat/model_adapter/adapterTemplate.html @@ -108,18 +108,21 @@

    SOURCE CODE ^% Reaction ID for biomass pseudoreaction 0063 obj.params.bioRxn = 'r_4041'; 0064 -0065 % Compartment name in which the added enzymes should be located -0066 obj.params.enzyme_comp = 'cytoplasm'; -0067 end -0068 -0069 function [spont,spontRxnNames] = getSpontaneousReactions(obj,model) -0070 % Indicates how spontaneous reactions are identified. Here it -0071 % is done by the reaction have 'spontaneous' in its name. -0072 spont = contains(model.rxnNames,'spontaneous'); -0073 spontRxnNames = model.rxnNames(spont); -0074 end -0075 end -0076 end

    +0065 % Name of the compartment where the protein pseudometabolites +0066 % should be located (all be located in the same compartment, +0067 % this does not interfere with them catalyzing reactions in +0068 % different compartments). Typically, cytoplasm is chosen. +0069 obj.params.enzyme_comp = 'cytoplasm'; +0070 end +0071 +0072 function [spont,spontRxnNames] = getSpontaneousReactions(obj,model) +0073 % Indicates how spontaneous reactions are identified. Here it +0074 % is done by the reaction have 'spontaneous' in its name. +0075 spont = contains(model.rxnNames,'spontaneous'); +0076 spontRxnNames = model.rxnNames(spont); +0077 end +0078 end +0079 end

    Generated by m2html © 2005
    \ No newline at end of file diff --git a/src/geckomat/kcat_sensitivity_analysis/Bayesian/abc_max.m b/src/geckomat/kcat_sensitivity_analysis/Bayesian/abc_max.m index f2e2e1ca9..c9bf54254 100644 --- a/src/geckomat/kcat_sensitivity_analysis/Bayesian/abc_max.m +++ b/src/geckomat/kcat_sensitivity_analysis/Bayesian/abc_max.m @@ -85,7 +85,7 @@ model_tmp = changeRxnBounds(model_tmp,'r_1631',0,'b'); if strcmp(data(i,14),'anaerobic') ||strcmp(data(i,14),'limited') - model_tmp = anaerobicModel(model_tmp); + model_tmp = anaerobicModel_GECKO(model_tmp); end if strcmp(data(i,14),'limited') model_tmp.lb(strcmp(model_tmp.rxnNames,'oxygen exchange')) = -5;%TODO: Currently hard-coded for yeast diff --git a/src/geckomat/kcat_sensitivity_analysis/Bayesian/anaerobicModel.m b/src/geckomat/kcat_sensitivity_analysis/Bayesian/anaerobicModel_GECKO.m similarity index 99% rename from src/geckomat/kcat_sensitivity_analysis/Bayesian/anaerobicModel.m rename to src/geckomat/kcat_sensitivity_analysis/Bayesian/anaerobicModel_GECKO.m index d1e205b80..9cba35819 100644 --- a/src/geckomat/kcat_sensitivity_analysis/Bayesian/anaerobicModel.m +++ b/src/geckomat/kcat_sensitivity_analysis/Bayesian/anaerobicModel_GECKO.m @@ -1,12 +1,12 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% anaerobicModel.m +% anaerobicModel_GECKO.m % Converts model to anaerobic % % Benjamin J. Sanchez % Feiran Li - 2019-09-24 % Feiran Li - Last update: 2019-10-02 modify the order of changes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -function model = anaerobicModel(model) +function model = anaerobicModel_GECKO(model) %1th change: Refit GAM and NGAM to exp. data, change biomass composition GAM = 58.1988; %Data from Nissen et al. 1997 diff --git a/src/geckomat/kcat_sensitivity_analysis/Bayesian/changeMedia.m b/src/geckomat/kcat_sensitivity_analysis/Bayesian/changeMedia.m index ba493911d..67b25b8fa 100644 --- a/src/geckomat/kcat_sensitivity_analysis/Bayesian/changeMedia.m +++ b/src/geckomat/kcat_sensitivity_analysis/Bayesian/changeMedia.m @@ -113,7 +113,7 @@ % change aeerobic or anaerobic if strcmp(anox,'anaerobic') 1 - model = anaerobicModel(model); + model = anaerobicModel_GECKO(model); end end diff --git a/test/unit_tests/ecTestGEM/data/smilesDB.tsv b/test/unit_tests/ecTestGEM/data/smilesDB.tsv index 8629a01a1..859ca8a75 100644 --- a/test/unit_tests/ecTestGEM/data/smilesDB.tsv +++ b/test/unit_tests/ecTestGEM/data/smilesDB.tsv @@ -2,3 +2,4 @@ e1 C(C1C)O e2 C1C(=NC2) m1 C(C1C)O m2 C1C(=NC2) + diff --git a/test/unit_tests/ecTestGEM/models/testModel.xml b/test/unit_tests/ecTestGEM/models/testModel.xml index a845b969a..11a140c03 100644 --- a/test/unit_tests/ecTestGEM/models/testModel.xml +++ b/test/unit_tests/ecTestGEM/models/testModel.xml @@ -1,21 +1,6 @@ - - - - - - - - 2023-02-20T21:53:00Z - - - 2023-02-20T21:53:00Z - - - - @@ -30,10 +15,10 @@ - - - - + + + + @@ -41,23 +26,23 @@ - + - + - + - + - + - + - + @@ -67,10 +52,10 @@ - + - + @@ -82,10 +67,10 @@ - + - + @@ -95,27 +80,27 @@ - + - + - + - + - + - + - + @@ -125,25 +110,25 @@ - + - + - + - + - + diff --git a/test/unit_tests/getGeckoTestModel.m b/test/unit_tests/getGeckoTestModel.m index 1de61f94a..3d26e2f32 100644 --- a/test/unit_tests/getGeckoTestModel.m +++ b/test/unit_tests/getGeckoTestModel.m @@ -1,8 +1,8 @@ function testModel = getGeckoTestModel() testModel = struct(); -testModel.name = 'testModel'; testModel.id = 'testModel'; +testModel.name = 'testModel'; testModel.annotation.defaultLB = -Inf; testModel.annotation.defaultUB = Inf; testModel.date = datestr(now,29);