0001 eval(default('flag_save_graphics','0','flag_movies','0'));
0002
0003
0004
0005
0006
0007 if isempty(me_options.arrowvaluesmax),
0008 arrowvaluesmax = min(max(abs(res.v_proj)), 5* median(abs(res.v_proj)));
0009 else
0010 arrowvaluesmax = me_options.arrowvaluesmax;
0011 end
0012
0013 network_aug_CoHid.graphics_par.omitreactions = me_options.omitreactions;
0014 network_aug_CoSplit.graphics_par.omitreactions = me_options.omitreactions;
0015
0016 nk = length(kinetic_models);
0017 figure(1);
0018 netgraph_concentrations(network_aug_CoHid,res.covered_metabolites + 0.5*res.shared_metabolites, res.covered_reactions + 0.5*res.shared_reactions,1,struct('actprintnames',0, 'actstyle','fixed','arrowstyle','none','text_offset',me_options.text_offset,'showsign',0,'metvaluesmax',nk,'actvaluesmax',nk,'metvaluesmin',0,'actvaluesmin',0,'colormap',[1 1 1; copper],'single_arrow',1));
0019
0020 for it = 1:length(kinetic_models),
0021 my_external = nan * ones(length(network_aug.metabolites),1);
0022 my_external(res.mapping_metabolites{it}) = kinetic_models{it}.external;
0023 my_prod = nan * ones(length(network_aug.metabolites),1);
0024 my_prod(res.mapping_metabolites{it}) = kinetic_models{it}.N * res.v_stat{it};
0025 my_v = res.collect_v(:,it);
0026 my_c = res.collect_c(:,it);
0027
0028 figure(100+it); netgraph_concentrations(network_aug_CoHid, my_external,my_v,1,struct('arrowsize',me_options.arrowsize,'actstyle','none','text_offset',me_options.text_offset,'single_arrow',1));
0029 figure(110+it); netgraph_concentrations(network_aug_CoHid, my_prod,my_v,1,struct('arrowsize',me_options.arrowsize,'actstyle','none','text_offset',me_options.text_offset,'single_arrow',1));
0030 figure(120+it); netgraph_concentrations(network_aug_CoHid, double(isfinite(my_c)),double(isfinite(my_v)),1,struct('arrowstyle','none','text_offset',me_options.text_offset,'single_arrow',1));
0031 end
0032
0033 figure(2); netgraph_concentrations(network_aug_CoHid,network_aug.external,res.v_mean,1,struct('arrowvaluesmax',arrowvaluesmax,'arrowsize',me_options.arrowsize,'squaresize',me_options.squaresize,'actstyle','none','text_offset',me_options.text_offset,'single_arrow',1));
0034
0035 figure(3); netgraph_concentrations(network_aug_CoHid,network_aug.external,res.v_proj,1,struct('arrowvaluesmax',arrowvaluesmax,'arrowsize',me_options.arrowsize,'squaresize',me_options.squaresize,'actstyle','none','text_offset',me_options.text_offset,'single_arrow',1));
0036
0037 if flag_movies,
0038
0039 figure(203); set(gcf, 'Position', [120 150 700 850]);
0040 M = netgraph_flux_movie(network_aug_CoHid,network_aug.external,res.v_proj,1,struct('arrowvaluesmax',arrowvaluesmax,'arrowsize',me_options.arrowsize,'squaresize',me_options.squaresize,'actstyle','none','text_offset',me_options.text_offset,'metprintnames',0));
0041
0042
0043 figure(204); set(gcf, 'Position', [120 150 700 850]);
0044 [M2,T] = netgraph_movie(network_aug_CoHid,simulation.t,log(diag(1./simulation.C(:,end))*simulation.C),'concentrations',40,0);
0045
0046 end
0047
0048 figure(13); netgraph_concentrations(network_aug_CoHid,res.c_fix,[],1,struct('text_offset',me_options.text_offset,'single_arrow',1));
0049
0050 figure(14); netgraph_concentrations(network_aug_CoHid,[],res.dmu_fix,1,struct('text_offset',me_options.text_offset,'arrow_stoichiometries',0,'single_arrow',1));
0051
0052 for it = 1:length(kinetic_models),
0053 figure(200+it); netgraph_concentrations(network_aug_CoHid,res.collect_mu(:,it),[],1,struct('text_offset',me_options.text_offset,'arrow_stoichiometries',0,'single_arrow',1));
0054 end
0055
0056 figure(4); netgraph_concentrations(network_aug_CoHid,res.mu-min(res.mu),res.A,1,struct('arrowvaluesmax',max(abs(res.A)),'arrowsize',me_options.arrowsize,'squaresize',me_options.squaresize,'actstyle','none','text_offset',me_options.text_offset,'colormap',flipud(rb_colors),'single_arrow',1));
0057
0058 figure(5); netgraph_concentrations(network_aug_CoHid,res.c_combined,res.v_combined,1,struct('arrowvaluesmax',arrowvaluesmax,'arrowsize',me_options.arrowsize,'squaresize',me_options.squaresize,'actstyle','none','text_offset',me_options.text_offset,'single_arrow',1));
0059
0060 my_line_colors = rby_colors(size(simulation.C,1));
0061
0062 figure(6);
0063 h = plot(simulation.t,simulation.C);
0064 line_colors(h,my_line_colors);
0065 legend(network_combined.metabolites,'FontSize',me_options.legendFontsize);
0066 xlabel('Time'); ylabel('Concentration');
0067
0068 figure(7);
0069 if length(simulation_flat.t),
0070 h = plot(simulation_flat.t,simulation_flat.C);
0071 line_colors(h,my_line_colors);
0072 legend(network_flat.metabolites,'FontSize',me_options.legendFontsize);
0073 xlabel('Time'); ylabel('Concentration');
0074 else
0075 xlabel('No simulation available');
0076 end
0077
0078 figure(8);
0079 h = plot(simulation_local.t,simulation_local.C);
0080 line_colors(h,my_line_colors(res.mapping_metabolites{1},:));
0081 legend(kinetic_models{1}.metabolites,'FontSize',me_options.legendFontsize);
0082 xlabel('Time'); ylabel('Concentration');
0083
0084 figure(9);
0085 h = plot(simulation.t,simulation.C(res.mapping_metabolites{1},:));
0086 line_colors(h,my_line_colors(res.mapping_metabolites{1},:));
0087 legend(network_aug.metabolites(res.mapping_metabolites{1}),'FontSize',me_options.legendFontsize);
0088 xlabel('Time'); ylabel('Concentration');
0089
0090
0091
0092
0093
0094 if isempty(psfile_dir), flag_save_graphics=0; end
0095
0096 if flag_save_graphics,
0097
0098
0099
0100 cd(psfile_dir);
0101
0102 print embedding_kinetic_mapping.eps -f1 -depsc
0103 print embedding_kinetic_flux_kinetic.eps -f2 -depsc
0104 print embedding_kinetic_flux_network.eps -f3 -depsc
0105 print embedding_kinetic_thermo.eps -f4 -depsc
0106 print embedding_kinetic_result_state.eps -f5 -depsc
0107 print embedding_kinetic_integration.eps -f6 -depsc
0108 print embedding_kinetic_integration_flat.eps -f7 -depsc
0109 print embedding_kinetic_integration_isolated.eps -f8 -depsc
0110 print embedding_kinetic_integration_embedded.eps -f9 -depsc
0111
0112 for it = 1:length(kinetic_models),
0113 print(['embedding_kinetic_model_' num2str(it) '_fluxes.eps'],['-f' num2str(100+it)], '-depsc');
0114 print(['embedding_kinetic_model_' num2str(it) '_mapping.eps'],['-f' num2str(120+it)], '-depsc');
0115 end
0116
0117 display(sprintf('Saving graphics to directory %s',psfile_dir));
0118
0119
0120
0121 if flag_movies,
0122 cd(psfile_dir);
0123 movie_file = 'embedding_kinetic_movie';
0124 movie_save(movie_file,M)
0125 display(sprintf('Saving flux movie to file %s/%s.gif',psfile_dir,movie_file));
0126
0127 movie_file = 'embedding_kinetic_movie_perturbation';
0128 movie_save(movie_file,M2)
0129 display(sprintf('Saving flux movie to file %s/%s.gif',psfile_dir,movie_file));
0130 end
0131
0132 end
0133
0134
0135
0136
0137 figure(1); title('Kinetic models embedded');
0138 figure(2); title('Flux projection: predefined fluxes and external metabolites');
0139 figure(3); title('Flux projection: stationary fluxes and external metabolites');
0140 figure(13); title('Concentrations taken from kinetic models');
0141 figure(14); title('Fixed delta mu');
0142 for it = 1:length(kinetic_models),
0143 figure(200+it); title('Fixed chemical potentials mu');
0144 end
0145 figure(4); title('Chemical potentials (shifted to min=0) and reaction affinities');
0146 figure(5); title('Combined network: steady state concentrations and fluxes');
0147
0148 figure(6); title('Simulation of combined model');
0149 figure(7); title('Simulation of "flat" combined model');
0150 figure(8); title('Simulation of isolated kinetic model');
0151 figure(9); title('Simulation of embedded kinetic model');
0152
0153 for it = 1:length(kinetic_models),
0154 figure(100+it); title(sprintf('Embedded model %d: External metabolites and fluxes',it))
0155 figure(110+it); title(sprintf('Embedded model %d: Net production and fluxes',it))
0156 figure(120+it); title(sprintf('Embedded model %d: Subnetwork covered',it))
0157 end