Difference between revisions of "pdbFile(API)"

From EosPedia
Jump to: navigation, search
(Created page with "DataManip/'''pdbFile''' is API to treat PDB file. == constant == === Syntax for PDB file === ==== String length definition ==== #define PDB_FILE_RECORD_FULL_LENG...")
 
(Matrixによるアフィン変換)
 
(6 intermediate revisions by the same user not shown)
Line 48: Line 48:
  
 
=== Residue Name ===
 
=== Residue Name ===
residueName3: 3 characters, residueName1: 1 character
+
'''residueName3''': 3 characters, '''residueName1''': 1 character
 
  typedef struct residueName {
 
  typedef struct residueName {
 
   char residueName3[4];
 
   char residueName3[4];
 
   char residueName1[2];
 
   char residueName1[2];
 
  } residueName;
 
  } residueName;
Define the struct in header file, and define residue name in /pdbFile/src/pdbGet.c .
+
Define the struct in header file, and define residue name in '''/pdbFile/src/pdbGet.c'''.
 
  static residueName residue[MAX_RESIDUE_NUMBER] = {  
 
  static residueName residue[MAX_RESIDUE_NUMBER] = {  
 
  "ALA","A", "VAL","V", "PHE","F", "PRO","P",
 
  "ALA","A", "VAL","V", "PHE","F", "PRO","P",
Line 194: Line 194:
 
== struct ==
 
== struct ==
 
=== Management Data ===
 
=== Management Data ===
PDBdata及びその二次構造dataを管理する構造体です.
+
This is struct to manage PDB data and Secondary Structure data.
 
  typedef struct pdbFile {
 
  typedef struct pdbFile {
 
   pdbRecord* top;
 
   pdbRecord* top;
Line 203: Line 203:
 
<table border="1">
 
<table border="1">
 
<tr>  
 
<tr>  
<th>メンバ</th>  
+
<th>Member</th>  
 
<th>Description</th>  
 
<th>Description</th>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>top</td>  
 
<td>top</td>  
<td>先頭のPDBdata(ポインタ)</td>  
+
<td>Top PDB data(Pointer)</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>PDB</td>  
 
<td>PDB</td>  
<td>現在のPDBdata(ポインタ)</td>  
+
<td>Current PDB data(Pointer)</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>nAtom</td>  
 
<td>nAtom</td>  
<td>PDBdata数</td>  
+
<td>Number of PDB data</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>second</td>  
 
<td>second</td>  
<td>二次構造data</td>  
+
<td>Secondary Structure data</td>  
 
</tr>  
 
</tr>  
 
</table>
 
</table>
 
<br>
 
<br>
  
==== 二次構造管理data ====
+
==== Management Secondary Structure data ====
 
  typedef struct pdbFileSecondaryStructure {
 
  typedef struct pdbFileSecondaryStructure {
 
  int nSecondaryStructure;
 
  int nSecondaryStructure;
Line 233: Line 233:
 
<table border="1">
 
<table border="1">
 
<tr>  
 
<tr>  
<th>メンバ</th>  
+
<th>Member</th>  
 
<th>Description</th>  
 
<th>Description</th>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>nSecondaryStructure</td>  
 
<td>nSecondaryStructure</td>  
<td>二次構造data数</td>  
+
<td>Number of Secondary Structure data</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>top</td>  
 
<td>top</td>  
<td>先頭の二次構造data(ポインタ)</td>  
+
<td>Top Secondary Structure data(Pointer)</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>SecondaryStructure</td>  
 
<td>SecondaryStructure</td>  
<td>現在の二次構造data(ポインタ)</td>  
+
<td>Current Secondary Structure data(Pointer)</td>  
 
</tr>  
 
</tr>  
 
</table>
 
</table>
 
<br>
 
<br>
  
=== PDBdata ===
+
=== PDB data ===
[[PDB]]dataが格納されている構造体です.リスト構造で管理し,PDBfile一行分のdataに対応しています.
+
This is struct to store [[PDB]] data. Manage by list, and correspond one line PDB file data.
 
  typedef struct pdbRecord pdbRecord;
 
  typedef struct pdbRecord pdbRecord;
 
   
 
   
Line 279: Line 279:
 
<table border="1">
 
<table border="1">
 
<tr>  
 
<tr>  
<th>メンバ</th>  
+
<th>Member</th>  
 
<th>Description</th>  
 
<th>Description</th>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>FullRecord</td>  
 
<td>FullRecord</td>  
<td>一行分のPDBdata</td>  
+
<td>One line PDB data</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>Record</td>  
 
<td>Record</td>  
<td>原子Informationとしての一行分のPDBdata</td>  
+
<td>One line PDB data as Atom Information</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
Line 296: Line 296:
 
<tr>  
 
<tr>  
 
<td>AtomName</td>  
 
<td>AtomName</td>  
<td>原子名</td>  
+
<td>Atom Name</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
Line 304: Line 304:
 
<tr>  
 
<tr>  
 
<td>ResidueName</td>  
 
<td>ResidueName</td>  
<td>残基名</td>  
+
<td>Residue Name</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
Line 312: Line 312:
 
<tr>  
 
<tr>  
 
<td>ResidueSequenceNumber</td>  
 
<td>ResidueSequenceNumber</td>  
<td>残基配列番号</td>  
+
<td>Residue Sequence Number</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
Line 320: Line 320:
 
<tr>  
 
<tr>  
 
<td>Coord</td>  
 
<td>Coord</td>  
<td>原子のcoordinates</td>  
+
<td>Coordinates of Atom</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>Occupancy</td>  
 
<td>Occupancy</td>  
<td>占有率</td>  
+
<td>Occupancy</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>TemperatureFactor</td>  
 
<td>TemperatureFactor</td>  
<td>温度因子</td>  
+
<td>Temperature Factor</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
Line 340: Line 340:
 
<tr>  
 
<tr>  
 
<td>prev</td>  
 
<td>prev</td>  
<td>前data</td>  
+
<td>Previous data</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>next</td>  
 
<td>next</td>  
<td>次data</td>  
+
<td>Next data</td>  
 
</tr>  
 
</tr>  
 
</table>
 
</table>
Line 353: Line 353:
 
  typedef float pdbFileParaTypeReal;
 
  typedef float pdbFileParaTypeReal;
  
PDBfileのcoordinates
+
Coordinates of PDB data
 
  typedef struct pdbCoord {
 
  typedef struct pdbCoord {
 
   pdbFileParaTypeReal x;
 
   pdbFileParaTypeReal x;
Line 360: Line 360:
 
  } pdbCoord;
 
  } pdbCoord;
  
=== 二次構造 ===
+
=== Secondary Structure ===
二次構造dataが格納されている構造体です.リスト構造で管理し,二次構造一行分のdataに対応しています.
+
This is struct to store Secondary Structure data.Manage by list, and correspond one line Secondary Structure.
 
  typedef struct pdbFileSecondaryStructureRecord pdbFileSecondaryStructureRecord;  
 
  typedef struct pdbFileSecondaryStructureRecord pdbFileSecondaryStructureRecord;  
 
  struct pdbFileSecondaryStructureRecord {
 
  struct pdbFileSecondaryStructureRecord {
Line 375: Line 375:
 
<table border="1">
 
<table border="1">
 
<tr>  
 
<tr>  
<th>メンバ</th>  
+
<th>Member</th>  
 
<th>Description</th>  
 
<th>Description</th>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>mode</td>  
 
<td>mode</td>  
<td>二次構造のMode</td>  
+
<td>Secondary Structure Mode</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>helix</td>  
 
<td>helix</td>  
<td>ヘリックス構造のdata</td>  
+
<td>Helix Structure data</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>sheet</td>  
 
<td>sheet</td>  
<td>シート構造のdata</td>  
+
<td>Sheet Structure data</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>turn</td>  
 
<td>turn</td>  
<td>ターン構造のdata</td>  
+
<td>Turn Structure data</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>no</td>  
 
<td>no</td>  
<td>二次構造なしのdata</td>  
+
<td>Non Secondary Structure data</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>prev</td>  
 
<td>prev</td>  
<td>前data</td>  
+
<td>Previous data</td>  
 
</tr>  
 
</tr>  
 
<tr>  
 
<tr>  
 
<td>next</td>  
 
<td>next</td>  
<td>次data</td>  
+
<td>Next data</td>  
 
</tr>  
 
</tr>  
 
</table>
 
</table>
 
<br>
 
<br>
  
==== ヘリックス構造 ====
+
==== Helix Structure ====
 
  typedef struct pdbSecondaryStructureHelix {
 
  typedef struct pdbSecondaryStructureHelix {
 
  int  serNum;    /* Serial Number */
 
  int  serNum;    /* Serial Number */
Line 429: Line 429:
 
  } pdbSecondaryStructureHelix;
 
  } pdbSecondaryStructureHelix;
  
==== シート構造 ====
+
==== Sheet Structure ====
 
  typedef struct pdbSecondaryStructureSheet {
 
  typedef struct pdbSecondaryStructureSheet {
 
  int  strand; /* Strand number which starts 1 for eache strand wihtin a sheet and increases by one */   
 
  int  strand; /* Strand number which starts 1 for eache strand wihtin a sheet and increases by one */   
Line 462: Line 462:
 
  }pdbSecondaryStructureSheet;
 
  }pdbSecondaryStructureSheet;
  
==== ターン構造 ====
+
==== Turn Structure ====
 
  typedef struct pdbSecondaryStructureTurn {
 
  typedef struct pdbSecondaryStructureTurn {
 
  int  serNum;    /* Serial Number */
 
  int  serNum;    /* Serial Number */
Line 480: Line 480:
 
  }pdbSecondaryStructureTurn;
 
  }pdbSecondaryStructureTurn;
  
==== 二次構造なし ====
+
==== Non Secondary Structure ====
 
  typedef struct pdbSecondaryStructureNo {
 
  typedef struct pdbSecondaryStructureNo {
 
  int  serNum;    /* Serial Number */
 
  int  serNum;    /* Serial Number */
Line 499: Line 499:
  
 
== API ==
 
== API ==
=== file管理 ===
+
=== File Management ===
==== 読み出し ====
+
==== Read ====
filefptから読み出したdataを管理datapdbへ格納します.
+
Read data in file '''fpt''', and store to manage data '''pdb'''.
 
  extern void pdbFileRead(FILE* fpt, pdbFile* pdb);
 
  extern void pdbFileRead(FILE* fpt, pdbFile* pdb);
  
 
==== Write ====
 
==== Write ====
管理datapdbを[[PDB]]形式でfilefptへWriteます.(pdbFileRecordPrintを繰り返して使用)
+
Write manage data '''pdb''' to file '''fpt''' as [[PDB]]. (Repeat to use '''pdbFileRecordPrint''')
 
  extern void pdbFileWrite(FILE* fpt, pdbFile* pdb);
 
  extern void pdbFileWrite(FILE* fpt, pdbFile* pdb);
管理datapdbをtsv形式でfilefptへWriteます.(pdbFileRecordTablePrintを繰り返して使用)
+
Write manage data '''pdb''' to file '''fpt''' as tsv. (Repeat to use '''pdbFileRecordTablePrint''')
 
  extern void pdbFileTableWrite(FILE* fpt, pdbFile* pdb);  
 
  extern void pdbFileTableWrite(FILE* fpt, pdbFile* pdb);  
管理datapdbからcoordinatesリストのみをfilefptへWriteます.
+
Write coordinates list in manage data '''pdb''' to file '''fpt'''.
 
  extern void pdbFileWriteCoord(FILE* fpt, pdbFile* pdb);
 
  extern void pdbFileWriteCoord(FILE* fpt, pdbFile* pdb);
  
=== PDBdata処理 ===
+
=== Treat PDB data ===
==== 新規Create ====
+
==== New Create ====
pdb->PDBのdataに新規dataをCreateします.<br>
+
Create new data to '''pdb->PDB'''.<br>
メモリを確保して新規dataを作り,先頭dataとして,前,次のdataはNULLとします.
+
Create new data allocating memory. Then set it to top data. In addition, set NULL to the previous and the next data.
 
  extern pdbRecord* pdbFileNew(pdbFile* pdb);
 
  extern pdbRecord* pdbFileNew(pdbFile* pdb);
  
==== 追加 ====
+
==== Append ====
pdb->PDBのdataの後に新規dataを追加します.<br>
+
Create new data to next of '''pdb->PDB'''.<br>
メモリを確保して新規dataを作り,現在のdataとして,前を元のdata,次を元dataの次として,間に挿入します.
+
Create new data allocating memory. Then set it to current data, original data to previous data, and original next data to next data.
 
  extern pdbRecord* pdbFileAppend(pdbFile* pdb);
 
  extern pdbRecord* pdbFileAppend(pdbFile* pdb);
  
==== 解放 ====
+
==== Release ====
pdbのPDBdataを全て解放します.
+
Release all of PDB data in '''pdb'''.
 
  extern pdbRecord* pdbFileFree(pdbFile* pdb);
 
  extern pdbRecord* pdbFileFree(pdbFile* pdb);
  
 
==== Write ====
 
==== Write ====
pdb->PDBのdataを[[PDB]]形式でfilefptへ一行分Writeます.
+
Write '''pdb->PDB''' to file '''fpt''' as [[PDB]].
 
  extern pdbRecord* pdbFileRecordPrint(FILE* fpt, pdbFile* pdb);
 
  extern pdbRecord* pdbFileRecordPrint(FILE* fpt, pdbFile* pdb);
pdb->PDBのdataをtsv形式でfilefptへ一行分Writeます.
+
Write '''pdb->PDB''' to file '''fpt''' as tsv.
 
  extern pdbRecord* pdbFileRecordTablePrint(FILE* fpt, pdbFile* pdb);
 
  extern pdbRecord* pdbFileRecordTablePrint(FILE* fpt, pdbFile* pdb);
  
==== ポインタ移動 ====
+
==== Pointer move ====
先頭dataに移動します.
+
Move to top data.
 
  extern pdbRecord* pdbFileTop(pdbFile* pdb);
 
  extern pdbRecord* pdbFileTop(pdbFile* pdb);
先頭dataのポインタpdb->topを返します.
+
Return pointer of top data to '''pdb->top'''.
 
  extern pdbRecord* pdbFileTopPointer(pdbFile* pdb);
 
  extern pdbRecord* pdbFileTopPointer(pdbFile* pdb);
  
次dataに移動します.(該当無しの場合はNULLとします)
+
Move to next data.(If don't correspond, return NULL.)
 
  extern pdbRecord* pdbFileNext(pdbFile* pdb);
 
  extern pdbRecord* pdbFileNext(pdbFile* pdb);
次の原子dataに移動します.(該当無しの場合はNULLとします)
+
Move to next Atom data.(If don't correspond, return NULL.)
 
  extern pdbRecord* pdbFileNextAtom(pdbFile* pdb);
 
  extern pdbRecord* pdbFileNextAtom(pdbFile* pdb);
次のアルファ炭素dataに移動します.(該当無しの場合はNULLとします)
+
Move to next alpha carbon data.(If don't correspond, return NULL.)
 
  extern pdbRecord* pdbFileNextCA(pdbFile* pdb);
 
  extern pdbRecord* pdbFileNextCA(pdbFile* pdb);
  
前dataに移動します.(該当無しの場合はNULLとします)
+
Move to previous data.(If don't correspond, return NULL.)
 
  extern pdbRecord* pdbFilePrev(pdbFile* pdb);
 
  extern pdbRecord* pdbFilePrev(pdbFile* pdb);
前の原子dataに移動します.(該当無しの場合はNULLとします)
+
Move to previous Atom data.(If don't correspond, return NULL.)
 
  extern pdbRecord* pdbFilePrevAtom(pdbFile* pdb);
 
  extern pdbRecord* pdbFilePrevAtom(pdbFile* pdb);
前のアルファ炭素dataに移動します.(該当無しの場合はNULLとします)
+
Move to previous alpha carbon data.(If don't correspond, return NULL.)
 
  extern pdbRecord* pdbFilePrevCA(pdbFile* pdb);
 
  extern pdbRecord* pdbFilePrevCA(pdbFile* pdb);
  
末尾dataの場合は1,そうでない場合は0を返します.
+
Move to end data.
extern long pdbFileEnd(pdbFile* pdb);
+
末尾dataに移動します.
+
 
  extern long pdbFileGoToEnd(pdbFile* pdb);
 
  extern long pdbFileGoToEnd(pdbFile* pdb);
  
==== data判定 ====
+
==== Check Data ====
pdb->PDB->Recordが終端文字(END)の場合は1,そうでない場合は0を返します.
+
If end data, return 1. Otherwise, return 0.
 +
extern long pdbFileEnd(pdbFile* pdb);
 +
If '''pdb->PDB->Record''' is end character(END), return 1. Otherwise, return 0.
 
  extern long pdbFileIsEndLine(pdbFile* pdb);
 
  extern long pdbFileIsEndLine(pdbFile* pdb);
pdb->PDB->Recordが原子の場合は1,そうでない場合は0を返します.
+
If '''pdb->PDB->Record''' is Atom, return 1. Otherwise, return 0.
 
  extern long pdbFileIsAtom(pdbFile* pdb);
 
  extern long pdbFileIsAtom(pdbFile* pdb);
原子名pdb->PDB->AtomNameがアルファ炭素( CA )の場合は1,そうでない場合は0を返します.
+
If '''pdb->PDB->AtomName''' is alpha carbon( CA ), return 1. Otherwise, return 0.
 
  extern long pdbFileIsCA(pdbFile* pdb);
 
  extern long pdbFileIsCA(pdbFile* pdb);
原子名pdb->PDB->AtomNameから原子番号を返します.未対応の記号の場合は炭素として6を返します.
+
Return Z value from '''pdb->PDB->AtomName'''. If don't correspond, return 6 as carbon.
 
  extern pdbFileParaTypeInteger pdbZValueGet(pdbFile* pdb);
 
  extern pdbFileParaTypeInteger pdbZValueGet(pdbFile* pdb);
pdb->PDBの残基名(1文字)が"D"または"E"の場合は1,そうでない場合は0を返します.
+
If residue name of '''pdb->PDB'''  is "D" or "E", return 1. Otherwise, return 0.
 
  extern long pdbFileIsNegative(pdbFile* pdb);
 
  extern long pdbFileIsNegative(pdbFile* pdb);
pdb->PDBの残基名(1文字)が"K"または"R"の場合は1,そうでない場合は0を返します.
+
If residue name of '''pdb->PDB'''  is "K" or "R", return 1. Otherwise, return 0.
 
  extern long pdbFileIsPositive(pdbFile* pdb);
 
  extern long pdbFileIsPositive(pdbFile* pdb);
pdb->PDBの残基名(1文字)が"K", "R", "D", "E"のいずれかの場合は1,そうでない場合は0を返します.
+
If residue name of '''pdb->PDB'''  is "K", "R", "D", or "E", return 1. Otherwise, return 0.
 
  extern long pdbFileIsCharge(pdbFile* pdb);
 
  extern long pdbFileIsCharge(pdbFile* pdb);
ChainIDが同じで配列番号が隣同士の場合は1,そうでない場合は0を返します.
+
If records have same ChainID and their sequence number difference is 1, return 1. Otherwise, return 0.
 
  extern long pdbRecordIsNearby(pdbRecord record1,pdbRecord record2);
 
  extern long pdbRecordIsNearby(pdbRecord record1,pdbRecord record2);
  
==== dataSetting ====
+
==== Set data ====
coordinatespdb->PDB->Coordに(x, y, z)をSettingします.
+
Set ('''x''', '''y''', '''z''') to '''pdb->PDB->Coord'''.
 
  extern long pdbFileCoordSet(pdbFile* pdb, pdbFileParaTypeReal x, pdbFileParaTypeReal y, pdbFileParaTypeReal z);
 
  extern long pdbFileCoordSet(pdbFile* pdb, pdbFileParaTypeReal x, pdbFileParaTypeReal y, pdbFileParaTypeReal z);
温度因子pdb->PDB->TemperatureFactorにtempをSettingします.
+
Set '''temp''' to '''pdb->PDB->TemperatureFactor'''.
 
  extern void pdbFileTemperatureFactorSet(pdbFile* pdb, double temp);
 
  extern void pdbFileTemperatureFactorSet(pdbFile* pdb, double temp);
Chain ID pdb->PDB->ChainIdentifierにcをSettingします.
+
Set '''c''' to '''pdb->PDB->ChainIdentifier'''.
 
  extern void pdbFileChainIdentifierSet(pdbFile* pdb, unsigned char c);
 
  extern void pdbFileChainIdentifierSet(pdbFile* pdb, unsigned char c);
pdb内の全ての原子に対してChain IDをcにSettingします.
+
Set '''c''' to all Chain ID in '''pdb'''.
 
  extern void pdbFileChainIdentifierSetAll(pdbFile* pdb, unsigned char c);
 
  extern void pdbFileChainIdentifierSetAll(pdbFile* pdb, unsigned char c);
占有率pdb->PDB->OccupancyにtempをSettingします.
+
Set '''temp''' to '''pdb->PDB->Occupancy'''.
 
  extern void pdbFileOccupancySet(pdbFile* pdb, double temp);
 
  extern void pdbFileOccupancySet(pdbFile* pdb, double temp);
  
==== data取得 ====
+
==== Get data ====
(x, y, z)にpdb->PDB->CoordのcoordinatesをOutputします.
+
Output '''pdb->PDB->Coord''' to ('''x''', '''y''', '''z''').
 
  extern long pdbFileCoordGet(pdbFile* pdb, pdbFileParaTypeReal* x, pdbFileParaTypeReal* y, pdbFileParaTypeReal* z);
 
  extern long pdbFileCoordGet(pdbFile* pdb, pdbFileParaTypeReal* x, pdbFileParaTypeReal* y, pdbFileParaTypeReal* z);
残基配列番号pdb->PDB->ResidueSequenceNumberを返します.
+
Return '''pdb->PDB->ResidueSequenceNumber'''.
 
  extern long pdbFileResidueSequenceNumberGet(pdbFile* pdb);
 
  extern long pdbFileResidueSequenceNumberGet(pdbFile* pdb);
残基名を返します.(mode=RESIDUE_THREECHAR_MODE で3文字,そうでない場合は1文字)
+
Return residue name. (If mode=RESIDUE_THREECHAR_MODE, 3 characters. Otherwise, 1 character)
 
  extern char* pdbFileResidueNameGet(pdbFile* pdb,int mode);
 
  extern char* pdbFileResidueNameGet(pdbFile* pdb,int mode);
温度因子pdb->PDB->TemperatureFactorを返します.
+
Return '''pdb->PDB->TemperatureFactor'''.
 
  extern pdbFileParaTypeReal pdbFileTemperatureFactorGet(pdbFile* pdb);
 
  extern pdbFileParaTypeReal pdbFileTemperatureFactorGet(pdbFile* pdb);
Chain ID pdb->PDB->ChainIdentifierを返します.
+
Return '''pdb->PDB->ChainIdentifier'''.
 
  extern unsigned char pdbFileChainIdentifierGet(pdbFile* pdb);
 
  extern unsigned char pdbFileChainIdentifierGet(pdbFile* pdb);
占有率pdb->PDB->Occupancyを返します.
+
Return '''pdb->PDB->Occupancy'''.
 
  extern pdbFileParaTypeReal pdbFileOccupancyGet(pdbFile* pdb);
 
  extern pdbFileParaTypeReal pdbFileOccupancyGet(pdbFile* pdb);
  
==== data処理 ====
+
==== Increase ====
残基配列番号pdb->PDB->ResidueSequenceNumberを1つ増やします.
+
Increase '''pdb->PDB->ResidueSequenceNumber''' by 1..
 
  extern void pdbFileResidueSequenceNumberIncrement(pdbFile* pdb, int n);
 
  extern void pdbFileResidueSequenceNumberIncrement(pdbFile* pdb, int n);
pdb内の全ての原子に対して残基配列番号を1つ増やします.
+
Increase all Residue Sequence Number in '''pdb''' by 1.
 
  extern void pdbFileResidueSequenceNumberIncrementAll(pdbFile* pdb, int n);
 
  extern void pdbFileResidueSequenceNumberIncrementAll(pdbFile* pdb, int n);
  
==== コピー処理 ====
+
==== Copy ====
PDBdatasrc->PDBをdst->PDBへコピーします.<br>
+
Copy '''src->PDB''' to '''dst->PDB'''.<br>
このとき,前,次dataとの関係は保持されたままで,dst->PDBを返します.
+
Then, keep the relation to previous and next data, and return '''dst->PDB'''.
 
  extern pdbRecord* pdbFileOneRecordCopy(pdbFile* dst, pdbFile* src);
 
  extern pdbRecord* pdbFileOneRecordCopy(pdbFile* dst, pdbFile* src);
  
srcの全てのPDBdataをdstへ上書きコピーします.<br>
+
Copy all PDB data in '''src''' to '''dst''' with overwrite.<br>
コピーを行う際にdstに対してpdbFileNewを呼び出すので,dstをpdbFileFreeなどで解放してから使用して下さい.
+
Copy calling '''pdbFileNew''' for '''dst'''. So, you must release '''dst''' by '''pdbFileFree''' , before using it.
 
  extern void pdbFileCopyAll(pdbFile* dst, pdbFile* src);
 
  extern void pdbFileCopyAll(pdbFile* dst, pdbFile* src);
srcの全てのPDBdataをPDBdatadst->PDBの後に挿入します.<br>
+
Append all PDB data in '''src''', to next of '''dst->PDB'''.<br>
 
  extern void pdbFileAppendAll(pdbFile* dst, pdbFile* src);
 
  extern void pdbFileAppendAll(pdbFile* dst, pdbFile* src);
  
PDBdatasrc->PDBがアルファ炭素のときのみdst->PDBへコピーします.<br>
+
If '''src->PDB''' is alpha carbon, copy it to '''dst->PDB'''.<br>
このとき,,次dataとの関係は保持されたままで,コピーした場合はdst->PDB,されなかった場合はNULLを返します.
+
Then, keep the relation to previous and next data, and if the copy is succeed, return '''dst->PDB'''. Otherwise, return NULL.
 
  extern pdbRecord* pdbFileCAOnlyCopy(pdbFile* pdb, pdbFile* src);
 
  extern pdbRecord* pdbFileCAOnlyCopy(pdbFile* pdb, pdbFile* src);
  
srcの全てのアルファ炭素のPDBdataをdstへ上書きコピーします.<br>
+
Copy all alpha carbon data in '''src''' to '''dst''' with overwrite.<br>
コピーを行う際にdstに対してpdbFileNewを呼び出すので,dstをpdbFileFreeなどで解放してから使用して下さい.
+
Copy calling '''pdbFileNew''' for '''dst'''. So, you must release '''dst''' by '''pdbFileFree''' , before using it.
 
  extern void pdbFileCAOnlyCopyAll(pdbFile* pdb, pdbFile* src);
 
  extern void pdbFileCAOnlyCopyAll(pdbFile* pdb, pdbFile* src);
  
srcからdstへのタンパク質1つ分のdataをコピーします.<br>
+
Copy '''src''' to '''dst''' as one protein data.<br>
dstは予めpdbFileNewによりInitializeして使用して下さい.
+
You must initialize '''dst''' by '''pdbFileNew''' , before using it.
 
  extern void pdbFileOneProteinCopy(pdbFile* dst, pdbFile* src, long num);
 
  extern void pdbFileOneProteinCopy(pdbFile* dst, pdbFile* src, long num);
  
===二次構造===
+
===Secondary Structure===
==== 読み出し ====
+
==== Read ====
pdb->PDB->FullRecordから二次構造を読み取り,secondへ格納します.
+
Read Secondary Structure from '''pdb->PDB->FullRecord''', and store to '''second'''.
 
  extern int pdbSecondaryStructureSetFromPDB(pdbFile* pdb, pdbFileSecondaryStructure* second);
 
  extern int pdbSecondaryStructureSetFromPDB(pdbFile* pdb, pdbFileSecondaryStructure* second);
pdb->PDB->FullRecordから二次構造に含まれないアルファ炭素を読み取り,secondへ格納します.
+
Read alpha carbon which is out of Secondary Structure from '''pdb->PDB->FullRecord''', and store to '''second'''.
 
  extern int pdbNoSecondaryStructureSetFromPDB(pdbFile* pdb, pdbFileSecondaryStructure* second);
 
  extern int pdbNoSecondaryStructureSetFromPDB(pdbFile* pdb, pdbFileSecondaryStructure* second);
  
 
==== Write ====
 
==== Write ====
二次構造datasecondを[[PDB]]形式でfilefptへWriteます.(pdbFileSecondaryStructureRecordPrintを繰り返して使用)
+
Write Secondary Structure '''second''' to file '''fpt''' as [[PDB]]. (Repeat to use '''pdbFileSecondaryStructureRecordPrint''')
 
  extern void pdbFileWriteSecondaryStructure(FILE* fpt, pdbFileSecondaryStructure* second);
 
  extern void pdbFileWriteSecondaryStructure(FILE* fpt, pdbFileSecondaryStructure* second);
二次構造datasecondを[[PDB]]形式でfilefptへ一行分Writeます.
+
Write 1 line Secondary Structure '''second''' to file '''fpt''' as [[PDB]].
 
  extern pdbFileSecondaryStructureRecord* pdbFileSecondaryStructureRecordPrint(FILE* fpt, pdbFileSecondaryStructureRecord* second);
 
  extern pdbFileSecondaryStructureRecord* pdbFileSecondaryStructureRecordPrint(FILE* fpt, pdbFileSecondaryStructureRecord* second);
  
==== 追加 ====
+
==== Append ====
secondへメモリを確保して新規Createした二次構造dataを追加します.
+
Create new Secondary Structure data to '''second''', allocating memory.  
 
  extern int pdbSecondaryStructureAppend(pdbFileSecondaryStructure* second);
 
  extern int pdbSecondaryStructureAppend(pdbFileSecondaryStructure* second);
元々のdata数second->nSecondaryStructure=0の場合は,新規dataを先頭dataとして,前,次のdataはNULLとします.<br>
+
If second->nSecondaryStructure=0, set it to top data. In addition, set NULL to the previous and the next data.<br>
そうでない場合は,新規dataを現在のdataとして,前を元のdata,次を元dataの次として,間に挿入します.
+
Otherwise, set it to current data, original data to previous data, and original next data to next data.
  
 
==== data判定 ====
 
==== data判定 ====
二次構造(HELIX, SHEET, TURN)の場合は1,そうでない場合は0を返します.
+
If Secondary Structure(HELIX, SHEET, TURN), return 1. Otherwise, return 0.
 
  extern long pdbFileIsSecondaryStructure(pdbFile* pdb);
 
  extern long pdbFileIsSecondaryStructure(pdbFile* pdb);
ヘリックス構造(HELIX)の場合は1,そうでない場合は0を返します.
+
If Helix Structure(HELIX), return 1. Otherwise, return 0.
 
  extern long pdbFileIsHelix(pdbFile* pdb);
 
  extern long pdbFileIsHelix(pdbFile* pdb);
シート構造(SHEET)の場合は1,そうでない場合は0を返します.
+
If Sheet Structure(SHEET), return 1. Otherwise, return 0.
 
  extern long pdbFileIsSheet(pdbFile* pdb);
 
  extern long pdbFileIsSheet(pdbFile* pdb);
ターン構造(TURN)の場合は1,そうでない場合は0を返します.
+
If Turn Structure(TURN), return 1. Otherwise, return 0.
 
  extern long pdbFileIsTurn(pdbFile* pdb);
 
  extern long pdbFileIsTurn(pdbFile* pdb);
pdb->PDBがsecond->SecondaryStructureに含まれている場合にその二次元構造data,そうでない場合はpdbFileSecondaryStructureModeNoを返します.
+
If '''pdb->PDB''' is included by '''second->SecondaryStructure''', return the Secondary Structure data. Otherwise, return '''pdbFileSecondaryStructureModeNo'''.
 
  extern pdbFileSecondaryStructureMode pdbFileWithSecondaryStructure(pdbFile* pdb, pdbFileSecondaryStructure* second);
 
  extern pdbFileSecondaryStructureMode pdbFileWithSecondaryStructure(pdbFile* pdb, pdbFileSecondaryStructure* second);
  
=== Matrixによるアフィン変換 ===
+
=== Affine Transformation by Matrix ===
==== file処理 ====
+
==== Read and Write file ====
[[Matrix3D(API)#file処理]]を使用して,fileの処理を行います.
+
Process file by using [[Matrix3D(API)#Read and Write file]].
 
  extern void pdbMatrixFileFormat(FILE* fpt);
 
  extern void pdbMatrixFileFormat(FILE* fpt);
 
  extern void pdbMatrixFileRead(FILE* fpt, Matrix3D Matrix);
 
  extern void pdbMatrixFileRead(FILE* fpt, Matrix3D Matrix);
 
  extern void pdbMatrixFileWrite(FILE* fpt, Matrix3D Matrix);
 
  extern void pdbMatrixFileWrite(FILE* fpt, Matrix3D Matrix);
  
==== アフィン変換 ====
+
==== Affine Transformation ====
MatrixMatrixを使用して,pdbにアフィン変換を行います.
+
Perform Affine Trasformation by using '''Matrix'''.
 
  extern void pdbTrans(pdbFile* pdb, Matrix3D Matrix);
 
  extern void pdbTrans(pdbFile* pdb, Matrix3D Matrix);
 
  extern void pdbTransCuda(float* hv, int n, Matrix3D Matrix);
 
  extern void pdbTransCuda(float* hv, int n, Matrix3D Matrix);
  
[[Matrix3D(API)#アフィンMatrix]]を使用してMatrixをCreateし,pdbを回転します.<br>
+
Create a matrix by using [[Matrix3D(API)#Affine Matrix]], and rotate '''pdb'''.<br>
[[Euler Angle]]を使用した回転
+
Rotation with [[Euler Angle]]
 
  extern void pdbRotationFollowingEulerAngle(pdbFile* pdb, char Mode[4], pdbFileParaTypeReal rot1, pdbFileParaTypeReal rot2, pdbFileParaTypeReal rot3);
 
  extern void pdbRotationFollowingEulerAngle(pdbFile* pdb, char Mode[4], pdbFileParaTypeReal rot1, pdbFileParaTypeReal rot2, pdbFileParaTypeReal rot3);
 
  extern void pdbRotationFollowingEulerAngleInverse(pdbFile* pdb, char Mode[4], pdbFileParaTypeReal rot1, pdbFileParaTypeReal rot2, pdbFileParaTypeReal rot3);
 
  extern void pdbRotationFollowingEulerAngleInverse(pdbFile* pdb, char Mode[4], pdbFileParaTypeReal rot1, pdbFileParaTypeReal rot2, pdbFileParaTypeReal rot3);
指定したAxisの順番で回転
+
Rotation by specified order for axis
 
  extern void pdbRotationXYZ(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
 
  extern void pdbRotationXYZ(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
 
  extern void pdbRotationZYX(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
 
  extern void pdbRotationZYX(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
 
  extern void pdbRotationZXY(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
 
  extern void pdbRotationZXY(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
 
  extern void pdbRotationYXZ(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
 
  extern void pdbRotationYXZ(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);

Latest revision as of 07:54, 7 October 2014

DataManip/pdbFile is API to treat PDB file.

constant

Syntax for PDB file

String length definition

#define PDB_FILE_RECORD_FULL_LENGTH (80)
#define PDB_FILE_RECORD_START       (0)
#define PDB_FILE_RECORD_LENGTH      (6)
#define PDB_FILE_ATOM_NUMBER_START  (6)
#define PDB_FILE_ATOM_NUMBER_LENGTH (5)
#define PDB_FILE_ATOM_NAME_START    (12)
#define PDB_FILE_ATOM_NAME_LENGTH   (4)
#define PDB_FILE_LOCATION_START     (16)
#define PDB_FILE_LOCATION_LENGTH    (1)
#define PDB_FILE_RESIDUE_START      (17)
#define PDB_FILE_RESIDUE_LENGTH     (3)
#define PDB_FILE_CHAIN_IDENT_START  (21)
#define PDB_FILE_CHAIN_IDENT_LENGTH (1)
#define PDB_FILE_RESNUM_START       (22)
#define PDB_FILE_RESNUM_LENGTH      (4)
#define PDB_FILE_INSERTION_START    (26)
#define PDB_FILE_INSERTION_LENGTH   (1)
#define PDB_FILE_X_START            (30)
#define PDB_FILE_X_LENGTH           (8)
#define PDB_FILE_Y_START            (38)
#define PDB_FILE_Y_LENGTH           (8)
#define PDB_FILE_Z_START            (46)
#define PDB_FILE_Z_LENGTH           (8)
#define PDB_FILE_OCCUPANCY_START    (54)
#define PDB_FILE_OCCUPANCY_LENGTH   (6)
#define PDB_FILE_TEMPERATURE_START  (60)
#define PDB_FILE_TEMPERATURE_LENGTH (6)
#define PDB_FILE_FOOT_START         (67)
#define PDB_FILE_FOOT_LENGTH        (3)
#define PDB_FILE_FOOTNOTE_START     (70)
#define PDB_FILE_FOOTNOTE_LENGTH    (10)
#define MAX_RESIDUE_NUMBER          (20)
#define RESIDUE_ONECHAR_MODE        (1)
#define RESIDUE_THREECHAR_MODE      (3)

String definition

#define pdbRecordAtom       ("ATOM  ")
#define pdbRecordHeteroAtom ("HETATM")
#define pdbRecordHelix      ("HELIX ")
#define pdbRecordSheet      ("SHEET ")
#define pdbRecordTurn       ("TURN  ")
#define pdbRecordEnd        ("END   ")

Residue Name

residueName3: 3 characters, residueName1: 1 character

typedef struct residueName {
  char residueName3[4];
  char residueName1[2];
} residueName;

Define the struct in header file, and define residue name in /pdbFile/src/pdbGet.c.

static residueName residue[MAX_RESIDUE_NUMBER] = { 
"ALA","A", "VAL","V", "PHE","F", "PRO","P",
"MET","M", "ILE","I", "LEU","L", "ASP","D",
"GLU","E", "LYS","K", "ARG","R", "SER","S",
"THR","T", "TYR","Y", "HIS","H", "CYS","C",
"ASN","N", "GLN","Q", "TRP","W", "GLY","G"
};
Element No. residueName3 residueName1
0 ALA A
1 VAL V
2 PHE F
3 PRO P
4 MET M
5 ILE I
6 LEU L
7 ASP D
8 GLU E
9 LYS K
10 ARG R
11 SER S
12 THR T
13 TYR Y
14 HIS H
15 CYS C
16 ASN N
17 GLN Q
18 TRP W
19 GLY G


Secondary Structure

Secondary Structure Mode

typedef enum pdbFileSecondaryStructureMode {
	pdbFileSecondaryStructureModeNo    = 0,
	pdbFileSecondaryStructureModeHelix = 1,
	pdbFileSecondaryStructureModeSheet = 2,
	pdbFileSecondaryStructureModeTurn  = 3
} pdbFileSecondaryStructureMode;

Helix Structure

typedef enum pdbSecondaryStructureHelixClass {
	HelixClassRightHandedAlpha = 1,
	HelixClassRightHandedOmega = 2,
	HelixClassRightHandedPi    = 3,
	HelixClassRightHandedGammda= 4,
	HelixClassRightHanded310   = 5,
	HelixClassLeftHandedAlpha  = 6,
	HelixClassLeftHandedOmega  = 7,
	HelixClassLeftHandedGammda = 9,
	HelixClassPolyProline      = 10,
} pdbSecondaryStructureHelixClass;

struct

Management Data

This is struct to manage PDB data and Secondary Structure data.

typedef struct pdbFile {
  pdbRecord* top;
  pdbRecord* PDB;
  pdbFileParaTypeInteger nAtom;
  pdbFileSecondaryStructure second;
} pdbFile;
Member Description
top Top PDB data(Pointer)
PDB Current PDB data(Pointer)
nAtom Number of PDB data
second Secondary Structure data


Management Secondary Structure data

typedef struct pdbFileSecondaryStructure {
	int nSecondaryStructure;
	pdbFileSecondaryStructureRecord* top;
	pdbFileSecondaryStructureRecord* SecondaryStructure; 
} pdbFileSecondaryStructure;
Member Description
nSecondaryStructure Number of Secondary Structure data
top Top Secondary Structure data(Pointer)
SecondaryStructure Current Secondary Structure data(Pointer)


PDB data

This is struct to store PDB data. Manage by list, and correspond one line PDB file data.

typedef struct pdbRecord pdbRecord;

struct pdbRecord {
  pdbFileParaTypeCharacter FullRecord[PDB_FILE_RECORD_FULL_LENGTH+1];

  pdbFileParaTypeCharacter Record[PDB_FILE_RECORD_LENGTH+1];

/* ATOM and HETATM Record */
  pdbFileParaTypeInteger   AtomSerialNumber;
  pdbFileParaTypeCharacter AtomName[PDB_FILE_ATOM_NAME_LENGTH+1];
  pdbFileParaTypeCharacter LocationIndicator;
  pdbFileParaTypeCharacter ResidueName[PDB_FILE_RESIDUE_LENGTH+1];
  pdbFileParaTypeCharacter ChainIdentifier;
  pdbFileParaTypeInteger   ResidueSequenceNumber;
  pdbFileParaTypeCharacter InsertionCode;
  pdbCoord                 Coord;
  pdbFileParaTypeReal      Occupancy;
  pdbFileParaTypeReal      TemperatureFactor;
  pdbFileParaTypeInteger   FootnoteNumber;
  pdbFileParaTypeCharacter Footnote[PDB_FILE_FOOTNOTE_LENGTH+1];

  pdbRecord*               prev;
  pdbRecord*               next;
};
Member Description
FullRecord One line PDB data
Record One line PDB data as Atom Information
AtomSerialNumber
AtomName Atom Name
LocationIndicator
ResidueName Residue Name
ChainIdentifier Chain ID
ResidueSequenceNumber Residue Sequence Number
InsertionCode
Coord Coordinates of Atom
Occupancy Occupancy
TemperatureFactor Temperature Factor
FootnoteNumber
Footnote
prev Previous data
next Next data


typedef char  pdbFileParaTypeCharacter;
typedef long  pdbFileParaTypeInteger;
typedef float pdbFileParaTypeReal;

Coordinates of PDB data

typedef struct pdbCoord {
  pdbFileParaTypeReal x;
  pdbFileParaTypeReal y;
  pdbFileParaTypeReal z;
} pdbCoord;

Secondary Structure

This is struct to store Secondary Structure data.Manage by list, and correspond one line Secondary Structure.

typedef struct pdbFileSecondaryStructureRecord pdbFileSecondaryStructureRecord; 
struct pdbFileSecondaryStructureRecord {
	pdbFileSecondaryStructureMode mode;
	pdbSecondaryStructureHelix*   helix;
	pdbSecondaryStructureSheet*   sheet;
	pdbSecondaryStructureTurn*    turn;
	pdbSecondaryStructureNo*      no;

	pdbFileSecondaryStructureRecord* prev;
	pdbFileSecondaryStructureRecord* next;
};
Member Description
mode Secondary Structure Mode
helix Helix Structure data
sheet Sheet Structure data
turn Turn Structure data
no Non Secondary Structure data
prev Previous data
next Next data


Helix Structure

typedef struct pdbSecondaryStructureHelix {
	int  serNum;     	/* Serial Number */
	char* helixID;   	/* HelixID : Three alpahnumeric characters */
/* informtion for the initial residue */
	char* initResName;/* Name of the initial residue : Three alpahnumeric characters */ 
	char initChainID;  	/* Chain identifier */ 
	int  initSeqNum;    /* Sequence number of the initial residue */
	char initICode; 
/* informtion for the terminal residue */
	char* endResName;/* Name of the initial residue : Three alpahnumeric characters */ 
	char endChainID;  	/* Chain identifier */ 
	int  endSeqNum;    /* Sequence number of the initial residue */
	char endICode; 

	pdbSecondaryStructureHelixClass helixClass;
	char* comment; 
	int  length;
} pdbSecondaryStructureHelix;

Sheet Structure

typedef struct pdbSecondaryStructureSheet {
	int  strand; 		/* Strand number which starts 1 for eache strand wihtin a sheet and increases by one */  
	char* sheetID;    /* Sheet ID */			
	int  numStrands;    /* Number of strands in sheet */

/* initial residue */
	char* initResName;/* Name of the initial residue : Three alpahnumeric characters */ 
	char initChainID;  	/* Chain identifier */ 
	int  initSeqNum;    /* Sequence number of the initial residue */
	char initICode; 

/* informtion for the terminal residue */
	char* endResName;/* Name of the initial residue : Three alpahnumeric characters */ 
	char endChainID;  	/* Chain identifier */ 
	int  endSeqNum;    /* Sequence number of the initial residue */
	char endICode; 

	int sense;  /* 0: first strand, 1: parallel, -1: anti-paralle */ 

	char* curAtom; /* Registration. Atom name in current strand */
	char* curResName; /* Registration. Residue name in current strand */
	char curChainID; /* Registration. Chain ID in current strand */
	int  curResSeq;  /* Registration. Res sequence in current strand */
	char curICode;  /* Registration. Insertion code in current strand */

	char* prevAtom; /* Registration. Atom name in current strand */
	char* prevResName; /* Registration. Residue name in current strand */
	char prevChainID; /* Registration. Chain ID in current strand */
	int prevResSeq;  /* Registration. Res sequence in current strand */
	char prevICode;  /* Registration. Insertion code in current strand */
}pdbSecondaryStructureSheet;

Turn Structure

typedef struct pdbSecondaryStructureTurn {
	int  serNum;     	/* Serial Number */
	char* turnID;   	/* Turn ID : Three alpahnumeric characters */
/* informtion for the initial residue */
	char* initResName;/* Name of the initial residue : Three alpahnumeric characters */ 
	char initChainID;  	/* Chain identifier */ 
	int  initSeqNum;    /* Sequence number of the initial residue */
	char initICode; 
/* informtion for the terminal residue */
	char* endResName;/* Name of the initial residue : Three alpahnumeric characters */ 
	char endChainID;  	/* Chain identifier */ 
	int  endSeqNum;    /* Sequence number of the initial residue */
	char endICode; 

	char* comment; 
}pdbSecondaryStructureTurn;

Non Secondary Structure

typedef struct pdbSecondaryStructureNo {
	int   serNum;     	/* Serial Number */
	char* noID;   	    /* Turn ID : Three alpahnumeric characters */
/* informtion for the initial residue */
	char* initResName;/* Name of the initial residue : Three alpahnumeric characters */ 
	char initChainID;  	/* Chain identifier */ 
	int  initSeqNum;    /* Sequence number of the initial residue */
	char initICode; 
/* informtion for the terminal residue */
	char* endResName;/* Name of the initial residue : Three alpahnumeric characters */ 
	char endChainID;  	/* Chain identifier */ 
	int  endSeqNum;    /* Sequence number of the initial residue */
	char endICode; 

	char* comment; 
}pdbSecondaryStructureNo;

API

File Management

Read

Read data in file fpt, and store to manage data pdb.

extern void pdbFileRead(FILE* fpt, pdbFile* pdb);

Write

Write manage data pdb to file fpt as PDB. (Repeat to use pdbFileRecordPrint)

extern void pdbFileWrite(FILE* fpt, pdbFile* pdb);

Write manage data pdb to file fpt as tsv. (Repeat to use pdbFileRecordTablePrint)

extern void pdbFileTableWrite(FILE* fpt, pdbFile* pdb); 

Write coordinates list in manage data pdb to file fpt.

extern void pdbFileWriteCoord(FILE* fpt, pdbFile* pdb);

Treat PDB data

New Create

Create new data to pdb->PDB.
Create new data allocating memory. Then set it to top data. In addition, set NULL to the previous and the next data.

extern pdbRecord* pdbFileNew(pdbFile* pdb);

Append

Create new data to next of pdb->PDB.
Create new data allocating memory. Then set it to current data, original data to previous data, and original next data to next data.

extern pdbRecord* pdbFileAppend(pdbFile* pdb);

Release

Release all of PDB data in pdb.

extern pdbRecord* pdbFileFree(pdbFile* pdb);

Write

Write pdb->PDB to file fpt as PDB.

extern pdbRecord* pdbFileRecordPrint(FILE* fpt, pdbFile* pdb);

Write pdb->PDB to file fpt as tsv.

extern pdbRecord* pdbFileRecordTablePrint(FILE* fpt, pdbFile* pdb);

Pointer move

Move to top data.

extern pdbRecord* pdbFileTop(pdbFile* pdb);

Return pointer of top data to pdb->top.

extern pdbRecord* pdbFileTopPointer(pdbFile* pdb);

Move to next data.(If don't correspond, return NULL.)

extern pdbRecord* pdbFileNext(pdbFile* pdb);

Move to next Atom data.(If don't correspond, return NULL.)

extern pdbRecord* pdbFileNextAtom(pdbFile* pdb);

Move to next alpha carbon data.(If don't correspond, return NULL.)

extern pdbRecord* pdbFileNextCA(pdbFile* pdb);

Move to previous data.(If don't correspond, return NULL.)

extern pdbRecord* pdbFilePrev(pdbFile* pdb);

Move to previous Atom data.(If don't correspond, return NULL.)

extern pdbRecord* pdbFilePrevAtom(pdbFile* pdb);

Move to previous alpha carbon data.(If don't correspond, return NULL.)

extern pdbRecord* pdbFilePrevCA(pdbFile* pdb);

Move to end data.

extern long pdbFileGoToEnd(pdbFile* pdb);

Check Data

If end data, return 1. Otherwise, return 0.

extern long pdbFileEnd(pdbFile* pdb);

If pdb->PDB->Record is end character(END), return 1. Otherwise, return 0.

extern long pdbFileIsEndLine(pdbFile* pdb);

If pdb->PDB->Record is Atom, return 1. Otherwise, return 0.

extern long pdbFileIsAtom(pdbFile* pdb);

If pdb->PDB->AtomName is alpha carbon( CA ), return 1. Otherwise, return 0.

extern long pdbFileIsCA(pdbFile* pdb);

Return Z value from pdb->PDB->AtomName. If don't correspond, return 6 as carbon.

extern pdbFileParaTypeInteger pdbZValueGet(pdbFile* pdb);

If residue name of pdb->PDB is "D" or "E", return 1. Otherwise, return 0.

extern long pdbFileIsNegative(pdbFile* pdb);

If residue name of pdb->PDB is "K" or "R", return 1. Otherwise, return 0.

extern long pdbFileIsPositive(pdbFile* pdb);

If residue name of pdb->PDB is "K", "R", "D", or "E", return 1. Otherwise, return 0.

extern long pdbFileIsCharge(pdbFile* pdb);

If records have same ChainID and their sequence number difference is 1, return 1. Otherwise, return 0.

extern long pdbRecordIsNearby(pdbRecord record1,pdbRecord record2);

Set data

Set (x, y, z) to pdb->PDB->Coord.

extern long pdbFileCoordSet(pdbFile* pdb, pdbFileParaTypeReal x, pdbFileParaTypeReal y, pdbFileParaTypeReal z);

Set temp to pdb->PDB->TemperatureFactor.

extern void pdbFileTemperatureFactorSet(pdbFile* pdb, double temp);

Set c to pdb->PDB->ChainIdentifier.

extern void pdbFileChainIdentifierSet(pdbFile* pdb, unsigned char c);

Set c to all Chain ID in pdb.

extern void pdbFileChainIdentifierSetAll(pdbFile* pdb, unsigned char c);

Set temp to pdb->PDB->Occupancy.

extern void pdbFileOccupancySet(pdbFile* pdb, double temp);

Get data

Output pdb->PDB->Coord to (x, y, z).

extern long pdbFileCoordGet(pdbFile* pdb, pdbFileParaTypeReal* x, pdbFileParaTypeReal* y, pdbFileParaTypeReal* z);

Return pdb->PDB->ResidueSequenceNumber.

extern long pdbFileResidueSequenceNumberGet(pdbFile* pdb);

Return residue name. (If mode=RESIDUE_THREECHAR_MODE, 3 characters. Otherwise, 1 character)

extern char* pdbFileResidueNameGet(pdbFile* pdb,int mode);

Return pdb->PDB->TemperatureFactor.

extern pdbFileParaTypeReal pdbFileTemperatureFactorGet(pdbFile* pdb);

Return pdb->PDB->ChainIdentifier.

extern unsigned char pdbFileChainIdentifierGet(pdbFile* pdb);

Return pdb->PDB->Occupancy.

extern pdbFileParaTypeReal pdbFileOccupancyGet(pdbFile* pdb);

Increase

Increase pdb->PDB->ResidueSequenceNumber by 1..

extern void pdbFileResidueSequenceNumberIncrement(pdbFile* pdb, int n);

Increase all Residue Sequence Number in pdb by 1.

extern void pdbFileResidueSequenceNumberIncrementAll(pdbFile* pdb, int n);

Copy

Copy src->PDB to dst->PDB.
Then, keep the relation to previous and next data, and return dst->PDB.

extern pdbRecord* pdbFileOneRecordCopy(pdbFile* dst, pdbFile* src);

Copy all PDB data in src to dst with overwrite.
Copy calling pdbFileNew for dst. So, you must release dst by pdbFileFree , before using it.

extern void pdbFileCopyAll(pdbFile* dst, pdbFile* src);

Append all PDB data in src, to next of dst->PDB.

extern void pdbFileAppendAll(pdbFile* dst, pdbFile* src);

If src->PDB is alpha carbon, copy it to dst->PDB.
Then, keep the relation to previous and next data, and if the copy is succeed, return dst->PDB. Otherwise, return NULL.

extern pdbRecord* pdbFileCAOnlyCopy(pdbFile* pdb, pdbFile* src);

Copy all alpha carbon data in src to dst with overwrite.
Copy calling pdbFileNew for dst. So, you must release dst by pdbFileFree , before using it.

extern void pdbFileCAOnlyCopyAll(pdbFile* pdb, pdbFile* src);

Copy src to dst as one protein data.
You must initialize dst by pdbFileNew , before using it.

extern void pdbFileOneProteinCopy(pdbFile* dst, pdbFile* src, long num);

Secondary Structure

Read

Read Secondary Structure from pdb->PDB->FullRecord, and store to second.

extern int pdbSecondaryStructureSetFromPDB(pdbFile* pdb, pdbFileSecondaryStructure* second);

Read alpha carbon which is out of Secondary Structure from pdb->PDB->FullRecord, and store to second.

extern int pdbNoSecondaryStructureSetFromPDB(pdbFile* pdb, pdbFileSecondaryStructure* second);

Write

Write Secondary Structure second to file fpt as PDB. (Repeat to use pdbFileSecondaryStructureRecordPrint)

extern void pdbFileWriteSecondaryStructure(FILE* fpt, pdbFileSecondaryStructure* second);

Write 1 line Secondary Structure second to file fpt as PDB.

extern pdbFileSecondaryStructureRecord* pdbFileSecondaryStructureRecordPrint(FILE* fpt, pdbFileSecondaryStructureRecord* second);

Append

Create new Secondary Structure data to second, allocating memory.

extern int pdbSecondaryStructureAppend(pdbFileSecondaryStructure* second);

If second->nSecondaryStructure=0, set it to top data. In addition, set NULL to the previous and the next data.
Otherwise, set it to current data, original data to previous data, and original next data to next data.

data判定

If Secondary Structure(HELIX, SHEET, TURN), return 1. Otherwise, return 0.

extern long pdbFileIsSecondaryStructure(pdbFile* pdb);

If Helix Structure(HELIX), return 1. Otherwise, return 0.

extern long pdbFileIsHelix(pdbFile* pdb);

If Sheet Structure(SHEET), return 1. Otherwise, return 0.

extern long pdbFileIsSheet(pdbFile* pdb);

If Turn Structure(TURN), return 1. Otherwise, return 0.

extern long pdbFileIsTurn(pdbFile* pdb);

If pdb->PDB is included by second->SecondaryStructure, return the Secondary Structure data. Otherwise, return pdbFileSecondaryStructureModeNo.

extern pdbFileSecondaryStructureMode pdbFileWithSecondaryStructure(pdbFile* pdb, pdbFileSecondaryStructure* second);

Affine Transformation by Matrix

Read and Write file

Process file by using Matrix3D(API)#Read and Write file.

extern void pdbMatrixFileFormat(FILE* fpt);
extern void pdbMatrixFileRead(FILE* fpt, Matrix3D Matrix);
extern void pdbMatrixFileWrite(FILE* fpt, Matrix3D Matrix);

Affine Transformation

Perform Affine Trasformation by using Matrix.

extern void pdbTrans(pdbFile* pdb, Matrix3D Matrix);
extern void pdbTransCuda(float* hv, int n, Matrix3D Matrix);

Create a matrix by using Matrix3D(API)#Affine Matrix, and rotate pdb.
Rotation with Euler Angle

extern void pdbRotationFollowingEulerAngle(pdbFile* pdb, char Mode[4], pdbFileParaTypeReal rot1, pdbFileParaTypeReal rot2, pdbFileParaTypeReal rot3);
extern void pdbRotationFollowingEulerAngleInverse(pdbFile* pdb, char Mode[4], pdbFileParaTypeReal rot1, pdbFileParaTypeReal rot2, pdbFileParaTypeReal rot3);

Rotation by specified order for axis

extern void pdbRotationXYZ(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
extern void pdbRotationZYX(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
extern void pdbRotationZXY(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);
extern void pdbRotationYXZ(pdbFile* pdb, pdbFileParaTypeReal rotx, pdbFileParaTypeReal roty, pdbFileParaTypeReal rotz);