%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % CS321 Project1: Main program % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Add relevant directories to Matlab PATH addpath align addpath clusters % The proteins used in the project, and other definitions proteins = {'1MBC','1DO1','1A6G','1VXH','1BZ6','1MBO','1BZR', ... '1YMB','1YOI','4MBN','1LH1'}; numprot = length(proteins); pdbdir = 'proteins/'; % Directory where pdb files are stored alignfile = 'align/alignments.txt'; % File containing sequence alignments % Read the CA coordinates of each protein allcrd = cell(1, numprot); for i=1:numprot pdbfile = strcat(pdbdir, proteins{i}, '.pdb'); allcrd{i} = pickAtom(pdbfile, 'CA'); end % Extract sequence alignments M = loadAlignments(alignfile); % Compute pairwise distances dist = zeros(numprot, numprot); for i=1:numprot for j=i+1:numprot [Si, Sj] = getAlignment(M, i, j); [crdi, crdj] = alignCoords(allcrd{i}, Si, allcrd{j}, Sj); dist(i, j) = getDistance(crdi, crdj); dist(j, i) = dist(i, j); end end % Display the distance matrix disp(dist); % Perform clustering, and draw the output drawCluster(clusterProteins(dist));