%%% SETUP %%% % init cobra toolbox and set solver currDir = pwd; % NOTE: change the relative path to the location of cobratoolbox on your machine! cd('cobratoolbox') initCobraToolbox cd(currDir); changeCobraSolver ('gurobi', 'all'); % load yeastGEM 7.6 model disp('loading model(s)...') % NOTE: change the relative path to the location of the yeast model on your machine! model = readCbModel('sbml\yeast_7.6_cobra.xml'); model = buildRxnGeneMat(model); disp('done') %%% Set constraints: knock out genes and define medium %%% % SEY6210: leu2 ura3 his3 trp1 suc2 lys2 model = deleteModelGenes(model,'YCL018W'); model = deleteModelGenes(model,'YEL021W'); model = deleteModelGenes(model,'YOR202W'); model = deleteModelGenes(model,'YDR007W'); model = deleteModelGenes(model,'YIL162W'); model = deleteModelGenes(model,'YBR115C'); % SDC medium model = changeRxnBounds(model,'r_1639',-1,'l'); % Adenine model = changeRxnBounds(model,'r_1899',-1,'l'); % Leu model = changeRxnBounds(model,'r_1873',-1,'l'); % Ala model = changeRxnBounds(model,'r_1880',-1,'l'); % Asp model = changeRxnBounds(model,'r_1889',-1,'l'); % Glu model = changeRxnBounds(model,'r_1893',-1,'l'); % His model = changeRxnBounds(model,'r_1897',-1,'l'); % Ile model = changeRxnBounds(model,'r_1900',-1,'l'); % Lys model = changeRxnBounds(model,'r_1902',-1,'l'); % Met model = changeRxnBounds(model,'r_1903',-1,'l'); % Phe model = changeRxnBounds(model,'r_1911',-1,'l'); % Thr model = changeRxnBounds(model,'r_1912',-1,'l'); % Trp model = changeRxnBounds(model,'r_2090',-1,'l'); % Uracil model = changeRxnBounds(model,'r_1913',-1,'l'); % Tyr model = changeRxnBounds(model,'r_1914',-1,'l'); % Val model = changeRxnBounds(model,'r_1906',-1,'l'); % Ser %%% FVA serine reactions %%% % find reactions connected to serine (cytoplasmic, ER, extracellular, % mitochondrial, and ER membrane) serRxns = findRxnsFromMets(model,... {'s_1039[c_03]','s_1040[c_04]','s_1041[c_06]','s_1042[c_11]','s_3107[c_05]'}); % exclude intracellular transport reactions serRxns([19,21:24]) = []; % run FVA [vMin, vMax, optSol, ret, fbaSol, fvaMin, fvaMax, statusSolMin, ... statusSolMax] = fastFVA(model, 99, 'max', 'ibm_cplex', serRxns); % reaction names of the reactions as they will be displayed in the plot rxnNames = { 'cystathionine beta-synthase', ... 'glycine hydroxymethyltransferase 2', ... 'glycine hydroxymethyltransferase 1', ... 'L-serine deaminase', ... 'L-serine dehydrogenase', ... 'phosphoserine phosphatase', ... 'serine O-acetyltransferase', ... 'serine palmitotransferase', ... 'seryl-tRNA synthetase', ... 'tryptophan synthase', ... 'PS synthase', ... 'L-serine exchange' }; % combine all PS synthase reactions psFluxMin = min(sum(fvaMin(findRxnIDs(model,serRxns(11:18)),:))); psFluxMax = max(sum(fvaMax(findRxnIDs(model,serRxns(11:18)),:))); vMin = [vMin(1:10); psFluxMin; vMin(19)]; vMax = [vMax(1:10); psFluxMax; vMax(19)]; % change flux direction so that positive values always mean serine % production coefs = [-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1]'; vMin = vMin .* coefs; vMax = vMax .* coefs; % plot flux variability of serine reactions figure p = errorbar(1:12, mean([vMin';vMax']), vMin' - mean([vMin';vMax']), vMax' - mean([vMin';vMax'])); p.LineStyle = 'none'; p.LineWidth = 2; set(p,'Color','black') yline(0) xlim([0,13]) xticks(1:12) xticklabels(rxnNames) set(gca, 'XTickLabelRotation', -90) ylabel('fluxes [mmol/(gDW*h)]') %%% FVA serine synthesis and uptake %%% % vary serine uptake rates uptakeRates = 0:-0.1:-1; % prepare vectors for min and max values of fluxes fluxMin = zeros(size(uptakeRates)); fluxMax = zeros(size(uptakeRates)); % control variable index = 1; % perform FVA for each uptake rate for uptakeRate = uptakeRates % set serine uptake rate tmpModel = changeRxnBounds(model,'r_1906',uptakeRate, 'l'); % run FVA [tmpVMin, tmpVMax, tmpOptSol, tmpRet, tmpFbaSol, tmpFvaMin, tmpFvaMax]... = fastFVA(tmpModel, 99, 'max', 'ibm_cplex', [serRxns(2:3);serRxns(6)]'); % extract min and max fluxes from reactions of SHM1, SHM2 and SER2 tmpFvaMin = tmpFvaMin(findRxnIDs(tmpModel,[serRxns(2:3);serRxns(6)]'),:); tmpFvaMax = tmpFvaMax(findRxnIDs(tmpModel,[serRxns(2:3);serRxns(6)]'),:); % change flux direction so that positive values always mean serine % production coefs = [-1,-1,1]'; tmpFvaMin = tmpFvaMin .* coefs; tmpFvaMax = tmpFvaMax .* coefs; % combine reactions to one net reaction fluxMin(index) = min(sum(tmpFvaMin)); fluxMax(index) = max(sum(tmpFvaMax)); index = index + 1; end % plot flux variability of SHM1, SHM2 and SER2 combined figure p = errorbar(-uptakeRates, mean([fluxMin;fluxMax]), fluxMin - mean([fluxMin;fluxMax]), fluxMax - mean([fluxMin;fluxMax])); p.LineStyle = 'none'; p.LineWidth = 2; set(p,'Color','black') yline(0) xlim([-0.1,1.1]) xticks(-uptakeRates) ylabel('fluxes [mmol/(gDW*h)]') xlabel('serine uptake rate [mmol/(gDW*h)]') %%% SPT ACTIVITY %%% % vary serine uptake rates uptakeRates = 0:-0.1:-1; % prepare vectors for min and max values of fluxes fluxMin = zeros(size(uptakeRates)); fluxMax = zeros(size(uptakeRates)); % control variable index = 1; % perform FVA for each uptake rate for uptakeRate = uptakeRates % set serine uptake rate tmpModel = changeRxnBounds(model,'r_1906',uptakeRate, 'l'); % run FVA [tmpVMin, tmpVMax, tmpOptSol, tmpRet, tmpFbaSol, tmpFvaMin, tmpFvaMax]... = fastFVA(tmpModel, 99, 'max', 'ibm_cplex', serRxns(8)); % save min and max fluxes fluxMin(index) = tmpVMin; fluxMax(index) = tmpVMax; index = index + 1; end % plot flux variability of SPT figure p = errorbar(-uptakeRates, mean([fluxMin;fluxMax]), fluxMin - mean([fluxMin;fluxMax]), fluxMax - mean([fluxMin;fluxMax])); p.LineStyle = 'none'; p.LineWidth = 2; set(p,'Color','black') ylim([0,0.0003]) xlim([-0.1,1.1]) xticks(-uptakeRates) ylabel('fluxes [mmol/(gDW*h)]') xlabel('serine uptake rate [mmol/(gDW*h)]')