ourMELONS/matlab/graph/viewUnrooted.m

62 lines
1.8 KiB
Mathematica
Raw Normal View History

2019-12-16 16:47:21 +01:00
function viewUnrooted(action)
% VIEWUNROOTED function to called by VIEWNJ to draw unrooted
% neighbor-joining trees
handle = gcf;
h0 = findobj(handle,'Tag','attr_menu');
g = get(h0,'Userdata');
g.visualtype = action;
set(h0,'Userdata',g); % store in the attribute menu
cla reset
axis off
% close(g.handle);
% h0 = figure('NumberTitle','off');
% g.handle = h0;
% set(h0,'menubar','none','toolbar','figure');
% set(h0,'Tag','nj_plot');
% set(h0,'Name',['Neighbor-Joining tree - ' g.filename]);;
if strcmp(g.type,'NJ')
t = seqNeighJoin(g.D, 'equivar', g.varnames);
else
t = seqlinkage(g.D, 'average', g.varnames);
end
switch action
case 'radial'
% plotNJ(g.D, 1, char(g.varnames));
Plot(t,'type','radial');
case 'phylogram'
% plotNJ(g.D, 0, char(g.varnames));
plotPhytree(t);
end
% h1 = uimenu('Parent',handle, ...
% 'Label','Attributes', ...
% 'Tag','attr_menu');
% h2 = uimenu('Parent',h1, ...
% 'Label','Rename clusters', ...
% 'callback', 'plotflow rename', ...
% 'Tag','clustername_menu');
% h2 = uimenu('Parent',h1, ...
% 'Label','Visual type', ...
% 'Tag','visualtype_menu');
% h3 = uimenu('Parent',h2, ...
% 'Label','Square', ...
% 'callback', 'viewDendrogram(''square'')', ...
% 'Tag','viewsquare_menu');
% h3 = uimenu('Parent',h2, ...
% 'Label','Angular', ...
% 'callback', 'viewDendrogram(''angular'')', ...
% 'Tag','viewangular_menu');
% h3 = uimenu('Parent',h2, ...
% 'Label','Radial', ...
% 'callback', 'viewUnrooted(''radial'')', ...
% 'Tag','viewradial_menu');
% h3 = uimenu('Parent',h2, ...
% 'Label','Phylogram', ...
% 'callback', 'viewUnrooted(''phylogram'')', ...
% 'Tag','viewphylogram_menu');
% set(h1,'Userdata',g); % store in the attribute menu