Home > matlab > models > example_1 > embedding_example_1_make_model.m

embedding_example_1_make_model

PURPOSE ^

SYNOPSIS ^

function [model_name,kinetic_models,network,network_CoHid,me_options] = embedding_example_1_make_model(position_file,matlab_file)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [model_name,kinetic_models,network,network_CoHid,me_options] = embedding_example_1_make_model(position_file,matlab_file)
0002 
0003 eval(default('matlab_file','[]'));
0004 
0005 model_name = 'embedding_example_1';
0006 
0007 % --------------------------------------------------------------------------------
0008 % Small model, one submodel of type 'numeric' (rate law given in matlab function)
0009 
0010 % --------------------------------------------------------------------------------
0011 % make small pathway model 'kinetic_model' with kinetics of type 'numeric'
0012 
0013 N            = [-1 0 0; 1 -1 0; 0 1 -1; 0 0 1]; 
0014 reversible   = [1 1 1]';
0015 ind_external = [1 3 4]';
0016 metabolites  = {'X1','A1','B1','C1'}'; 
0017 actions      = {'R0','R1','R2'}'; 
0018 
0019 kinetic_model = network_construct(N,reversible,ind_external,metabolites,actions);
0020 kinetic_model.metabolite_id = {'id_X1','id_A1','id_B1','id_C1'}'; 
0021 kinetic_model.reaction_id   = {'id_R0','id_R1','id_R2'}'; 
0022 
0023 kinetic_model.kinetics.type              = 'numeric';
0024 kinetic_model.kinetics.velocity_function = @embedding_example_1_velocities;
0025 kinetic_model.kinetics.parameters        = struct;
0026 kinetic_model.s_init                     = [4 3 2 1.75]';
0027 
0028 
0029 % --------------------------------------------------------------------------------
0030 % make surrounding network model 'network', with kinetics of type 'cs'
0031 
0032 N            = [-1 0 0 0; 1 -1 -1 0; 0 1 0 -1; 0 0 1 1]; 
0033 reversible   = [1 1 1 1]';
0034 ind_external = [1 4]';
0035 metabolites  = {'A1','B1','C1','biomass'}'; 
0036 actions      = {'R1','R2','R3','R4'}'; 
0037 
0038 network = network_construct(N,reversible,ind_external,metabolites,actions);
0039 network.kinetics = set_kinetics(network,'cs');
0040 network.metabolite_id = {'id_A1','id_B1','id_C1','id_biomass'}';
0041 network.reaction_id   = {'id_R1','id_R2','id_R3','id_R4'}';    
0042 
0043 network = netgraph_make_graph(network);
0044 network = netgraph_read_positions(network,position_file,[0,0],1,0);
0045 
0046 % netgraph_edit_positions(network,position_file,0);
0047 
0048 network.reaction_names = network.actions;
0049 
0050 % --------------------------------------------------------------------------------
0051 % ids for mapping the models
0052 % which name fields should be used for mapping the elements?
0053 
0054 id.metabolites_network        = 'metabolite_id';
0055 id.metabolites_kinetic_models = {'metabolite_id'};
0056 id.reactions_network          = 'reaction_id';
0057 id.reactions_kinetic_models   = {'reaction_id'};
0058 
0059 % --------------------------------------------------------------------------------
0060 
0061 fba_constraints       = fba_default_options(network);
0062 fba_constraints.zv    = [0 0 1 1 0]';
0063 fba_constraints.v_fix = nan * ones(size(network.actions));
0064 
0065 
0066 % --------------------------------------------------------------------------------
0067 % save
0068 
0069 kinetic_models = {kinetic_model};
0070 
0071 network_CoHid = network;
0072 
0073 % --------------------------------------------------------------------------------
0074 
0075 me_options.id                   = id;
0076 me_options.enforce_stationarity = 0;
0077 me_options.arrowsize            = 0.1;
0078 me_options.squaresize           = 0.1;
0079 me_options.text_offset          = [0.05,0.02];
0080 me_options.arrowvaluesmax       = 1.2;
0081 me_options.legendFontsize       = 8;
0082 me_options.position_file        = position_file;
0083 
0084 me_options.c_init               = [0.01 0.01 0.01 0.01 1]';
0085 me_options.Tmax                 = 5;
0086 
0087 if length(matlab_file),
0088   save(matlab_file,'kinetic_models','network','network_CoHid','me_options');
0089 end

Generated on Fri 12-Feb-2016 20:05:51 by m2html © 2003