Home > FR3DSource > xWriteCandidatePDB.m

xWriteCandidatePDB

PURPOSE ^

xWriteCandidatePDB(File,Search) writes a single PDB file, named after

SYNOPSIS ^

function [void] = xWriteCandidatePDB(Search)

DESCRIPTION ^

 xWriteCandidatePDB(File,Search) writes a single PDB file, named after
 Search, in which each candidate is present, translated from the previous
 one by 20 Angstroms

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % xWriteCandidatePDB(File,Search) writes a single PDB file, named after
0002 % Search, in which each candidate is present, translated from the previous
0003 % one by 20 Angstroms
0004 
0005 function [void] = xWriteCandidatePDB(Search)
0006 
0007 File = Search.File;
0008 
0009 N = Search.Query.NumNT;                        % number of nucleotides in each
0010 
0011 if isfield(Search.Query,'LocWeight'),
0012   LW = Search.Query.LocWeight;
0013 else
0014   LW = ones(N,1);
0015 end
0016 
0017 if isfield(Search.Query,'AngleWeight'),
0018   AW = Search.Query.AngleWeight;
0019 else
0020   AW = ones(N,1);
0021 end
0022 
0023 if length(Search.Candidates) > 0,
0024 
0025 M = length(Search.Candidates(:,1));            % number of candidates
0026 
0027 f     = Search.Candidates(1,N+1);
0028 Model = File(f).NT(Search.Candidates(1,1:N));  % first cand, taken as model
0029 
0030 % ------------------ Write candidates to separate locations
0031 
0032 fid = fopen([Search.SaveName '-Cand.pdb'],'w');       % open for writing
0033 
0034 a = 1;                                         % atom number
0035 
0036 for c = 1:M,                                   % loop through candidates
0037  f     = Search.Candidates(c,N+1);             % file number, this candidate
0038  Cand  = File(f).NT(Search.Candidates(c,1:N)); % current candidate
0039  [R,Sh] = xSuperimposeCandidates(Model,Cand,LW,AW);
0040 
0041  for i = 1:N,                                  % loop through nucleotides
0042   NT = Cand(i);                                % current nucleotide
0043   a = zWriteNucleotidePDB(fid,NT,a,c,R',Sh);
0044  end
0045 end
0046 
0047 fclose(fid);
0048 
0049 fprintf('Wrote %s\n', [Search.SaveName '-Cand.pdb']);
0050 
0051 % ------------------ Write candidates superimposed on one another
0052 
0053 fid = fopen([Search.SaveName '-Cand-Superimposed.pdb'],'w');       % open for writing
0054 
0055 a = 1;                                         % atom number
0056 
0057 VP.Sugar = 1;
0058 
0059 for c = 1:M,                                   % loop through candidates
0060  f     = Search.Candidates(c,N+1);             % file number, this candidate
0061  Cand  = File(f).NT(Search.Candidates(c,1:N)); % current candidate
0062  [R,Sh] = xSuperimposeCandidates(Model,Cand,LW,AW);
0063 
0064  for i = 1:N,                                  % loop through nucleotides
0065   NT = Cand(i);                                % current nucleotide
0066   a = zWriteNucleotidePDB(fid,NT,a,0,R',Sh);
0067 %  zPlotOneNTRotated(NT,VP,R',Sh);
0068   hold on
0069  end
0070 end
0071 
0072 fclose(fid);
0073 
0074 fprintf('Wrote %s\n', [Search.SaveName '-Cand-Superimposed.pdb']);
0075 
0076 end

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