Home > FR3DSource > FR3D_InteractionMap.m

FR3D_InteractionMap

PURPOSE ^

FR3D_InteractionMap(File) puts a dot at the center of each nucleotide

SYNOPSIS ^

function [void] = FR3D_InteractionMap(File,DL,NTList)

DESCRIPTION ^

 FR3D_InteractionMap(File) puts a dot at the center of each nucleotide
 in File, colored by the number of interactions the nucleotide has (blue
 means zero, red is the most).  The C1' atom of each nucleotide is
 connected to the C1' atom of the next nucleotide by a black line.
 Interactions are shown between centers of nucleotides.  WC-WC
 interactions (category 1) are shown by red lines, non-canonical planar
 interactions by green, typical sequential stacking (category 21) by
 dark blue, and typical cross-strand stacking (categories 22, 23) by light
 blue.
 File can be, for example, '1s72' or File(3).
 The vector DL, if specified, controls what is displayed:
  DL(1) = 1;                                 % plot geometric center
  DL(2) = 1;                                 % show cWW bonds
  DL(3) = 1;                                 % show other planar bonds
  DL(4) = 1;                                 % show 35 and 53 stacking
  DL(5) = 1;                                 % show 33 and 55 stacking
  DL(6) = 1;                                 % connect glycosidic atoms

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % FR3D_InteractionMap(File) puts a dot at the center of each nucleotide
0002 % in File, colored by the number of interactions the nucleotide has (blue
0003 % means zero, red is the most).  The C1' atom of each nucleotide is
0004 % connected to the C1' atom of the next nucleotide by a black line.
0005 % Interactions are shown between centers of nucleotides.  WC-WC
0006 % interactions (category 1) are shown by red lines, non-canonical planar
0007 % interactions by green, typical sequential stacking (category 21) by
0008 % dark blue, and typical cross-strand stacking (categories 22, 23) by light
0009 % blue.
0010 % File can be, for example, '1s72' or File(3).
0011 % The vector DL, if specified, controls what is displayed:
0012 %  DL(1) = 1;                                 % plot geometric center
0013 %  DL(2) = 1;                                 % show cWW bonds
0014 %  DL(3) = 1;                                 % show other planar bonds
0015 %  DL(4) = 1;                                 % show 35 and 53 stacking
0016 %  DL(5) = 1;                                 % show 33 and 55 stacking
0017 %  DL(6) = 1;                                 % connect glycosidic atoms
0018 
0019 function [void] = FR3D_InteractionMap(File,DL,NTList)
0020 
0021 if nargin < 1
0022   fprintf('Please specify a filename, e.g. FR3D_InteractionMap(''1s72'')\n');
0023 end
0024 
0025 % if File is a text string (filename), load the file and display
0026 
0027 if strcmp(class(File),'char'),
0028   Filename = File;
0029   File = zGetNTData(Filename,0);
0030 end
0031 
0032 % if NTList is a cell array of numbers, look up the indices
0033 
0034 if nargin > 2,
0035 
0036   if strcmp(class(NTList),'char'),
0037     NTList = {NTList};
0038   end
0039 
0040   if strcmp(class(NTList),'cell'),
0041     Indices = zIndexLookup(File,NTList);
0042   else
0043     Indices = NTList;
0044   end
0045 
0046 else
0047 
0048   Indices = 1:length(File.NT);
0049 
0050 end
0051 
0052 if nargin < 2
0053   DL(1) = 1;                                 % plot geometric center
0054   DL(2) = 1;                                 % show cWW bonds
0055   DL(3) = 1;                                 % show other planar bonds
0056   DL(4) = 1;                                 % show 35 and 53 stacking
0057   DL(5) = 1;                                 % show 33 and 55 stacking
0058   DL(6) = 1;                                 % connect glycosidic atoms
0059 end
0060 
0061 %-----------------------------------------------------------------------
0062 figure(1)
0063 clf
0064 
0065 set(gcf,'Renderer','OpenGL');
0066 
0067 for a = 1:length(Indices),                          % Loop through nucleotides
0068   k = Indices(a);
0069   i  = abs(File.Edge(k,Indices));
0070   ii = find((i < 30) .* (i > 0));
0071   iii = Indices(ii);
0072   ni(k) = length(iii);                           % number of interactions
0073 
0074   e = File.NT(k).Center;
0075   if DL(1) > 0,
0076     scatter3(e(1),e(2),e(3),6,ni(k)+1,'filled');     % plot geometric center
0077   else
0078     scatter3(e(1),e(2),e(3),1,ni(k)+1,'filled');     % plot dots at least
0079   end
0080   hold on
0081 
0082   c = 0;
0083 
0084   for j = 1:length(iii),
0085     if iii(j) < k,                            % only plot once
0086       f = File.NT(iii(j)).Center;
0087       inter = abs(fix(File.Edge(k,iii(j))));
0088       if inter == 1,
0089         if DL(2) > 0,
0090           plot3([e(1) f(1)],[e(2) f(2)],[e(3) f(3)],'b');  % WC-WC
0091         end
0092         c = c + 1;
0093       elseif abs(inter) < 15,
0094         if DL(3) > 0,
0095           plot3([e(1) f(1)],[e(2) f(2)],[e(3) f(3)],'c');  % other planar
0096         end
0097         c = c + 1;
0098       elseif (inter == 21),
0099         if DL(4) > 0,
0100           plot3([e(1) f(1)],[e(2) f(2)],[e(3) f(3)],'y');  % 35 or 53 stacking
0101         end
0102         c = c + 1;
0103       elseif (inter == 22) | (inter == 23),
0104         if DL(5) > 0,
0105           plot3([e(1) f(1)],[e(2) f(2)],[e(3) f(3)],'y');  % 33 or 55 stacking
0106         end
0107         c = c + 1;
0108       end
0109     end
0110   end
0111 
0112   if DL(6) > 0,
0113     g = File.NT(k).Fit(1,:);                         
0114     h = File.NT(max(1,k-1)).Fit(1,:);
0115     if sum((g-h).^2) < 200,                           % reasonable distance
0116       plot3([g(1) h(1)],[g(2) h(2)],[g(3) h(3)],'k')  % connect glycosidics
0117     end
0118   end
0119 
0120 end
0121 
0122 set(gcf,'Renderer','painters');
0123 axis off
0124 
0125 rotate3d on

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