Home > FR3DSource > zReadPDBList.m

zReadPDBList

PURPOSE ^

zReadPDBList(Filename) reads Filename.pdb for a list of PDB file names

SYNOPSIS ^

function [NewNames] = zReadPDBList(Filename,Verbose)

DESCRIPTION ^

 zReadPDBList(Filename) reads Filename.pdb for a list of PDB file names

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % zReadPDBList(Filename) reads Filename.pdb for a list of PDB file names
0002 
0003 function [NewNames] = zReadPDBList(Filename,Verbose)
0004 
0005 if nargin < 2,
0006   Verbose = 1;
0007 end
0008 
0009 NewNames = '';
0010 
0011 if strcmpi(Filename,'AllFiles_list'),
0012   [s,NewNames] = mGetPDBFilenames;
0013 elseif ~isempty(strfind(Filename,'_equiv')),
0014   load PDBInfo
0015   Reference = strrep(Filename,'_equiv','');
0016   NewNames  = {Reference};
0017   for i = 1:length(t(:,1)),                      % loop through PDB files
0018     if strcmpi(t{i,10},Reference),
0019       NewNames = [NewNames; t(i,1)];
0020     end
0021   end
0022 elseif isempty(strfind(Filename,'_list')),
0023   NewNames = {Filename};
0024 elseif ~isempty(Filename),
0025   Filename = strrep(Filename,'.pdb','');
0026   fid = fopen(['PDBFiles' filesep Filename '.pdb'],'r');
0027 
0028   if fid > 0
0029 
0030     L = 1;
0031 
0032     while L > -1
0033       L = fgetl(fid);
0034       if L > -1
0035         if ~isempty(strfind(L,'_list')),
0036           NewNames = [NewNames; zReadPDBList(L)];
0037         else
0038           NewNames = [NewNames; {L}];
0039         end
0040       end
0041     end
0042 
0043     fclose(fid);
0044 
0045     fprintf('Read list %s.pdb\n', Filename)
0046 
0047   else
0048 
0049     fprintf('Could not open file %s.pdb\n', Filename);
0050 
0051   end
0052 
0053 end

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