Home > src > create2samplettest_Dialog.m

create2samplettest_Dialog

PURPOSE ^

- create 2-sample t-test dialog

SYNOPSIS ^

function varargout = create2samplettest_Dialog(varargin)

DESCRIPTION ^

 - create 2-sample t-test dialog

 copyright 2009-2012 Blair Armstrong, Christine Watson, David Plaut

    This file is part of SOS

    SOS is free software: you can redistribute it and/or modify
    it for academic and non-commercial purposes
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.  For commercial or for-profit
    uses, please contact the authors (sos@cnbc.cmu.edu).

    SOS is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % - create 2-sample t-test dialog
0002 %
0003 % copyright 2009-2012 Blair Armstrong, Christine Watson, David Plaut
0004 %
0005 %    This file is part of SOS
0006 %
0007 %    SOS is free software: you can redistribute it and/or modify
0008 %    it for academic and non-commercial purposes
0009 %    under the terms of the GNU General Public License as published by
0010 %    the Free Software Foundation, either version 3 of the License, or
0011 %    (at your option) any later version.  For commercial or for-profit
0012 %    uses, please contact the authors (sos@cnbc.cmu.edu).
0013 %
0014 %    SOS is distributed in the hope that it will be useful,
0015 %    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 %    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 %    GNU General Public License for more details.
0018 
0019 %    You should have received a copy of the GNU General Public License
0020 %    along with SOS (see COPYING.txt).
0021 %    If not, see <http://www.gnu.org/licenses/>.
0022 
0023 
0024 
0025 function varargout = create2samplettest_Dialog(varargin)
0026 % CREATE2SAMPLETTEST_DIALOG M-file for create2samplettest_Dialog.fig
0027 %      CREATE2SAMPLETTEST_DIALOG, by itself, creates a new CREATE2SAMPLETTEST_DIALOG or raises the existing
0028 %      singleton*.
0029 %
0030 %      H = CREATE2SAMPLETTEST_DIALOG returns the handle to a new CREATE2SAMPLETTEST_DIALOG or the handle to
0031 %      the existing singleton*.
0032 %
0033 %      CREATE2SAMPLETTEST_DIALOG('CALLBACK',hObject,eventData,handles,...) calls the local
0034 %      function named CALLBACK in CREATE2SAMPLETTEST_DIALOG.M with the given input arguments.
0035 %
0036 %      CREATE2SAMPLETTEST_DIALOG('Property','Value',...) creates a new CREATE2SAMPLETTEST_DIALOG or raises the
0037 %      existing singleton*.  Starting from the left, property value pairs are
0038 %      applied to the GUI before create2samplettest_Dialog_OpeningFcn gets called.  An
0039 %      unrecognized property name or invalid value makes property application
0040 %      stop.  All inputs are passed to create2samplettest_Dialog_OpeningFcn via varargin.
0041 %
0042 %      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
0043 %      instance to run (singleton)".
0044 %
0045 % See also: GUIDE, GUIDATA, GUIHANDLES
0046 
0047 % Edit the above text to modify the response to help create2samplettest_Dialog
0048 
0049 % Last Modified by GUIDE v2.5 13-Aug-2011 22:59:24
0050 
0051 % Begin initialization code - DO NOT EDIT
0052 gui_Singleton = 1;
0053 gui_State = struct('gui_Name',       mfilename, ...
0054                    'gui_Singleton',  gui_Singleton, ...
0055                    'gui_OpeningFcn', @create2samplettest_Dialog_OpeningFcn, ...
0056                    'gui_OutputFcn',  @create2samplettest_Dialog_OutputFcn, ...
0057                    'gui_LayoutFcn',  [] , ...
0058                    'gui_Callback',   []);
0059 if nargin && ischar(varargin{1})
0060     gui_State.gui_Callback = str2func(varargin{1});
0061 end
0062 
0063 if nargout
0064     [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0065 else
0066     gui_mainfcn(gui_State, varargin{:});
0067 end
0068 % End initialization code - DO NOT EDIT
0069 
0070 
0071 % --- Executes just before create2samplettest_Dialog is made visible.
0072 function create2samplettest_Dialog_OpeningFcn(hObject, eventdata, handles, varargin)
0073 % This function has no output args, see OutputFcn.
0074 % hObject    handle to figure
0075 % eventdata  reserved - to be defined in a future version of MATLAB
0076 % handles    structure with handles and user data (see GUIDATA)
0077 % varargin   command line arguments to create2samplettest_Dialog (see VARARGIN)
0078 
0079 % Choose default command line output for create2samplettest_Dialog
0080 handles.output = hObject;
0081 
0082 % Update handles structure
0083 guidata(hObject, handles);
0084 
0085 % UIWAIT makes create2samplettest_Dialog wait for user response (see UIRESUME)
0086 % uiwait(handles.figure_create2samplettest_Dialog);
0087 
0088 
0089 % --- Outputs from this function are returned to the command line.
0090 function varargout = create2samplettest_Dialog_OutputFcn(hObject, eventdata, handles) 
0091 % varargout  cell array for returning output args (see VARARGOUT);
0092 % hObject    handle to figure
0093 % eventdata  reserved - to be defined in a future version of MATLAB
0094 % handles    structure with handles and user data (see GUIDATA)
0095 
0096 % Get default command line output from handles structure
0097 varargout{1} = handles.output;
0098 
0099 
0100 
0101 function edit_name_Callback(hObject, eventdata, handles)
0102 % hObject    handle to edit_name (see GCBO)
0103 % eventdata  reserved - to be defined in a future version of MATLAB
0104 % handles    structure with handles and user data (see GUIDATA)
0105 
0106 % Hints: get(hObject,'String') returns contents of edit_name as text
0107 %        str2double(get(hObject,'String')) returns contents of edit_name as a double
0108     validate_name(handles);
0109     
0110 
0111 function flag = validate_name(handles)
0112 
0113     varName = get(handles.edit_name,'String');
0114     
0115     %check to make sure that the name is a valid variable name:
0116     valid = regexp(varName,'^[a-zA-Z]+\w*$', 'once');
0117     
0118     if isempty(valid)
0119         % name is not currently valid, tell the user.
0120         msgbox('Only letters, numbers, and underscores are permitted in the name of the ttest object.  The first character must also be a letter.',...
0121                 'Invalid name!');
0122         flag = false;
0123     else
0124         % check to make sure that the new variable name doesn't already exist.
0125         command = strcat('whos(''',varName,''')');
0126         varExists = evalin('base',command);
0127 
0128 
0129         % if a variable with this name already exists, warns the user
0130         if isempty(varExists) == 0
0131             msgbox('A variable with this name already exists and will be overridden if you continue',...
0132                     'Variable name already in use!');
0133         end
0134         
0135         flag = true;
0136     end
0137     
0138     
0139 
0140 % --- Executes during object creation, after setting all properties.
0141 function edit_name_CreateFcn(hObject, eventdata, handles)
0142 % hObject    handle to edit_name (see GCBO)
0143 % eventdata  reserved - to be defined in a future version of MATLAB
0144 % handles    empty - handles not created until after all CreateFcns called
0145 
0146 % Hint: edit controls usually have a white background on Windows.
0147 %       See ISPC and COMPUTER.
0148 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0149     set(hObject,'BackgroundColor','white');
0150 end
0151 
0152 
0153 % --- Executes on selection change in popupmenu_sample1Selector.
0154 function popupmenu_sample1Selector_Callback(hObject, eventdata, handles)
0155 % hObject    handle to popupmenu_sample1Selector (see GCBO)
0156 % eventdata  reserved - to be defined in a future version of MATLAB
0157 % handles    structure with handles and user data (see GUIDATA)
0158 
0159 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_sample1Selector contents as cell array
0160 %        contents{get(hObject,'Value')} returns selected item from popupmenu_sample1Selector
0161     populateSampleList(hObject);
0162 
0163 
0164 function populateSampleList(hObject)    
0165     % get a list of all populations in the base workspace:
0166     vars = evalin('base','whos()');
0167     
0168     samples = [];
0169     for i=1:length(vars)
0170         if strcmp(vars(i).class,'sample')
0171             samples = [samples; {vars(i).name}]; %#ok<AGROW>
0172         end
0173     end
0174     
0175     
0176     
0177     % assign that list to the options in the pop up menu
0178     warning('off','MATLAB:hg:uicontrol:ParameterValuesMustBeValid');    
0179     set(hObject,'String',samples); 
0180 
0181 % --- Executes during object creation, after setting all properties.
0182 function popupmenu_sample1Selector_CreateFcn(hObject, eventdata, handles)
0183 % hObject    handle to popupmenu_sample1Selector (see GCBO)
0184 % eventdata  reserved - to be defined in a future version of MATLAB
0185 % handles    empty - handles not created until after all CreateFcns called
0186 
0187 % Hint: popupmenu controls usually have a white background on Windows.
0188 %       See ISPC and COMPUTER.
0189 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0190     set(hObject,'BackgroundColor','white');
0191 end
0192 
0193 
0194 % --- Executes on button press in pushbutton_refreshSample1List.
0195 function pushbutton_refreshSample1List_Callback(hObject, eventdata, handles)
0196 % hObject    handle to pushbutton_refreshSample1List (see GCBO)
0197 % eventdata  reserved - to be defined in a future version of MATLAB
0198 % handles    structure with handles and user data (see GUIDATA)
0199     populateSampleList(handles.popupmenu_sample1Selector);
0200 
0201 % --- If Enable == 'on', executes on mouse press in 5 pixel border.
0202 % --- Otherwise, executes on mouse press in 5 pixel border or over popupmenu_sample1Selector.
0203 function popupmenu_sample1Selector_ButtonDownFcn(hObject, eventdata, handles)
0204 % hObject    handle to popupmenu_sample1Selector (see GCBO)
0205 % eventdata  reserved - to be defined in a future version of MATLAB
0206 % handles    structure with handles and user data (see GUIDATA)
0207     populateSampleList(hObject);
0208 
0209 
0210 % --- Executes on selection change in popupmenu_sample1ColSelector.
0211 function popupmenu_sample1ColSelector_Callback(hObject, eventdata, handles)
0212 % hObject    handle to popupmenu_sample1ColSelector (see GCBO)
0213 % eventdata  reserved - to be defined in a future version of MATLAB
0214 % handles    structure with handles and user data (see GUIDATA)
0215     populateColumnList(hObject,handles.popupmenu_sample1Selector);
0216 
0217 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_sample1ColSelector contents as cell array
0218 %        contents{get(hObject,'Value')} returns selected item from popupmenu_sample1ColSelector
0219 function populateColumnList(hObject,sampleSelector)    
0220     % get a list of all populations in the base workspace:
0221 
0222     create = true;
0223     
0224     % get the sample in the first list.
0225     sampleMenuHandle = sampleSelector;
0226     sampleName = getdfName(sampleMenuHandle,'sample 1');    
0227     
0228     if isempty(sampleName)
0229         create = false;
0230     end
0231     
0232     if create == true
0233         % add in all of the header names associated with that sample.
0234         tmpColNames = evalin('base',[sampleName,'.header']);
0235         
0236         % melt and refreeze cells
0237         colNames = {};
0238         
0239         for i=1:length(tmpColNames)
0240             colNames = [colNames ; tmpColNames{i}]; %#ok<AGROW>
0241         end
0242         
0243     
0244     % assign that list to the options in the pop up menu
0245         warning('off','MATLAB:hg:uicontrol:ParameterValuesMustBeValid');    
0246         set(hObject,'String',colNames);
0247     end
0248 
0249 % --- Executes during object creation, after setting all properties.
0250 function popupmenu_sample1ColSelector_CreateFcn(hObject, eventdata, handles)
0251 % hObject    handle to popupmenu_sample1ColSelector (see GCBO)
0252 % eventdata  reserved - to be defined in a future version of MATLAB
0253 % handles    empty - handles not created until after all CreateFcns called
0254 
0255 % Hint: popupmenu controls usually have a white background on Windows.
0256 %       See ISPC and COMPUTER.
0257 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0258     set(hObject,'BackgroundColor','white');
0259 end
0260 
0261 
0262 % --- Executes on button press in pushbutton_refreshsample1ColSelector.
0263 function pushbutton_refreshsample1ColSelector_Callback(hObject, eventdata, handles)
0264 % hObject    handle to pushbutton_refreshsample1ColSelector (see GCBO)
0265 % eventdata  reserved - to be defined in a future version of MATLAB
0266 % handles    structure with handles and user data (see GUIDATA)
0267     populateColumnList(handles.popupmenu_sample1ColSelector,handles.popupmenu_sample1Selector);
0268 
0269 
0270 % --- Executes on selection change in popupmenu_sample2Selector.
0271 function popupmenu_sample2Selector_Callback(hObject, eventdata, handles)
0272 % hObject    handle to popupmenu_sample2Selector (see GCBO)
0273 % eventdata  reserved - to be defined in a future version of MATLAB
0274 % handles    structure with handles and user data (see GUIDATA)
0275 
0276 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_sample2Selector contents as cell array
0277 %        contents{get(hObject,'Value')} returns selected item from popupmenu_sample2Selector
0278     populateSampleList(hObject);
0279 
0280 
0281 % --- Executes during object creation, after setting all properties.
0282 function popupmenu_sample2Selector_CreateFcn(hObject, eventdata, handles)
0283 % hObject    handle to popupmenu_sample2Selector (see GCBO)
0284 % eventdata  reserved - to be defined in a future version of MATLAB
0285 % handles    empty - handles not created until after all CreateFcns called
0286 
0287 % Hint: popupmenu controls usually have a white background on Windows.
0288 %       See ISPC and COMPUTER.
0289 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0290     set(hObject,'BackgroundColor','white');
0291 end
0292 
0293 
0294 % --- Executes on button press in pushbutton_refreshSample2List.
0295 function pushbutton_refreshSample2List_Callback(hObject, eventdata, handles)
0296 % hObject    handle to pushbutton_refreshSample2List (see GCBO)
0297 % eventdata  reserved - to be defined in a future version of MATLAB
0298 % handles    structure with handles and user data (see GUIDATA)
0299     populateSampleList(handles.popupmenu_sample2Selector);
0300 
0301 % --- Executes on selection change in popupmenu_sample2ColSelector.
0302 function popupmenu_sample2ColSelector_Callback(hObject, eventdata, handles)
0303 % hObject    handle to popupmenu_sample2ColSelector (see GCBO)
0304 % eventdata  reserved - to be defined in a future version of MATLAB
0305 % handles    structure with handles and user data (see GUIDATA)
0306 
0307 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_sample2ColSelector contents as cell array
0308 %        contents{get(hObject,'Value')} returns selected item from popupmenu_sample2ColSelector
0309     populateColumnList(hObject,handles.popupmenu_sample2Selector);
0310 
0311 
0312 % --- Executes during object creation, after setting all properties.
0313 function popupmenu_sample2ColSelector_CreateFcn(hObject, eventdata, handles)
0314 % hObject    handle to popupmenu_sample2ColSelector (see GCBO)
0315 % eventdata  reserved - to be defined in a future version of MATLAB
0316 % handles    empty - handles not created until after all CreateFcns called
0317 
0318 % Hint: popupmenu controls usually have a white background on Windows.
0319 %       See ISPC and COMPUTER.
0320 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0321     set(hObject,'BackgroundColor','white');
0322 end
0323 
0324 
0325 % --- Executes on button press in pushbutton_refreshsample2ColSelector.
0326 function pushbutton_refreshsample2ColSelector_Callback(hObject, eventdata, handles)
0327 % hObject    handle to pushbutton_refreshsample2ColSelector (see GCBO)
0328 % eventdata  reserved - to be defined in a future version of MATLAB
0329 % handles    structure with handles and user data (see GUIDATA)
0330     populateColumnList(handles.popupmenu_sample2ColSelector,handles.popupmenu_sample2Selector);
0331 
0332 
0333 % --- If Enable == 'on', executes on mouse press in 5 pixel border.
0334 % --- Otherwise, executes on mouse press in 5 pixel border or over popupmenu_sample1ColSelector.
0335 function popupmenu_sample1ColSelector_ButtonDownFcn(hObject, eventdata, handles)
0336 % hObject    handle to popupmenu_sample1ColSelector (see GCBO)
0337 % eventdata  reserved - to be defined in a future version of MATLAB
0338 % handles    structure with handles and user data (see GUIDATA)
0339     populateColumnList(hObject,handles.popupmenu_sample1Selector);
0340 
0341 
0342 % --- If Enable == 'on', executes on mouse press in 5 pixel border.
0343 % --- Otherwise, executes on mouse press in 5 pixel border or over popupmenu_sample2Selector.
0344 function popupmenu_sample2Selector_ButtonDownFcn(hObject, eventdata, handles)
0345 % hObject    handle to popupmenu_sample2Selector (see GCBO)
0346 % eventdata  reserved - to be defined in a future version of MATLAB
0347 % handles    structure with handles and user data (see GUIDATA)
0348     populateSampleList(hObject);
0349 
0350 
0351 % --- If Enable == 'on', executes on mouse press in 5 pixel border.
0352 % --- Otherwise, executes on mouse press in 5 pixel border or over popupmenu_sample2ColSelector.
0353 function popupmenu_sample2ColSelector_ButtonDownFcn(hObject, eventdata, handles)
0354 % hObject    handle to popupmenu_sample2ColSelector (see GCBO)
0355 % eventdata  reserved - to be defined in a future version of MATLAB
0356 % handles    structure with handles and user data (see GUIDATA)
0357     populateColumnList(hObject,handles.popupmenu_sample2Selector);
0358 
0359 
0360 
0361 function edit_desiredpval_Callback(hObject, eventdata, handles)
0362 % hObject    handle to edit_desiredpval (see GCBO)
0363 % eventdata  reserved - to be defined in a future version of MATLAB
0364 % handles    structure with handles and user data (see GUIDATA)
0365 
0366 % Hints: get(hObject,'String') returns contents of edit_desiredpval as text
0367 %        str2double(get(hObject,'String')) returns contents of edit_desiredpval as a double
0368     validate_desiredpval(handles);
0369 
0370 
0371 function flag = validate_desiredpval(handles)
0372     str = get(handles.edit_desiredpval,'String');
0373     
0374     errmsg = 'alpha must be a probability value between 0 and 1';
0375     errtitle = 'Invalid alpha!';
0376     
0377     flag = validateProbability(str,errmsg,errtitle);
0378 
0379 % --- Executes during object creation, after setting all properties.
0380 function edit_desiredpval_CreateFcn(hObject, eventdata, handles)
0381 % hObject    handle to edit_desiredpval (see GCBO)
0382 % eventdata  reserved - to be defined in a future version of MATLAB
0383 % handles    empty - handles not created until after all CreateFcns called
0384 
0385 % Hint: edit controls usually have a white background on Windows.
0386 %       See ISPC and COMPUTER.
0387 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0388     set(hObject,'BackgroundColor','white');
0389 end
0390 
0391 
0392 % --- Executes on selection change in popupmenu_desiredpvalCondition.
0393 function popupmenu_desiredpvalCondition_Callback(hObject, eventdata, handles)
0394 % hObject    handle to popupmenu_desiredpvalCondition (see GCBO)
0395 % eventdata  reserved - to be defined in a future version of MATLAB
0396 % handles    structure with handles and user data (see GUIDATA)
0397 
0398 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_desiredpvalCondition contents as cell array
0399 %        contents{get(hObject,'Value')} returns selected item from popupmenu_desiredpvalCondition
0400 
0401 
0402 % --- Executes during object creation, after setting all properties.
0403 function popupmenu_desiredpvalCondition_CreateFcn(hObject, eventdata, handles)
0404 % hObject    handle to popupmenu_desiredpvalCondition (see GCBO)
0405 % eventdata  reserved - to be defined in a future version of MATLAB
0406 % handles    empty - handles not created until after all CreateFcns called
0407 
0408 % Hint: popupmenu controls usually have a white background on Windows.
0409 %       See ISPC and COMPUTER.
0410 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0411     set(hObject,'BackgroundColor','white');
0412 end
0413 
0414 
0415 % --- Executes on selection change in popupmenu_tails.
0416 function popupmenu_tails_Callback(hObject, eventdata, handles)
0417 % hObject    handle to popupmenu_tails (see GCBO)
0418 % eventdata  reserved - to be defined in a future version of MATLAB
0419 % handles    structure with handles and user data (see GUIDATA)
0420 
0421 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_tails contents as cell array
0422 %        contents{get(hObject,'Value')} returns selected item from popupmenu_tails
0423 
0424 
0425 % --- Executes during object creation, after setting all properties.
0426 function popupmenu_tails_CreateFcn(hObject, eventdata, handles)
0427 % hObject    handle to popupmenu_tails (see GCBO)
0428 % eventdata  reserved - to be defined in a future version of MATLAB
0429 % handles    empty - handles not created until after all CreateFcns called
0430 
0431 % Hint: popupmenu controls usually have a white background on Windows.
0432 %       See ISPC and COMPUTER.
0433 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0434     set(hObject,'BackgroundColor','white');
0435 end
0436 
0437 
0438 % --- Executes on button press in pushbutton_create_ttest.
0439 function pushbutton_create_ttest_Callback(hObject, eventdata, handles)
0440 % hObject    handle to pushbutton_create_ttest (see GCBO)
0441 % eventdata  reserved - to be defined in a future version of MATLAB
0442 % handles    structure with handles and user data (see GUIDATA)
0443 
0444     type = getdfName(handles.popupmenu_type,'type');
0445 
0446     mainWindowHandle = sos_gui;
0447     mainWindowData = guidata(mainWindowHandle);
0448 
0449     sosObjName = getdfName(mainWindowData.popupmenu_SOSSelector,'SOS');
0450 
0451     if isempty(sosObjName) == 0
0452         % we have a valid SOS object to add the test to
0453         % validate all of the parameters for the test
0454         create = validate_name(handles);
0455         name = get(handles.edit_name,'String');
0456         
0457         if create == true
0458             sample1 = getdfName(handles.popupmenu_sample1Selector,'sample 1');
0459             
0460             if isempty(sample1) == 0
0461                 sample1Col = getdfName(handles.popupmenu_sample1ColSelector','sample 1 column');
0462                 
0463                 if isempty(sample1Col) == 0
0464                     sample2 = getdfName(handles.popupmenu_sample2Selector,'sample 2');
0465                     
0466                     if isempty(sample2) == 0
0467                         sample2Col = getdfName(handles.popupmenu_sample2ColSelector,'sample 2 column');
0468                         
0469                         if isempty(sample2Col) == 0
0470                             create  = validate_desiredpval(handles);
0471 
0472                             if create == true
0473 
0474                                 desiredpval = get(handles.edit_desiredpval,'String');
0475                                 
0476                                 desiredpvalCondition = getdfName(handles.popupmenu_desiredpvalCondition,...
0477                                                     'desiredpvalCondition');
0478                                 %all of the other options are in drop-down
0479                                 %menus and as such necessarily will pass.
0480                                 %run the command.
0481                                 
0482                                 command = [sosObjName,'.addttest(',...
0483                                     '''name'',''',name,''',',...
0484                                     '''type'',''',type,''',',...
0485                                     '''sample1'',',sample1,',',...
0486                                     '''s1ColName'',''',sample1Col,''',',...
0487                                     '''sample2'',',sample2,',',...
0488                                     '''s2ColName'',''',sample2Col,''',',...
0489                                     '''desiredpvalCondition'',''',desiredpvalCondition,''',',...
0490                                     '''desiredpval'',',desiredpval,');',...
0491                                     ];
0492                                 
0493                                 verbosePrint(['Executing command: ','''',command,''''],'create2samplettest_Dialog_create');
0494                                 evalin('base',command);      
0495                                  close(handles.figure_create2samplettest_Dialog);
0496                                 
0497                             end
0498                         end
0499                     end
0500                         
0501 
0502 
0503 
0504                 end
0505             end
0506         end
0507         
0508         
0509     end
0510 
0511 
0512 % --- Executes on selection change in popupmenu_type.
0513 function popupmenu_type_Callback(hObject, eventdata, handles)
0514 % hObject    handle to popupmenu_type (see GCBO)
0515 % eventdata  reserved - to be defined in a future version of MATLAB
0516 % handles    structure with handles and user data (see GUIDATA)
0517 
0518 % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu_type contents as cell array
0519 %        contents{get(hObject,'Value')} returns selected item from popupmenu_type
0520 
0521 
0522 % --- Executes during object creation, after setting all properties.
0523 function popupmenu_type_CreateFcn(hObject, eventdata, handles)
0524 % hObject    handle to popupmenu_type (see GCBO)
0525 % eventdata  reserved - to be defined in a future version of MATLAB
0526 % handles    empty - handles not created until after all CreateFcns called
0527 
0528 % Hint: popupmenu controls usually have a white background on Windows.
0529 %       See ISPC and COMPUTER.
0530 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0531     set(hObject,'BackgroundColor','white');
0532 end
0533 
0534 
0535 % --- Executes on key press with focus on pushbutton_refreshSample1List and none of its controls.
0536 function pushbutton_refreshSample1List_KeyPressFcn(hObject, eventdata, handles)
0537 % hObject    handle to pushbutton_refreshSample1List (see GCBO)
0538 % eventdata  structure with the following fields (see UICONTROL)
0539 %    Key: name of the key that was pressed, in lower case
0540 %    Character: character interpretation of the key(s) that was pressed
0541 %    Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed
0542 % handles    structure with handles and user data (see GUIDATA)
0543 
0544 
0545 % --- If Enable == 'on', executes on mouse press in 5 pixel border.
0546 % --- Otherwise, executes on mouse press in 5 pixel border or over pushbutton_refreshSample1List.
0547 function pushbutton_refreshSample1List_ButtonDownFcn(hObject, eventdata, handles)
0548 % hObject    handle to pushbutton_refreshSample1List (see GCBO)
0549 % eventdata  reserved - to be defined in a future version of MATLAB
0550 % handles    structure with handles and user data (see GUIDATA)
0551 
0552 
0553 % --- Executes during object creation, after setting all properties.
0554 function pushbutton_refreshSample1List_CreateFcn(hObject, eventdata, handles)
0555 % hObject    handle to pushbutton_refreshSample1List (see GCBO)
0556 % eventdata  reserved - to be defined in a future version of MATLAB
0557 % handles    empty - handles not created until after all CreateFcns called

Generated on Fri 27-Jan-2012 16:18:41 by m2html © 2005