1 <H4> Update Time 02/03/13---05:39:39 </H4>
7 <DD> This structure is used to treat a pdb File.
10 <DD> pdb.PDB->ResidueSequenceNumber
15 <LI> pdbFileRead (fpt, &pdb)
16 <LI> pdbFileWrite(fpt, &pdb)
20 <DD> if(pdbFileIsAtom(&pdb)) { }
22 <DD> if(pdbFileIsCA(&pdb)) { }
24 <DD> if(pdbFileIsEndLine(&pdb)) { }
25 <LI> pdbRecordisNearby : Adjacent Residue or not
26 <DD> if(pdbRecordisNearby(&pdbRecord, &pdbRecord)) { }
28 <DD> if(pdbFileIsHelix(&pdb)) { }
30 <DD> if(pdbFileIsSheet(&pdb)) { }
32 <DD> if(pdbFileIsTurn(&pdb)) { }
33 <LI> pdbFileIsNegative
34 <DD> if(pdbFileIsNegative(&pdb)) { }
35 <LI> pdbFileIsPositive
36 <DD> if(pdbFileIsPositive(&pdb)) { }
38 <DD> if(pdbFileIsCharge(&pdb)) { }
41 <LI> lpdbDistanceCheck : mode 0: Near 1: Far ; compare the distance between pdb->current with p v.s. distance
42 <DD> if(lpdbDistanceCheck(&pdb, p, distance, mode)) {
44 <DD> if(lpdbDistanceNear(&pdb, p, distance, mode)) {
46 <DD> if(lpdbDistanceFar(&pdb, p, distance, mode)) {
50 <LI> pdbFileCoordGet(&pdb, &x, &y, &z)
51 <LI> unsigned char pdbFileChainIdentifierGet(&pdb)
52 <LI> pdbFileResidueSequenceNumberGet(&pdb)
53 <LI> char* pdbFileResidueNameGet(&pdb,mode)
55 <LI> pdbFileCoordSet(&pdb, x, y, z)
56 <LI> pdbFileChainIdentifierSetAll(&pdb, c)
57 <LI> pdbFileChainIdentifierSet(&pdb, c)
58 <LI> pdbFileTemperatureFactorSet(&pdb, (double)temp)
62 <LI> pdbFileNext(&pdb)
63 <LI> pdbFileNextAtom(&pdb)
64 <LI> pdbFileNextCA(&pdb)
65 <LI> pdbFileNextProtein(&pdb)
68 <LI> New, append etc. <UL>
70 <LI> pdbFileAppend(&pdb)
71 <LI> pdbFileFree(&pdb)
74 <LI> pdbFilePrint(fpt, &pdb);
75 <LI> pdbFileRecordPrint(fpt, &pdb);
76 <LI> pdbFileRecordTablePrint(fpt, &pdb);
79 <LI> pdbFileOneRecordCopy(&pdb, &src)
80 <LI> pdbFileCAOnlyCopyAll(&pdb, &src)
81 <LI> pdbFileCopyAll(&pdb, &src)
82 <LI> pdbFileOneProteinCopy(&pdb, &src, num)
83 <LI> pdbFileCAOnlyCopyAll(&pdb, &src)
85 <LI> Translation and rotation <UL>
87 <LI> pdbMatrixFileRead
88 <LI> pdbMatrixFileWrite
89 <LI> pdbMatrixFileFormat
93 <DD> lpdb2mrc3d(&mrc, &pdb, &linfo, mode)
97 <A NAME="Information">
98 <H2>Information from source codes</H2>
107 ../src/lpdbCoordInfo.c:
109 ../src/lpdbSelectedAtom.c:
111 ../src/lpdbSurface.c:
113 ../src/pdbFileRead.c:
115 ../src/pdbFileWrite.c:
121 ../src/pdbRotation.c:
123 ../src/pdbSecondaryStructure.c:
140 # The latest update : %G% at %U%
142 #%Z% pdbFile.h ver %I%
143 #%Z% Created by tacyas
145 #%Z% Usage : pdbFile.h
150 #include "Matrix3D.h"
151 #include "mrcImage.h"
154 #define PDB_FILE_RECORD_FULL_LENGTH (80)
155 #define PDB_FILE_RECORD_START (0)
156 #define PDB_FILE_RECORD_LENGTH (6)
157 #define PDB_FILE_ATOM_NUMBER_START (6)
158 #define PDB_FILE_ATOM_NUMBER_LENGTH (5)
159 #define PDB_FILE_ATOM_NAME_START (12)
160 #define PDB_FILE_ATOM_NAME_LENGTH (4)
161 #define PDB_FILE_LOCATION_START (16)
162 #define PDB_FILE_LOCATION_LENGTH (1)
163 #define PDB_FILE_RESIDUE_START (17)
164 #define PDB_FILE_RESIDUE_LENGTH (3)
165 #define PDB_FILE_CHAIN_IDENT_START (21)
166 #define PDB_FILE_CHAIN_IDENT_LENGTH (1)
167 #define PDB_FILE_RESNUM_START (22)
168 #define PDB_FILE_RESNUM_LENGTH (4)
169 #define PDB_FILE_INSERTION_START (26)
170 #define PDB_FILE_INSERTION_LENGTH (1)
171 #define PDB_FILE_X_START (30)
172 #define PDB_FILE_X_LENGTH (8)
173 #define PDB_FILE_Y_START (38)
174 #define PDB_FILE_Y_LENGTH (8)
175 #define PDB_FILE_Z_START (46)
176 #define PDB_FILE_Z_LENGTH (8)
177 #define PDB_FILE_OCCUPANCY_START (54)
178 #define PDB_FILE_OCCUPANCY_LENGTH (6)
179 #define PDB_FILE_TEMPERATURE_START (60)
180 #define PDB_FILE_TEMPERATURE_LENGTH (6)
181 #define PDB_FILE_FOOT_START (67)
182 #define PDB_FILE_FOOT_LENGTH (3)
183 #define PDB_FILE_FOOTNOTE_START (70)
184 #define PDB_FILE_FOOTNOTE_LENGTH (10)
185 #define MAX_RESIDUE_NUMBER (20)
186 #define RESIDUE_ONECHAR_MODE (1)
187 #define RESIDUE_THREECHAR_MODE (3)
188 #define pdbRecordAtom ("ATOM ")
189 #define pdbRecordHeteroAtom ("HETATM")
190 #define pdbRecordHelix ("HELIX ")
191 #define pdbRecordSheet ("SHEET ")
192 #define pdbRecordTurn ("TURN ")
193 #define pdbRecordEnd ("END ")
198 typedef char pdbFileParaTypeCharacter;
199 typedef long pdbFileParaTypeInteger;
200 typedef float pdbFileParaTypeReal;
202 typedef struct residueName {
203 char residueName3[4];
204 char residueName1[2];
207 typedef struct pdbCoord {
208 pdbFileParaTypeReal x;
209 pdbFileParaTypeReal y;
210 pdbFileParaTypeReal z;
213 typedef enum pdbSecondaryStructureHelixClass {
214 HelixClassRightHandedAlpha = 1,
215 HelixClassRightHandedOmega = 2,
216 HelixClassRightHandedPi = 3,
217 HelixClassRightHandedGammda= 4,
218 HelixClassRightHanded310 = 5,
219 HelixClassLeftHandedAlpha = 6,
220 HelixClassLeftHandedOmega = 7,
221 HelixClassLeftHandedGammda = 9,
222 HelixClassPolyProline = 10,
223 } pdbSecondaryStructureHelixClass;
225 typedef struct pdbSecondaryStructureHelix {
226 int serNum; /* Serial Number */
227 char* helixID; /* HelixID : Three alpahnumeric characters */
228 /* informtion for the initial residue */
229 char* initResName;/* Name of the initial residue : Three alpahnumeric characters */
230 char initChainID; /* Chain identifier */
231 int initSeqNum; /* Sequence number of the initial residue */
233 /* informtion for the terminal residue */
234 char* endResName;/* Name of the initial residue : Three alpahnumeric characters */
235 char endChainID; /* Chain identifier */
236 int endSeqNum; /* Sequence number of the initial residue */
239 pdbSecondaryStructureHelixClass helixClass;
242 } pdbSecondaryStructureHelix;
244 typedef struct pdbSecondaryStructureSheet {
245 int strand; /* Strand number which starts 1 for eache strand wihtin a sheet and increases by one */
246 char* sheetID; /* Sheet ID */
247 int numStrands; /* Number of strands in sheet */
249 /* initial residue */
250 char* initResName;/* Name of the initial residue : Three alpahnumeric characters */
251 char initChainID; /* Chain identifier */
252 int initSeqNum; /* Sequence number of the initial residue */
255 /* informtion for the terminal residue */
256 char* endResName;/* Name of the initial residue : Three alpahnumeric characters */
257 char endChainID; /* Chain identifier */
258 int endSeqNum; /* Sequence number of the initial residue */
261 int sense; /* 0: first strand, 1: parallel, -1: anti-paralle */
263 char* curAtom; /* Registration. Atom name in current strand */
264 char* curResName; /* Registration. Residue name in current strand */
265 char curChainID; /* Registration. Chain ID in current strand */
266 int curResSeq; /* Registration. Res sequence in current strand */
267 char curICode; /* Registration. Insertion code in current strand */
269 char* prevAtom; /* Registration. Atom name in current strand */
270 char* prevResName; /* Registration. Residue name in current strand */
271 char prevChainID; /* Registration. Chain ID in current strand */
272 int prevResSeq; /* Registration. Res sequence in current strand */
273 char prevICode; /* Registration. Insertion code in current strand */
274 }pdbSecondaryStructureSheet;
277 typedef struct pdbSecondaryStructureTurn {
278 int serNum; /* Serial Number */
279 char* turnID; /* Turn ID : Three alpahnumeric characters */
280 /* informtion for the initial residue */
281 char* initResName;/* Name of the initial residue : Three alpahnumeric characters */
282 char initChainID; /* Chain identifier */
283 int initSeqNum; /* Sequence number of the initial residue */
285 /* informtion for the terminal residue */
286 char* endResName;/* Name of the initial residue : Three alpahnumeric characters */
287 char endChainID; /* Chain identifier */
288 int endSeqNum; /* Sequence number of the initial residue */
292 }pdbSecondaryStructureTurn;
294 typedef struct pdbSecondaryStructureNo {
295 int serNum; /* Serial Number */
296 char* noID; /* Turn ID : Three alpahnumeric characters */
297 /* informtion for the initial residue */
298 char* initResName;/* Name of the initial residue : Three alpahnumeric characters */
299 char initChainID; /* Chain identifier */
300 int initSeqNum; /* Sequence number of the initial residue */
302 /* informtion for the terminal residue */
303 char* endResName;/* Name of the initial residue : Three alpahnumeric characters */
304 char endChainID; /* Chain identifier */
305 int endSeqNum; /* Sequence number of the initial residue */
309 }pdbSecondaryStructureNo;
311 typedef enum pdbFileSecondaryStructureMode {
312 pdbFileSecondaryStructureModeNo = 0,
313 pdbFileSecondaryStructureModeHelix = 1,
314 pdbFileSecondaryStructureModeSheet = 2,
315 pdbFileSecondaryStructureModeTurn = 3
316 } pdbFileSecondaryStructureMode;
318 typedef struct pdbFileSecondaryStructureRecord pdbFileSecondaryStructureRecord;
319 struct pdbFileSecondaryStructureRecord {
320 pdbFileSecondaryStructureMode mode;
321 pdbSecondaryStructureHelix* helix;
322 pdbSecondaryStructureSheet* sheet;
323 pdbSecondaryStructureTurn* turn;
324 pdbSecondaryStructureNo* no;
326 pdbFileSecondaryStructureRecord* prev;
327 pdbFileSecondaryStructureRecord* next;
330 typedef struct pdbFileSecondaryStructure {
331 int nSecondaryStructure;
332 pdbFileSecondaryStructureRecord* top;
333 pdbFileSecondaryStructureRecord* SecondaryStructure;
334 } pdbFileSecondaryStructure;
336 typedef struct pdbRecord pdbRecord;
339 pdbFileParaTypeCharacter FullRecord[PDB_FILE_RECORD_FULL_LENGTH+1];
341 pdbFileParaTypeCharacter Record[PDB_FILE_RECORD_LENGTH+1];
343 /* ATOM and HETATM Record */
344 pdbFileParaTypeInteger AtomSerialNumber;
345 pdbFileParaTypeCharacter AtomName[PDB_FILE_ATOM_NAME_LENGTH+1];
346 pdbFileParaTypeCharacter LocationIndicator;
347 pdbFileParaTypeCharacter ResidueName[PDB_FILE_RESIDUE_LENGTH+1];
348 pdbFileParaTypeCharacter ChainIdentifier;
349 pdbFileParaTypeInteger ResidueSequenceNumber;
350 pdbFileParaTypeCharacter InsertionCode;
352 pdbFileParaTypeReal Occupancy;
353 pdbFileParaTypeReal TemperatureFactor;
354 pdbFileParaTypeInteger FootnoteNumber;
355 pdbFileParaTypeCharacter Footnote[PDB_FILE_FOOTNOTE_LENGTH+1];
362 typedef struct pdbFile {
365 pdbFileParaTypeInteger nAtom;
366 pdbFileSecondaryStructure second;
374 /* prototype begin */
375 /* in pdbFileRead.c */
376 extern void pdbFileRead(FILE* fpt, pdbFile* pdb);
377 /* in pdbFileWrite.c */
378 extern void pdbFileWrite(FILE* fpt, pdbFile* pdb);
379 extern void pdbFileWriteCoord(FILE* fpt, pdbFile* pdb);
380 /*werewolf presents*/
381 extern void pdbFileTableWrite(FILE* fpt, pdbFile* pdb);
382 extern void pdbFileWriteSecondaryStructure(FILE* fpt, pdbFileSecondaryStructure* second);
385 extern void pdbMatrixFileFormat(FILE* fpt);
386 extern void pdbMatrixFileRead(FILE* fpt, Matrix3D Matrix);
387 extern void pdbMatrixFileWrite(FILE* fpt, Matrix3D Matrix);
388 extern void pdbTrans(pdbFile* pdb, Matrix3D Matrix);
390 extern void pdbFileResidueSequenceNumberIncrementAll(pdbFile* pdb, int n);
391 extern void pdbFileResidueSequenceNumberIncrement(pdbFile* pdb, int n);
393 extern void pdbFileChainIdentifierSetAll(pdbFile* pdb, unsigned char c);
394 extern void pdbFileChainIdentifierSet(pdbFile* pdb, unsigned char c);
395 extern unsigned char pdbFileChainIdentifierGet(pdbFile* pdb);
397 extern pdbFileParaTypeReal pdbFileTemperatureFactorGet(pdbFile* pdb);
398 extern void pdbFileTemperatureFactorSet(pdbFile* pdb, double temp);
400 extern pdbFileParaTypeReal pdbFileOccupancyGet(pdbFile* pdb);
401 extern void pdbFileOccupancySet(pdbFile* pdb, double temp);
403 extern long pdbFileCoordSet(pdbFile* pdb, pdbFileParaTypeReal x, pdbFileParaTypeReal y, pdbFileParaTypeReal z);
405 extern long pdbFileCoordGet(pdbFile* pdb, pdbFileParaTypeReal* x, pdbFileParaTypeReal* y, pdbFileParaTypeReal* z);
406 extern long pdbFileResidueSequenceNumberGet(pdbFile* pdb);
407 extern char* pdbFileResidueNameGet(pdbFile* pdb,int mode);
409 extern pdbRecord* pdbFileTop(pdbFile* pdb);
410 extern pdbRecord* pdbFileTopPointer(pdbFile* pdb);
411 extern pdbRecord* pdbFileNext(pdbFile* pdb);
412 extern pdbRecord* pdbFileNextAtom(pdbFile* pdb);
413 extern pdbRecord* pdbFileNextCA(pdbFile* pdb);
414 extern pdbRecord* pdbFilePrev(pdbFile* pdb);
415 extern pdbRecord* pdbFilePrevAtom(pdbFile* pdb);
416 extern pdbRecord* pdbFilePrevCA(pdbFile* pdb);
417 extern long pdbFileEnd(pdbFile* pdb);
418 extern long pdbFileGoToEnd(pdbFile* pdb);
419 extern long pdbFileIsEndLine(pdbFile* pdb);
420 extern long pdbFileIsAtom(pdbFile* pdb);
421 extern long pdbRecordIsNearby(pdbRecord record1,pdbRecord record2);
422 extern long pdbFileIsCA(pdbFile* pdb);
423 extern long pdbFileIsNegative(pdbFile* pdb);
424 extern long pdbFileIsPositive(pdbFile* pdb);
425 extern long pdbFileIsCharge(pdbFile* pdb);
426 extern long pdbFileIsSecondaryStructure(pdbFile* pdb);
427 extern long pdbFileIsHelix(pdbFile* pdb);
428 extern long pdbFileIsSheet(pdbFile* pdb);
429 extern long pdbFileIsTurn(pdbFile* pdb);
430 extern pdbRecord* pdbFileNew(pdbFile* pdb);
431 extern pdbRecord* pdbFileAppend(pdbFile* pdb);
432 extern pdbRecord* pdbFileFree(pdbFile* pdb);
433 extern pdbRecord* pdbFileRecordPrint(FILE* fpt, pdbFile* pdb);
435 extern pdbFileParaTypeInteger pdbZValueGet(pdbFile* pdb);
436 /*werewolf presented*/
437 extern pdbRecord* pdbFileRecordTablePrint(FILE* fpt, pdbFile* pdb);
439 extern pdbFileSecondaryStructureRecord* pdbFileSecondaryStructureRecordPrint(FILE* fpt, pdbFileSecondaryStructureRecord* second);
440 extern pdbRecord* pdbFileCAOnlyCopy(pdbFile* pdb, pdbFile* src);
441 extern void pdbFileCAOnlyCopyAll(pdbFile* pdb, pdbFile* src);
442 extern void pdbFileCopyAll(pdbFile* dst, pdbFile* src);
443 extern void pdbFileAppendAll(pdbFile* dst, pdbFile* src);
444 extern pdbRecord* pdbFileOneRecordCopy(pdbFile* dst, pdbFile* src);
445 extern void pdbFileOneProteinCopy(pdbFile* dst, pdbFile* src, long num);
448 extern void pdbRotationFollowingEulerAngle(pdbFile* pdb, char Mode[4], pdbFileParaTypeReal rot1, pdbFileParaTypeReal rot2, pdbFileParaTypeReal rot3);
449 extern void pdbRotationFollowingEulerAngleInverse(pdbFile* pdb, char Mode[4], pdbFileParaTypeReal rot1, pdbFileParaTypeReal rot2, pdbFileParaTypeReal rot3);
450 extern void pdbRotationXYZ(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
451 extern void pdbRotationZYX(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
452 extern void pdbRotationZXY(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
453 extern void pdbRotationYXZ(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
455 extern int pdbSecondaryStructureSetFromPDB(pdbFile* pdb, pdbFileSecondaryStructure* second);
456 extern int pdbNoSecondaryStructureSetFromPDB(pdbFile* pdb, pdbFileSecondaryStructure* second);
457 extern int pdbSecondaryStructureAppend(pdbFileSecondaryStructure* second);
458 extern pdbFileSecondaryStructureMode pdbFileWithSecondaryStructure(pdbFile* pdb, pdbFileSecondaryStructure* second);
465 #endif /* PDB_FILE_H */