Home > FR3DSource > zReadPDBTextRead.m

zReadPDBTextRead

PURPOSE ^

SYNOPSIS ^

function [ATOM_TYPE, ATOMNUMBER, ATOMNAME, VERSION, NTLETTER, CHAIN, NTNUMBER, P,OCC,TEMP,Readable] = zReadPDBTextRead(Filename)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 function [ATOM_TYPE, ATOMNUMBER, ATOMNAME, VERSION, NTLETTER, CHAIN, NTNUMBER, P,OCC,TEMP,Readable] = zReadPDBTextRead(Filename)
0003 
0004 Readable = 1;
0005 
0006 try
0007 
0008   [A, B, C, E, F, G, X, Y, Z, OCC, TEMP] ...
0009    = textread(Filename,'%6s%5d  %4c%4s %1s%5s  %8.3f%8.3f%8.3f%6.2f%6.2f%*[^\n]');
0010 
0011 catch
0012 
0013   try
0014     [A, B, C, E, G, X, Y, Z, OCC, TEMP] ...
0015      = textread(Filename,'%6s%5d  %4c%4s %5s  %8.3f%8.3f%8.3f%6.2f%6.2f%*[^\n]');
0016     for i=1:length(A),
0017       F{i} = '1';                % invent a chain number
0018     end
0019   catch
0020 
0021     Readable = 0;
0022 
0023   end
0024 end
0025 
0026 if Readable > 0,
0027 
0028 [s,t] = size(C);
0029 
0030 NoChain = 0;
0031 
0032 for i=1:s,
0033   if ~isempty(strfind(G{i},'.')),
0034     NoChain = 1;            % when no chain info, NTNUMBER is read from X column
0035   end
0036 end
0037 
0038 CHAIN = cell(s,1);
0039 
0040 if NoChain == 1,
0041   [A, B, C, E, G, X, Y, Z, OCC, TEMP] ...
0042    = textread(Filename,'%6s%5d  %4c%4s %5s  %8.3f%8.3f%8.3f%6.2f%6.2f%*[^\n]');
0043   for i=1:s,
0044     CHAIN{i,1} = '1';
0045   end
0046 else
0047   CHAIN      = [F];
0048 end
0049 
0050 ATOM_TYPE  = [A];
0051 ATOMNUMBER = [B];
0052 NTLETTER   = [E];
0053 NTNUMBER   = [G];
0054 P          = [X Y Z];
0055 
0056 ATOMNAME = cell(s,1);
0057 VERSION  = cell(s,1);
0058 
0059 for i=1:s,
0060   ATOMNAME{i,1} = deblank(C(i,1:3));
0061   VERSION{i,1}  = C(i,4);
0062 end
0063 
0064 else
0065 
0066 ATOM_TYPE = [];
0067 ATOMNUMBER = [];
0068 NTLETTER = [];
0069 NTNUMBER = [];
0070 P        = [];
0071 ATOMNAME = [];
0072 VERSION  = [];
0073 OCC      = [];
0074 TEMP     = [];
0075 CHAIN    = [];
0076 
0077 end

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