Created
November 25, 2017 19:26
-
-
Save laurentheirendt/0820ecc4613d5d8b0bdba09221890fef to your computer and use it in GitHub Desktop.
Example for FVA in R2017a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initCobraToolbox | |
% Input the E.coli core model | |
model = readCbModel('ecoli_core_model.mat'); | |
model = changeRxnBounds(model,'EX_glc(e)',0,'l'); | |
model = changeRxnBounds(model,'EX_succ(e)',-20,'l'); | |
% Set objective function | |
model = changeObjective(model,'EX_etoh(e)'); | |
% model = changeObjective(model,'Biomass_Ecoli_core_N(w/GAM)_Nmet2'); | |
% set the solver | |
changeCobraSolver('ibm_cplex') | |
% Perform flux variability analysis | |
[minFlux,maxFlux]=fluxVariability(model,100,'max',model.rxns); | |
% Print flux values | |
Difference = abs(maxFlux - minFlux); | |
FluxDifference = Difference; | |
n = length(Difference); | |
for i=1:n | |
if Difference(i) < 0.0001 | |
FluxDifference(i) = 0; | |
end | |
end | |
printFluxVector(model, [minFlux, maxFlux, FluxDifference],true) | |
% printFluxVector(model, [minFlux, maxFlux, FluxDifference]) % print all reactions | |
% Save flux variability map | |
map=readCbMap('ecoli_Textbook_ExportMap'); | |
% Please note: drawFluxVariability will be deprecated | |
%drawFluxVariability(map,model,minFlux,maxFlux) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment