Home > FR3DSource > mCreateMatrix.m

mCreateMatrix

PURPOSE ^

mCreateMatrix is a script that sets up the interaction matrix for FR3D_GUI

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 mCreateMatrix is a script that sets up the interaction matrix for FR3D_GUI

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % mCreateMatrix is a script that sets up the interaction matrix for FR3D_GUI
0002 
0003 % modify the nucleotide index lookup to be aware of the given chain
0004 
0005 %%%%%%Create the basepair matrix (and delete extra ones) for determining
0006 %%%%%%Query.Diff, Query.ReqInter, Query.Diagonal
0007 %%%%%%Query.Config added
0008 if length(NT)<13
0009     x=.054;
0010     y=.038;
0011 else
0012     x=.684/length(NT);
0013     y=.54/length(NT);
0014 end
0015 
0016 
0017 PreviousConfig=ones(1,25);
0018 for i=1:25
0019     h=findobj('Tag',strcat('Config',num2str(i)));
0020     try,PreviousConfig(i)=get(h,'Value');end
0021     delete(h);
0022 end
0023 % % % h = findobj('-regexp','Tag','Config[0-9]');
0024 % % % delete(h);
0025 
0026 
0027 for i=1:length(NT)
0028     str={'','anti','syn'};
0029     handles.Config(i) = uicontrol('Tag',strcat('Config',num2str(i)),'Style','popupmenu','Units','normalized','Position',[(0.305+x*(i-1)) (0.8-y) x-.003 y-.005],'Background',[1 1 1],'String',str,'Value',PreviousConfig(i));
0030 end
0031 
0032 % % % for i=1:25
0033 % % %     hh=findobj('Tag',strcat('BPtexth',num2str(i)));
0034 % % %     delete(hh);
0035 % % %     hv=findobj('Tag',strcat('BPtextv',num2str(i)));
0036 % % %     delete(hv);
0037 % % % end
0038 hh = findobj('-regexp','Tag','BPtexth[0-9]');
0039 hv = findobj('-regexp','Tag','BPtextv[0-9]');
0040 delete(hh,hv)
0041 
0042 for i=1:length(NT)
0043     if get(handles.Geometric,'Value') == 1
0044         ind = zIndexLookup(File(QIndex),NT{i},ChainList{i});
0045         Bas = File(QIndex).NT(ind).Base;
0046     else
0047         Bas='NT';
0048     end
0049     %%%Horizontal title line:
0050 %     handles.BPtexth(i) = uicontrol('Tag',strcat('BPtexth',num2str(i)),'Style','text','Units','normalized','Position',[(0.25+0.057*i) (0.73) .054 .04],'String',strcat(File(QIndex).NT(str2num(NT{i})).Base,NT(i)));
0051     handles.BPtexth(i) = uicontrol('Tag',strcat('BPtexth',num2str(i)),'Style','text','Units','normalized','Position',[(0.305+x*(i-1)) (0.75-y) x-.003 y-.005],'String',strcat(Bas,NT(i)));
0052     %%%Vertical title line:
0053     handles.BPtextv(i) = uicontrol('Tag',strcat('BPtextv',num2str(i)),'Style','text','Units','normalized','Position',[(0.26) (0.725-y*i) .056 y-.005],'String',strcat(Bas,NT(i)));
0054 end
0055 
0056 %%%Now the matrix:
0057 % x           = ones(1,25);
0058 % y           = num2str(x);
0059 % y           = regexprep(y,' ','');
0060 % Sequences   = regexprep(y,'1','N');
0061 
0062 for i=1:25
0063     hd=findobj('Tag',strcat('Diagonal',num2str(i)));
0064     try,PreviousDiagonal{i}=get(hd,'String');end
0065     delete(hd);
0066     for j=1:25
0067         hh=findobj('Tag',strcat('BPType',num2str(i),num2str(j)));
0068         try,PreviousBPType{i,j}=get(hh,'String');end
0069         delete(hh);
0070         hv=findobj('Tag',strcat('Diff',num2str(i),num2str(j)));
0071         try,PreviousDiff{i,j}=get(hv,'String');end
0072         delete(hv);
0073     end
0074 end
0075 
0076 % % % hd = findobj('-regexp','Tag','Diagonal[0-9]');
0077 % % % hbp = findobj('-regexp','Tag','BPType[0-9]');
0078 % % % hdif = findobj('-regexp','Tag','Diff[0-9]');
0079 % % % delete(hh,hv,hd,hbp,hdif)
0080 
0081 
0082 % % % if ~isempty(PreviousMasks)
0083 % % %     PreviousMasks(1)
0084 % % %     PreviousBPType{1,2}
0085 % % %     PreviousDiff{2,1}
0086 % % % end
0087 
0088 %MaskList={'N (ACGU)','A','C','G','U','R (AG)','Y (CU)','M (AC)','W (AU)','S (GC)','K (GU)','V (ACG)','H (ACU)','D (AGU)','B (CGU)'};
0089 for i=1:length(NT)
0090     for j=1:length(NT)
0091         if j==i
0092             if isempty(PreviousDiagonal{i}),PreviousDiagonal{i}='N';end
0093             handles.Diagonal(i) = uicontrol('Tag',strcat('Diagonal',num2str(i)),'Style','edit','Units','normalized','Position',[(0.305+x*(j-1)) (0.73-y*i) x-.003 y-.005],'Background',[1 1 1],'String',PreviousDiagonal{i});
0094         end
0095         if i<j
0096             if isempty(PreviousBPType{i,j}),PreviousBPType{i,j}='';end
0097             handles.BPType(i,j) = uicontrol('Tag',strcat('BPType',num2str(i),num2str(j)),'Style','edit','Units','normalized','Position',[(0.305+x*(j-1)) (0.73-y*i) x-.003 y-.005],'Background',[1 1 0],'String',PreviousBPType{i,j});
0098         elseif i>j
0099             if isempty(PreviousDiff{i,j}),PreviousDiff{i,j}='';end
0100             handles.Diff(i,j) = uicontrol('Tag',strcat('Diff',num2str(i),num2str(j)),'Style','edit','Units','normalized','Position',[(0.305+x*(j-1)) (0.73-y*i) x-.003 y-.005],'Background',[0 1 1],'String',PreviousDiff{i,j});
0101         end
0102     end
0103 end
0104 
0105 set(handles.ConfigText,'Visible','on');
0106 set(handles.NTmaskText,'Visible','on');
0107 set(handles.MaxDistText,'Visible','on');
0108 set(handles.InteractionText,'Visible','on');

Generated on Fri 03-Apr-2009 09:52:35 by m2html © 2003