function baps5(varargin) % This is the machine-generated representation of a Handle Graphics object % and its children. Note that handle values may change when these objects % are re-created. This may cause problems with any callbacks written to % depend on the value of the handle at the time the object was saved. % % To reopen this object, just type the name of the M-file at the MATLAB % prompt. The M-file and its associated MAT-file must be on your path. % NEW: script version was added. 09.07.2007 % Script function has been added by Lu Cheng, 11.03.2010 % The script function is designed for semi-supervised clustering in the % trained clustering module, it adopts a codon linkage model for the DNA % sequence data % The calling command: baps5 -semi script_file global PARAMETERS; PARAMETERS = []; global SCRIPT_MODE; SCRIPT_MODE = []; if nargin == 1 % script version readScript(varargin{1}); return else if nargin==2 %----------------added by Lu Cheng, 11.03.2010 if isequal(varargin{1},'-semi'); script_file = varargin{2}; PARAMETERS = semiReadScript(script_file); SCRIPT_MODE = true; trainedMix SCRIPT_MODE = []; PARAMETERS = []; else disp(cat(2,'Unknown option: ',varargin{1})); end return %--------------------------------------------- end end % load baps4 % Base frame h0 = figure('Color',[0.8 0.8 0.8], ... 'MenuBar','none', ... 'Position',[364 175 750 500], ... 'Resize','on', ... 'Tag','base_figure',... 'Name','Bayesian Analysis of Population Structure',... 'NumberTitle','off',... 'Color',[.7 .9 .7]); % File menu h1 = uimenu('Parent',h0, ... 'Label','File', ... 'Tag','file_menu'); h2 = uimenu('Parent',h1, ... 'Label','Load Result', ... 'Tag','load_menu'); h3 = uimenu('Parent',h2, ... 'Callback','baps4cbf load_mixture_menu', ... 'Label','Mixture result', ... 'Tag','mixture_menu'); h3 = uimenu('Parent',h2, ... 'Callback','baps4cbf load_spatial_menu', ... 'Label','Spatial mixture result', ... 'Tag','spatialmixture_menu'); h3 = uimenu('Parent',h2, ... 'Callback','baps4cbf load_admixture_menu', ... 'Label','Admixture result', ... 'Tag','admixture_menu'); h2 = uimenu('Parent',h1, ... 'Enable','on',... 'Label','Compare Results', ... 'Tag','compare_menu'); h3 = uimenu('Parent',h2, ... 'Callback','baps4cbf compare_menu', ... 'Label','Mixture results', ... 'Tag','compare_menu'); h3 = uimenu('Parent',h2, ... 'Callback','baps4cbf compare_admix_menu', ... 'Label','AdMixture results', ... 'Tag','compare_admix_menu'); h2 = uimenu('Parent',h1, ... 'Enable','off',... 'Callback','baps4cbf close_menu', ... 'Label','Close Results', ... 'Tag','close_menu'); h2 = uimenu('Parent',h1, ... 'Label','Output File', ... 'Tag','output_menu'); h3 = uimenu('Parent',h2, ... 'Callback','baps4cbf output_menu', ... 'Label','Set', ... 'Tag','set_menu'); h3 = uimenu('Parent',h2, ... 'Callback','baps4cbf remove_outputfile_menu', ... 'Label','Remove', ... 'Tag','remove_menu'); h2 = uimenu('Parent',h1, ... 'Callback','baps4cbf exit_menu', ... 'Label','Exit', ... 'Tag','exit_menu'); % Distances menu h1 = uimenu('Parent',h0, ... 'Enable','off',... 'Label','Distances', ... 'Tag','distances_menu'); h2 = uimenu('Parent',h1, ... 'Callback','baps4cbf calculate_kl', ... 'Label','KL distance', ... 'Tag','kl_menu'); h2 = uimenu('Parent',h1, ... 'Callback','baps4cbf calculate_nei', ... 'Label','Nei distance', ... 'Tag','nei_menu'); h2 = uimenu('Parent',h1, ... 'Callback','baps4cbf calculate_hamming', ... 'Label','Hamming distance', ... 'Tag','hamming_menu'); % Graph menu h1 = uimenu('Parent',h0, ... 'Enable','off', ... 'Label','Graph', ... 'Tag','graph_menu'); h2 = uimenu('Parent',h1, ... 'Enable','off', ... 'Callback','baps4cbf plot_coordinates_menu', ... 'Label','Plot Coordinates', ... 'Tag','plot_coordinates_menu'); h2 = uimenu('Parent',h1, ... 'Enable','off', ... 'Callback','baps4cbf partitio_menu', ... 'Label','View Partition', ... 'Tag','partitio_menu'); h2 = uimenu('Parent',h1, ... 'Enable','off', ... 'Callback','baps4cbf admix_menu', ... 'Label','View Admixture Results', ... 'Tag','admix_menu'); h2 = uimenu('Parent',h1, ... 'Enable','off', ... 'Callback','baps4cbf likelihood_menu', ... 'Label','Changes of Log Likelihood', ... 'Tag','likelihood_menu'); h2 = uimenu('Parent',h1, ... 'Enable','off', ... 'Callback','baps4cbf energy_menu', ... 'Label','Energy landscape', ... 'Tag','energy_menu'); h2 = uimenu('Parent',h1, ... 'Enable','off', ... 'Callback','baps4cbf geneflow_menu', ... 'Label','Plot Gene Flow', ... 'Tag','geneflow_menu'); h2 = uimenu('Parent',h1, ... 'Enable','off', ... 'Callback','baps4cbf voronoi_menu', ... 'Label','Voronoi Tessellation', ... 'Tag','voronoi_menu'); h2 = uimenu('Parent',h1, ... 'Enable','off', ... 'Callback','baps4cbf varmuus_menu', ... 'Label','Local Uncertainty', ... 'Tag','varmuus_menu'); h2 = uimenu('Parent',h1, ... 'Enable','off', ... 'Callback','baps4cbf phylogeny_menu', ... 'Label','Phylogeny', ... 'Tag','phylogeny_menu'); h3 = uimenu('Parent',h2, ... 'Enable','off', ... 'Callback','baps4cbf upgma_menu',... 'Label', 'UPGMA', ... 'Tag','upgma_menu'); h3 = uimenu('Parent',h2, ... 'Enable','off', ... 'Callback','baps4cbf nj_menu',... 'Label', 'Neighbor-Joining', ... 'Tag','nj_menu'); h2 = uimenu('Parent',h1, ... 'Enable','off', ... 'Callback','baps4cbf mutationplot_menu', ... 'Label','Mutation Plot', ... 'Tag','mutationplot_menu'); % Tools menu h1 = uimenu('Parent',h0, ... 'Label','Tools', ... 'Tag','tools_menu'); h2 = uimenu('Parent',h1, ... 'Callback','baps4cbf fixk_menu', ... 'Label','Enable Fixed-K Clustering', ... 'Tag','fixk_menu', ... 'Userdata', 0); h2 = uimenu('Parent',h1, ... 'Callback','baps4cbf partitioncompare_menu', ... 'Label','Partition Compare', ... 'Tag','partitioncompare_menu', ... 'Userdata', []); h2 = uimenu('Parent',h1, ... 'Callback','baps4cbf loadfigure_menu', ... 'Label','Load Figure', ... 'Tag','loadfigure_menu'); h2 = uimenu('Parent',h1, ... 'Callback','baps4cbf changecolor_menu',... 'Label', 'Change BAPS Color', ... 'Tag','changecolor_menu'); % Help menu h1 = uimenu('Parent',h0, ... 'Label','Help', ... 'Tag','help_menu'); h2 = uimenu('Parent',h1, ... 'Callback','baps4cbf helpdoc', ... 'Enable','on', ... 'Label','Help contents (doc)', ... 'Tag','helpman_menu'); h2 = uimenu('Parent',h1, ... 'Callback','baps4cbf helponline', ... 'Enable','on', ... 'Label','BAPS on the web', ... 'Tag','online_menu'); h2 = uimenu('Parent',h1, ... 'Callback','baps4cbf about', ... 'Enable','on', ... 'Label','About', ... 'Tag','about_menu'); % uicontrol h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.82 0.82 0.77], ... 'ListboxTop',0, ... 'Position',[38.25 154.268575851393 381 148.721320743034], ... 'Style','frame', ... 'Tag','mix_frame'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.82 0.82 0.77], ... 'ListboxTop',0, ... 'Position',[38.25 56 381 79.721320743034], ... 'Style','frame', ... 'Tag','admix_frame'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.82 0.82 0.77], ... 'ListboxTop',0, ... 'Position',[156.75 279.545624148607 158 11.9465944272446], ... 'String','Population mixture analysis', ... 'Style','text', ... 'Tag','mix_text'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[0.82 0.82 0.77], ... 'ListboxTop',0, ... 'Position',[156.75 111.545624148607 138 11.9465944272446], ... 'String','Population admixture analysis', ... 'Style','text', ... 'Tag','admix_text'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'Callback','baps4cbf mix1_button', ... 'ListboxTop',0, ... 'Position',[51.75 245.412497213622 163.5 22.7554179566563], ... 'String','Clustering of individuals', ... 'Tag','mix1_button'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'Callback','baps4cbf mix2_button', ... 'ListboxTop',0, ... 'Position',[51.75 212.75 163.5 23.25], ... 'String','Clustering of groups of individuals', ... 'Tag','mix2_button'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'Callback','baps4cbf trained_button', ... 'ListboxTop',0, ... 'Position',[51.75 178.284055727554 163.5 22.7554179566563], ... 'String','Trained clustering', ... 'Tag','trained_button'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'Callback','baps4cbf admix1_button', ... 'ListboxTop',0, ... 'Position',[51.7 75.412497213622 163.5 22.7554179566563], ... 'String','Admixture based on mixture clustering', ... 'Tag','admix1_button'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'Callback','baps4cbf admix2_button', ... 'ListboxTop',0, ... 'Position',[245.75 75.412497213622 163.5 22.7554179566563], ... 'String','Admixture based on pre-defined populations', ... 'Tag','admix2_button'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[.7 .9 .7], ... 'FontSize',10, ... 'HorizontalAlignment','left', ... 'ListboxTop',0, ... 'Position',[36 28.5 100.75 14.25], ... 'String','Data File:', ... 'Style','text', ... 'Tag','datafile_text'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[.7 .9 .7], ... 'FontSize',10, ... 'HorizontalAlignment','left', ... 'ListboxTop',0, ... 'Position',[36 9.75 51 14.25], ... 'String','Output File:', ... 'Style','text', ... 'Tag','outputfile_text'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[.7 .9 .7], ... 'FontSize',10, ... 'HorizontalAlignment','left', ... 'ListboxTop',0, ... 'Position',[140.75 28.5 314.5 14.25], ... 'Style','text', ... 'Tag','filename1_text'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'BackgroundColor',[.7 .9 .7], ... 'FontSize',10, ... 'HorizontalAlignment','left', ... 'ListboxTop',0, ... 'Position',[93.75 9.75 314.5 14.25], ... 'Style','text', ... 'Tag','filename2_text'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'Callback','baps4cbf spatial_button', ... 'ListboxTop',0, ... 'Position',[245.75 245.412497213622 163.5 22.7554179566563], ... 'String','Spatial clustering of individuals', ... 'Tag','spatial_button'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'Callback','baps4cbf spatial2_button', ... 'ListboxTop',0, ... 'Position',[245.75 212.75 163.5 23.25], ... 'String','Spatial clustering of groups', ... 'Tag','spatial2_button'); h1 = uicontrol('Parent',h0, ... 'Units','points', ... 'Callback','baps4cbf linkage_button', ... 'ListboxTop',0, ... 'Position',[245.75 178.284055727554 163.5 23.25], ... 'String','Clustering with linked loci', ... 'Tag','linkage_button'); % Starting text in the log window: disp('**********************************************************'); disp('********************** BAPS 6.0 *************************'); disp('**********************************************************'); disp(' '); disp('Closing this window will end the execution of the program.'); disp('However, it is recommended that you use ''Exit'' on the ''File'''); disp('menu of the main window or use the close-button in the upper'); disp('right-hand corner of the main window to exit the program.'); disp(' '); if strcmp(computer,'PCWIN') || strcmp(computer,'PCWIN64') if nargout > 0, fig = h0; end drawnow % seticon(h0, ['baps5.ico']); end % uimenufcn(gcf,'WindowCommandWindow')