0001 function varargout = KeggDrawTable(varargin)
0002
0003
0004
0005
0006
0007
0008
0009 gui_Singleton = 1;
0010 gui_State = struct('gui_Name', mfilename, ...
0011 'gui_Singleton', gui_Singleton, ...
0012 'gui_OpeningFcn', @KeggDrawTable_OpeningFcn, ...
0013 'gui_OutputFcn', @KeggDrawTable_OutputFcn, ...
0014 'gui_LayoutFcn', [] , ...
0015 'gui_Callback', []);
0016 if nargin && ischar(varargin{1})
0017 gui_State.gui_Callback = str2func(varargin{1});
0018 end
0019
0020 if nargout
0021 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0022 else
0023 gui_mainfcn(gui_State, varargin{:});
0024 end
0025
0026
0027
0028
0029 function KeggDrawTable_OpeningFcn(hObject, eventdata, handles, varargin)
0030
0031
0032
0033
0034
0035 CurrentMap = getappdata(0,'CurrentMap');
0036 CurrentMap1 = ['Map: ',CurrentMap];
0037 set(handles.text2,'String',CurrentMap1)
0038 RptRxns = getappdata(0,'RptRxns');
0039 ListData = {0};
0040 for ct = 1:numel(RptRxns)
0041 ListData{ct} = RptRxns{ct}{1};
0042 data1{ct} = 'Not slected';
0043 end
0044 set(handles.KeggListbox,'String',ListData);
0045 set(handles.ResultListbox,'String',data1);
0046
0047 handles.output = hObject;
0048
0049
0050 guidata(hObject, handles);
0051
0052
0053
0054
0055
0056
0057 function varargout = KeggDrawTable_OutputFcn(hObject, eventdata, handles)
0058
0059
0060
0061
0062
0063
0064 varargout{1} = handles.output;
0065
0066
0067
0068 function pushbutton1_Callback(hObject, eventdata, handles)
0069
0070
0071
0072 data1 = getappdata(0,'data1');
0073 setappdata(0,'data1',data1);
0074 close(gcf)
0075
0076
0077 function KeggListbox_Callback(hObject, eventdata, handles)
0078
0079
0080
0081 RptFlx = getappdata(0,'RptFlx');
0082 RptBiggs = getappdata(0,'RptBiggs');
0083 ListChoice = get(handles.KeggListbox, 'Value');
0084 ColNm = size(RptFlx{ListChoice},2);
0085 for ct=1:ColNm
0086 ColNm1{ct} = num2str(ct);
0087 end
0088 columnname = {'check' , ColNm1{:}};
0089 CurrentSize = size(RptFlx{ListChoice},1);
0090 checkBox = num2cell(false(CurrentSize,1));
0091 columnformat = {'logical','numeric'};
0092 columneditable = true;
0093 Y = num2cell(RptFlx{ListChoice});
0094 MixedData = [checkBox Y];
0095 set(handles.Rxnuitable,'Data',MixedData)
0096 set(handles.Rxnuitable,'ColumnFormat',columnformat)
0097 set(handles.Rxnuitable,'ColumnName',columnname)
0098 set(handles.Rxnuitable,'ColumnEditable',columneditable)
0099 set(handles.Rxnuitable, 'RowName', RptBiggs{ListChoice})
0100
0101
0102
0103
0104
0105
0106
0107
0108 function KeggListbox_CreateFcn(hObject, eventdata, handles)
0109
0110
0111
0112
0113
0114
0115 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0116 set(hObject,'BackgroundColor','white');
0117 end
0118
0119
0120
0121 function Rxnuitable_CellEditCallback(hObject, eventdata, handles)
0122
0123
0124
0125
0126
0127
0128
0129
0130 data=get(hObject,'Data');
0131 cols=get(hObject,'ColumnFormat');
0132 if strcmp(cols(eventdata.Indices(2)),'logical')
0133 if eventdata.EditData
0134 data{eventdata.Indices(1),eventdata.Indices(2)}=true;
0135 else
0136 data{eventdata.Indices(1),eventdata.Indices(2)}=false;
0137 end
0138 end
0139 set(hObject,'Data',data);
0140
0141 RptBiggs = getappdata(0,'RptBiggs');
0142 KeggChoice = get(handles.KeggListbox, 'Value');
0143 BiggSelect = data(:,1); BiggSelect = [BiggSelect{:}];
0144 BiggInd = find(BiggSelect);
0145 data1 = get(handles.ResultListbox,'String');
0146 if numel(BiggInd) ==1
0147 data1{KeggChoice} = RptBiggs{KeggChoice}{BiggInd};
0148 set(handles.ResultListbox,'String',data1)
0149 NoteStr = ['BiGG ID: ',data1{KeggChoice},' is selected'];
0150 set(handles.text1,'String',NoteStr)
0151 setappdata(0,'data1',data1)
0152 elseif numel(BiggInd)>1
0153 NoteStr = 'Warning: More than one BiGG ID is selected!';
0154 set(handles.text1,'String',NoteStr)
0155 else
0156 data1{KeggChoice} = 'Not slected';
0157 set(handles.ResultListbox,'String',data1)
0158 NoteStr = 'Warning: No BiGG ID is selected!';
0159 set(handles.text1,'String',NoteStr)
0160 setappdata(0,'data1',data1)
0161 end
0162
0163
0164
0165 function ResultListbox_Callback(hObject, eventdata, handles)
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175 function ResultListbox_CreateFcn(hObject, eventdata, handles)
0176
0177
0178
0179
0180
0181
0182 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
0183 set(hObject,'BackgroundColor','white');
0184 end