|
1 | 1 | clear; close all |
2 | | -% Load the model and apply the corrections for *all* models |
| 2 | +% Load the old and new model |
3 | 3 | model902 = getEarlierModelVersion('9.0.2'); |
4 | | -cd('../modelCuration/') |
5 | | -v9_1_0; |
| 4 | +model910 = loadYeastModel(); |
6 | 5 |
|
7 | 6 | %% Run growth tests |
8 | | -R2new = growth(model); |
9 | | -R2old = growthOld(model); |
10 | | -% R increased from 0.8528 to 0.9085 |
| 7 | +funcs = {@growth, @growthOld, @growth, @growthOld}; |
| 8 | +models = {model910, model910, model902, model902}; |
| 9 | +titles = {'v9.1.0 model, new anaerobic script', ... |
| 10 | + 'v9.1.0 model, old anaerobic script', ... |
| 11 | + 'v9.0.2 model, new anaerobic script', ... |
| 12 | + 'v9.0.2 model, old anaerobic script'}; |
11 | 13 |
|
12 | | -% Repeat with the model *before* generic 9.1.0 curations were done |
13 | | -R2new902 = growth(model902); |
14 | | -R2old902 = growthOld(model902); |
15 | | -% R decreased from 0.8256 to 0.9001 |
| 14 | +fig1 = figure('Name', 'Growth Comparison', 'Position', [100 100 1000 800]); |
| 15 | +for k = 1:4 |
| 16 | + subplot(2,2,k); |
| 17 | + funcs{k}(models{k}); |
| 18 | + title(titles{k}); |
| 19 | +end |
| 20 | +sgtitle('Growth: v9.1.0 vs v9.0.2, new vs old anaerobic script'); |
| 21 | +saveas(fig1, '..\..\data\testResults\v910_growth.png'); |
| 22 | + |
| 23 | +% R2 of growth prediction increased from 0.8256 to 0.9085 as result of all |
| 24 | +% curations. |
16 | 25 |
|
17 | 26 | %% Convert to anaerobic |
18 | 27 | cd('../otherChanges/') |
19 | | -modelAn = anaerobicModel(model); |
20 | | -modelAnOld = anaerobicModelOld(model); |
| 28 | +modelAn910 = anaerobicModel(model910); |
| 29 | +modelAnOld910 = anaerobicModelOld(model910); |
21 | 30 | modelAn902 = anaerobicModel(model902); |
22 | 31 | modelAnOld902 = anaerobicModelOld(model902); |
23 | 32 |
|
| 33 | +%% Anaerobic flux predictions |
24 | 34 | cd('../modelTests/'); |
25 | | -%% flux predictions |
26 | | -R2fluxnew = anaerobic_flux_predictions(modelAn); |
27 | | -R2fluxold = anaerobic_flux_predictions(modelAnOld); |
28 | | -R2fluxnew902 = anaerobic_flux_predictions(modelAn902); |
29 | | -R2fluxold902 = anaerobic_flux_predictions(modelAnOld902); |
30 | | -% R |
| 35 | +models = {modelAn910, modelAnOld910, modelAn902, modelAnOld902}; |
| 36 | +titles = {'v9.1.0 model, new anaerobic script', ... |
| 37 | + 'v9.1.0 model, old anaerobic script', ... |
| 38 | + 'v9.0.2 model, new anaerobic script', ... |
| 39 | + 'v9.0.2 model, old anaerobic script'}; |
| 40 | +fig2 = figure('Name', 'Anaerobic Comparison', 'Position', [100 100 1000 800]); |
| 41 | +for k = 1:4 |
| 42 | + subplot(2,2,k); |
| 43 | + anaerobic_flux_predictions(models{k}); |
| 44 | + title(titles{k}); |
| 45 | +end |
| 46 | +sgtitle('Anaerobic flux predictions: v9.1.0 vs v9.0.2, new vs old anaerobic script'); |
| 47 | +saveas(fig2, '..\..\data\testResults\v910_anaerobic_fluxes.png'); |
31 | 48 |
|
| 49 | +% R2 of flux predictions increased from 0.7858 to 0.9175 as a response to |
| 50 | +% all curations |
32 | 51 |
|
33 | 52 | %% Plot |
34 | | -plotAnaerobic(modelAn) |
| 53 | +models = {modelAn910, modelAnOld910, modelAn902, modelAnOld902}; |
| 54 | +titles = {'v9.1.0 model, new anaerobic script', ... |
| 55 | + 'v9.1.0 model, old anaerobic script', ... |
| 56 | + 'v9.0.2 model, new anaerobic script', ... |
| 57 | + 'v9.0.2 model, old anaerobic script'}; |
| 58 | +fig3 = figure('Name', 'Anaerobic Comparison', 'Position', [100 100 1000 800]); |
| 59 | +for k = 1:4 |
| 60 | + subplot(2,2,k); |
| 61 | + plotAnaerobic(models{k}); |
| 62 | + title(titles{k}); |
| 63 | +end |
| 64 | +sgtitle('Anaerobic fluxes (Sjöberg data): v9.1.0 vs v9.0.2, new vs old anaerobic script'); |
| 65 | +saveas(fig3, '..\..\data\testResults\v910_anaerobic_sjoberg.png'); |
| 66 | + |
35 | 67 | %% Set glucose uptake rate and solve pFBA |
36 | | -modelAn = setParam(modelAn,'eq','r_1714',-23); |
37 | | -res=solveLP(modelAn,1); |
38 | | -FLUX = res.x; |
39 | | -v_AStr = res.x(getIndexes(modelAn,'r_1115','rxns')); |
40 | | -v_ATPase = res.x(getIndexes(modelAn,'r_0227','rxns')); |
41 | | -v_glc = res.x(getIndexes(modelAn,'r_1714','rxns')); |
| 68 | +temp_model = setParam(modelAn910,'eq','r_1714',-23); |
| 69 | +res=solveLP(temp_model,1); FLUX = res.x; |
| 70 | + |
| 71 | +v_AStr = res.x(getIndexes(temp_model,'r_1115','rxns')); % Ammonium exchange |
| 72 | +v_ATPase = res.x(getIndexes(temp_model,'r_0227','rxns')); % ATPase |
| 73 | +v_glc = res.x(getIndexes(temp_model,'r_1714','rxns')); % Glucose uptake |
| 74 | +[v_AStr, v_ATPase, v_glc] |
42 | 75 |
|
43 | 76 | %% Pack flux results into table |
44 | | -temp_model=modelAn; |
45 | | -rxns_reacs=constructEquations(temp_model,modelAn.rxns); |
46 | | -tab=table(modelAn.rxns,modelAn.rxnNames,rxns_reacs,abs(FLUX./v_glc),FLUX,modelAn.grRules); |
| 77 | +rxns_reacs=constructEquations(temp_model,temp_model.rxns); |
| 78 | +tab=table(temp_model.rxns,temp_model.rxnNames,rxns_reacs,abs(FLUX./v_glc),FLUX,temp_model.grRules); |
47 | 79 |
|
48 | | -[massImbalance, imBalancedMass, imBalancedCharge, imBalancedRxnBool, elements, missingFormulaeBool, balancedMetBool] = checkMassChargeBalance(modelAn); |
| 80 | +[massImbalance, imBalancedMass, imBalancedCharge, imBalancedRxnBool, elements, missingFormulaeBool, balancedMetBool] = checkMassChargeBalance(temp_model); |
49 | 81 |
|
50 | 82 | tabImbalance = [tab,table(imBalancedRxnBool,imBalancedCharge,imBalancedMass)]; |
51 | 83 | tabImbalance(~imBalancedRxnBool,:) = []; |
|
0 commit comments