%Team Blue Genes %Jiayi Liang, Steven Hahn, William Schuppert, Runkun Jiang %BioMOD competition 2011 %This file calculates the fluctuations of the synthetic DNA structures and %outputs the diagonal of the Kirchhoff matrix (the fluctuations). function syntheticDNA % Size of matrix/number of atoms m_size = 3066; % Cutoff distance cutoff = 13; % Specific DNA data of coordinates, can be extracted from PDB files fileName = 'FILENAME.xlsx'; fprintf('Loading...'); readXL = xlsread(fileName); A = zeros(m_size, m_size); G = zeros(m_size, 1); for i = 1 : m_size compareRow = readXL(i, 5:7); %compareRow for j = 1 : m_size if i == j continue; end compareAltRow = readXL(j, 5:7); %compareAltRow compDist = vertcat(compareRow, compareAltRow); distance = pdist(compDist); %distance if distance < cutoff A(i, j) = -1; else A(i, j) = 0; end end rowSum = -1 * sum(A(i, :)); A(i, i) = rowSum; end % Kirchhoff Matrix % Node Number for i = 1 : m_size G (i, 1) = readXL(i, 1); end B = pinv (A); % Inverse Kirchhoff Matrix diagonal = diag (B); diagonal % Diagonal elements output plot (G, diagonal); % Plot of flexibility data to node number end