netgraph_make_graph.m

来自「%The Metabolic Networks Toolbox contains」· M 代码 · 共 83 行

M
83 行
字号
% network = netgraph_make_graph(network,metvalues,actvalues);%% create or modify structure describing the graphical appearance of a metabolic networkfunction network = netgraph_make_graph(network,metvalues,actvalues);gridsize = 0.01; % distance between discrete x valuesk1 = 0.1;  % overall repulsion strengthk2 = 0.01;  % overall repulsion scalek3 = 0.5;  % neighbour attraction strengthk4 = 0.1;  % neighbour attraction scaleif ~exist('metvalues','var'),  metvalues = -ones(length(network.metabolites),1); endif ~exist('actvalues','var'),  actvalues = ones(length(network.actions),1);     end% metnames = break_names(network.metabolites);% actnames = break_names(network.actions);metnames = strrep(network.metabolites,'_',' ');actnames = strrep(network.actions,'_',' ');metnames = strrep(metnames,'Compartment ','');metnames = strrep(metnames,'Cell ','');metnames = strrep(metnames,'Compound ','');metnames = strrep(metnames,'Enzyme ','');metnames = strrep(metnames,'PseudoBioObj ','');metnames = strrep(metnames,'  ',' ');actnames = strrep(actnames,'PseudoBioObj.','');actnames = strrep(actnames,'Enzyme.','');graphics_object.metvalues      = metvalues; graphics_object.actvalues      = actvalues;graphics_object.arrowvalues    = actvalues;% if ~isfield(graphics_object,'metvalues_std'), graphics_object.metvalues_std  = 0*metvalues; end% if ~isfield(graphics_object,'actvalues_std'), graphics_object.actvalues_std  = 0*actvalues; endgraphics_object.metstyle       = 'box'; % , 'box', 'diamond', 'none'graphics_object.metcolstyle    = 'values'; % 'fixed'graphics_object.metcol         = 'c';  % used if metcolstyle ==  'fixed'graphics_object.metprintnames  = 1;graphics_object.metprintvalues = 0;graphics_object.metnames       = metnames;graphics_object.actstyle       = 'box'; % , 'box', 'diamond' 'none'graphics_object.actcolstyle    = 'values'; % 'fixed'graphics_object.actcol         = 'r'; % used if actcolstyle ==  'fixed'graphics_object.actprintnames  = 1;graphics_object.actprintvalues = 0;graphics_object.actnames       = actnames;graphics_object.arrowstyle     = 'directions';  % 'fluxes', 'none'graphics_object.squaresize     = 0.2/sqrt(length(metnames));graphics_object.arrowsize      = 0.08/sqrt(length(metnames));graphics_object.lambda         = 1;graphics_object.N              = network.N;graphics_object.metabolite_mapping = (1:length(metnames))';% adjacency matrix between metabolites and reactions m = [zeros(length(network.metabolites)) network.N; network.N' zeros(length(network.actions))];m = (m~=0);m = m-diag(diag(m));db = graph_shortest_path(m,4,0);db(find(~isfinite(db)))=5; if isfield(network,'regulation_matrix'),   graphics_object.m_regulation = [zeros(length(network.metabolites)) network.regulation_matrix'; network.regulation_matrix zeros(length(network.actions))];endgraphics_object.m  = m;graphics_object.db = db;% --- calculate graph node positions xx = netgraph_find_x(graphics_object,gridsize,k1,k2,k3,k4);graphics_object.x = x;graphics_object.fixed = zeros(size(x,2),1);network.graphics_par = graphics_object;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?