Class | Bio::PDB::Record
In: | lib/bio/db/pdb/pdb.rb
Parent: | Struct

The ancestor of every single PDB record class. It inherits `Struct` class. Basically, each line of a PDB file corresponds to an instance of each corresponding child class. If continuation exists, multiple lines may correspond to single instance.

### Methods

add_continuation continue? continue? create_definition_hash def_rec do_parse each_symbol get_record_class initialize_from_string inspect new_direct new_inherit original_data record_name record_type symbols

### Included Modules

DataType

### Classes and Modules

Class Bio::PDB::Record::ANISOU
Class Bio::PDB::Record::ATOM
Class Bio::PDB::Record::HETATM
Class Bio::PDB::Record::Jrnl
Class Bio::PDB::Record::Remark1
Class Bio::PDB::Record::Remark2

### Constants

HEADER | = | def_rec([ 11, 50, Pdb_String, :classification ], #Pdb_String(40) [ 51, 59, Pdb_Date, :depDate ], [ 63, 66, Pdb_IDcode, :idCode ] |  | HEADER record class

OBSLTE

=

def_rec([ 9, 10, Pdb_Continuation, nil ], [ 12, 20, Pdb_Date, :repDate ], [ 22, 25, Pdb_IDcode, :idCode ], [ 32, 35, Pdb_IDcode, :rIdCode ], [ 37, 40, Pdb_IDcode, :rIdCode ], [ 42, 45, Pdb_IDcode, :rIdCode ], [ 47, 50, Pdb_IDcode, :rIdCode ], [ 52, 55, Pdb_IDcode, :rIdCode ], [ 57, 60, Pdb_IDcode, :rIdCode ], [ 62, 65, Pdb_IDcode, :rIdCode ], [ 67, 70, Pdb_IDcode, :rIdCode ]

OBSLTE record class

TITLE | = | def_rec([ 9, 10, Pdb_Continuation, nil ], [ 11, 70, Pdb_String, :title ] |  | TITLE record class
CAVEAT | = | def_rec([ 9, 10, Pdb_Continuation, nil ], [ 12, 15, Pdb_IDcode, :idcode ], [ 20, 70, Pdb_String, :comment ] |  | CAVEAT record class
COMPND | = | def_rec([ 9, 10, Pdb_Continuation, nil ], [ 11, 70, Pdb_Specification_list, :compound ] |  | COMPND record class
SOURCE | = | def_rec([ 9, 10, Pdb_Continuation, nil ], [ 11, 70, Pdb_Specification_list, :srcName ] |  | SOURCE record class
KEYWDS | = | def_rec([ 9, 10, Pdb_Continuation, nil ], [ 11, 70, Pdb_List, :keywds ] |  | KEYWDS record class
EXPDTA | = | def_rec([ 9, 10, Pdb_Continuation, nil ], [ 11, 70, Pdb_SList, :technique ] |  | EXPDTA record class
AUTHOR | = | def_rec([ 9, 10, Pdb_Continuation, nil ], [ 11, 70, Pdb_List, :authorList ] |  | AUTHOR record class
REVDAT | = | def_rec([ 8, 10, Pdb_Integer, :modNum ], [ 11, 12, Pdb_Continuation, nil ], [ 14, 22, Pdb_Date, :modDate ], [ 24, 28, Pdb_String, :modId ], # Pdb_String(5) [ 32, 32, Pdb_Integer, :modType ], [ 40, 45, Pdb_LString(6), :record ], [ 47, 52, Pdb_LString(6), :record ], [ 54, 59, Pdb_LString(6), :record ], [ 61, 66, Pdb_LString(6), :record ] |  | REVDAT record class

SPRSDE

=

def_rec([ 9, 10, Pdb_Continuation, nil ], [ 12, 20, Pdb_Date, :sprsdeDate ], [ 22, 25, Pdb_IDcode, :idCode ], [ 32, 35, Pdb_IDcode, :sIdCode ], [ 37, 40, Pdb_IDcode, :sIdCode ], [ 42, 45, Pdb_IDcode, :sIdCode ], [ 47, 50, Pdb_IDcode, :sIdCode ], [ 52, 55, Pdb_IDcode, :sIdCode ], [ 57, 60, Pdb_IDcode, :sIdCode ], [ 62, 65, Pdb_IDcode, :sIdCode ], [ 67, 70, Pdb_IDcode, :sIdCode ]

SPRSDE record class

JRNL | = | nil |  | ‘JRNL’ is defined below
REMARK | = | nil |  | ‘REMARK’ is defined below

DBREF

=

def_rec([ 8, 11, Pdb_IDcode, :idCode ], [ 13, 13, Pdb_Character, :chainID ], [ 15, 18, Pdb_Integer, :seqBegin ], [ 19, 19, Pdb_AChar, :insertBegin ], [ 21, 24, Pdb_Integer, :seqEnd ], [ 25, 25, Pdb_AChar, :insertEnd ], [ 27, 32, Pdb_String, :database ], #Pdb_LString [ 34, 41, Pdb_String, :dbAccession ], #Pdb_LString [ 43, 54, Pdb_String, :dbIdCode ], #Pdb_LString [ 56, 60, Pdb_Integer, :dbseqBegin ], [ 61, 61, Pdb_AChar, :idbnsBeg ], [ 63, 67, Pdb_Integer, :dbseqEnd ], [ 68, 68, Pdb_AChar, :dbinsEnd ]

DBREF record class

SEQADV

=

def_rec([ 8, 11, Pdb_IDcode, :idCode ], [ 13, 15, Pdb_Residue_name, :resName ], [ 17, 17, Pdb_Character, :chainID ], [ 19, 22, Pdb_Integer, :seqNum ], [ 23, 23, Pdb_AChar, :iCode ], [ 25, 28, Pdb_String, :database ], #Pdb_LString [ 30, 38, Pdb_String, :dbIdCode ], #Pdb_LString [ 40, 42, Pdb_Residue_name, :dbRes ], [ 44, 48, Pdb_Integer, :dbSeq ], [ 50, 70, Pdb_LString, :conflict ]

SEQADV record class

SEQRES

=

def_rec(#[ 9, 10, Pdb_Integer, :serNum ], [ 9, 10, Pdb_Continuation, nil ], [ 12, 12, Pdb_Character, :chainID ], [ 14, 17, Pdb_Integer, :numRes ], [ 20, 22, Pdb_Residue_name, :resName ], [ 24, 26, Pdb_Residue_name, :resName ], [ 28, 30, Pdb_Residue_name, :resName ], [ 32, 34, Pdb_Residue_name, :resName ], [ 36, 38, Pdb_Residue_name, :resName ], [ 40, 42, Pdb_Residue_name, :resName ], [ 44, 46, Pdb_Residue_name, :resName ], [ 48, 50, Pdb_Residue_name, :resName ], [ 52, 54, Pdb_Residue_name, :resName ], [ 56, 58, Pdb_Residue_name, :resName ], [ 60, 62, Pdb_Residue_name, :resName ], [ 64, 66, Pdb_Residue_name, :resName ], [ 68, 70, Pdb_Residue_name, :resName ]

SEQRES record class

MODRES | = | def_rec([ 8, 11, Pdb_IDcode, :idCode ], [ 13, 15, Pdb_Residue_name, :resName ], [ 17, 17, Pdb_Character, :chainID ], [ 19, 22, Pdb_Integer, :seqNum ], [ 23, 23, Pdb_AChar, :iCode ], [ 25, 27, Pdb_Residue_name, :stdRes ], [ 30, 70, Pdb_String, :comment ] |  | MODRS record class
HET | = | def_rec([ 8, 10, Pdb_LString(3), :hetID ], [ 13, 13, Pdb_Character, :ChainID ], [ 14, 17, Pdb_Integer, :seqNum ], [ 18, 18, Pdb_AChar, :iCode ], [ 21, 25, Pdb_Integer, :numHetAtoms ], [ 31, 70, Pdb_String, :text ] |  | HET record class
HETNAM | = | def_rec([ 9, 10, Pdb_Continuation, nil ], [ 12, 14, Pdb_LString(3), :hetID ], [ 16, 70, Pdb_String, :text ] |  | HETNAM record class
HETSYN | = | def_rec([ 9, 10, Pdb_Continuation, nil ], [ 12, 14, Pdb_LString(3), :hetID ], [ 16, 70, Pdb_SList, :hetSynonyms ] |  | HETSYN record class
FORMUL | = | def_rec([ 9, 10, Pdb_Integer, :compNum ], [ 13, 15, Pdb_LString(3), :hetID ], [ 17, 18, Pdb_Integer, :continuation ], [ 19, 19, Pdb_Character, :asterisk ], [ 20, 70, Pdb_String, :text ] |  | FORMUL record class

HELIX

=

def_rec([ 8, 10, Pdb_Integer, :serNum ], #[ 12, 14, Pdb_LString(3), :helixID ], [ 12, 14, Pdb_StringRJ, :helixID ], [ 16, 18, Pdb_Residue_name, :initResName ], [ 20, 20, Pdb_Character, :initChainID ], [ 22, 25, Pdb_Integer, :initSeqNum ], [ 26, 26, Pdb_AChar, :initICode ], [ 28, 30, Pdb_Residue_name, :endResName ], [ 32, 32, Pdb_Character, :endChainID ], [ 34, 37, Pdb_Integer, :endSeqNum ], [ 38, 38, Pdb_AChar, :endICode ], [ 39, 40, Pdb_Integer, :helixClass ], [ 41, 70, Pdb_String, :comment ], [ 72, 76, Pdb_Integer, :length ]

HELIX record class

SHEET

=

def_rec([ 8, 10, Pdb_Integer, :strand ], #[ 12, 14, Pdb_LString(3), :sheetID ], [ 12, 14, Pdb_StringRJ, :sheetID ], [ 15, 16, Pdb_Integer, :numStrands ], [ 18, 20, Pdb_Residue_name, :initResName ], [ 22, 22, Pdb_Character, :initChainID ], [ 23, 26, Pdb_Integer, :initSeqNum ], [ 27, 27, Pdb_AChar, :initICode ], [ 29, 31, Pdb_Residue_name, :endResName ], [ 33, 33, Pdb_Character, :endChainID ], [ 34, 37, Pdb_Integer, :endSeqNum ], [ 38, 38, Pdb_AChar, :endICode ], [ 39, 40, Pdb_Integer, :sense ], [ 42, 45, Pdb_Atom, :curAtom ], [ 46, 48, Pdb_Residue_name, :curResName ], [ 50, 50, Pdb_Character, :curChainId ], [ 51, 54, Pdb_Integer, :curResSeq ], [ 55, 55, Pdb_AChar, :curICode ], [ 57, 60, Pdb_Atom, :prevAtom ], [ 61, 63, Pdb_Residue_name, :prevResName ], [ 65, 65, Pdb_Character, :prevChainId ], [ 66, 69, Pdb_Integer, :prevResSeq ], [ 70, 70, Pdb_AChar, :prevICode ]

SHEET record class

TURN

=

def_rec([ 8, 10, Pdb_Integer, :seq ], #[ 12, 14, Pdb_LString(3), :turnId ], [ 12, 14, Pdb_StringRJ, :turnId ], [ 16, 18, Pdb_Residue_name, :initResName ], [ 20, 20, Pdb_Character, :initChainId ], [ 21, 24, Pdb_Integer, :initSeqNum ], [ 25, 25, Pdb_AChar, :initICode ], [ 27, 29, Pdb_Residue_name, :endResName ], [ 31, 31, Pdb_Character, :endChainId ], [ 32, 35, Pdb_Integer, :endSeqNum ], [ 36, 36, Pdb_AChar, :endICode ], [ 41, 70, Pdb_String, :comment ]

TURN record class

SSBOND

=

def_rec([ 8, 10, Pdb_Integer, :serNum ], [ 12, 14, Pdb_LString(3), :pep1 ], # "CYS" [ 16, 16, Pdb_Character, :chainID1 ], [ 18, 21, Pdb_Integer, :seqNum1 ], [ 22, 22, Pdb_AChar, :icode1 ], [ 26, 28, Pdb_LString(3), :pep2 ], # "CYS" [ 30, 30, Pdb_Character, :chainID2 ], [ 32, 35, Pdb_Integer, :seqNum2 ], [ 36, 36, Pdb_AChar, :icode2 ], [ 60, 65, Pdb_SymOP, :sym1 ], [ 67, 72, Pdb_SymOP, :sym2 ]

SSBOND record class

LINK

=

def_rec([ 13, 16, Pdb_Atom, :name1 ], [ 17, 17, Pdb_Character, :altLoc1 ], [ 18, 20, Pdb_Residue_name, :resName1 ], [ 22, 22, Pdb_Character, :chainID1 ], [ 23, 26, Pdb_Integer, :resSeq1 ], [ 27, 27, Pdb_AChar, :iCode1 ], [ 43, 46, Pdb_Atom, :name2 ], [ 47, 47, Pdb_Character, :altLoc2 ], [ 48, 50, Pdb_Residue_name, :resName2 ], [ 52, 52, Pdb_Character, :chainID2 ], [ 53, 56, Pdb_Integer, :resSeq2 ], [ 57, 57, Pdb_AChar, :iCode2 ], [ 60, 65, Pdb_SymOP, :sym1 ], [ 67, 72, Pdb_SymOP, :sym2 ]

LINK record class

HYDBND

=

def_rec([ 13, 16, Pdb_Atom, :name1 ], [ 17, 17, Pdb_Character, :altLoc1 ], [ 18, 20, Pdb_Residue_name, :resName1 ], [ 22, 22, Pdb_Character, :Chain1 ], [ 23, 27, Pdb_Integer, :resSeq1 ], [ 28, 28, Pdb_AChar, :ICode1 ], [ 30, 33, Pdb_Atom, :nameH ], [ 34, 34, Pdb_Character, :altLocH ], [ 36, 36, Pdb_Character, :ChainH ], [ 37, 41, Pdb_Integer, :resSeqH ], [ 42, 42, Pdb_AChar, :iCodeH ], [ 44, 47, Pdb_Atom, :name2 ], [ 48, 48, Pdb_Character, :altLoc2 ], [ 49, 51, Pdb_Residue_name, :resName2 ], [ 53, 53, Pdb_Character, :chainID2 ], [ 54, 58, Pdb_Integer, :resSeq2 ], [ 59, 59, Pdb_AChar, :iCode2 ], [ 60, 65, Pdb_SymOP, :sym1 ], [ 67, 72, Pdb_SymOP, :sym2 ]

HYDBND record class

SLTBRG

=

def_rec([ 13, 16, Pdb_Atom, :atom1 ], [ 17, 17, Pdb_Character, :altLoc1 ], [ 18, 20, Pdb_Residue_name, :resName1 ], [ 22, 22, Pdb_Character, :chainID1 ], [ 23, 26, Pdb_Integer, :resSeq1 ], [ 27, 27, Pdb_AChar, :iCode1 ], [ 43, 46, Pdb_Atom, :atom2 ], [ 47, 47, Pdb_Character, :altLoc2 ], [ 48, 50, Pdb_Residue_name, :resName2 ], [ 52, 52, Pdb_Character, :chainID2 ], [ 53, 56, Pdb_Integer, :resSeq2 ], [ 57, 57, Pdb_AChar, :iCode2 ], [ 60, 65, Pdb_SymOP, :sym1 ], [ 67, 72, Pdb_SymOP, :sym2 ]

SLTBRG record class

CISPEP

=

def_rec([ 8, 10, Pdb_Integer, :serNum ], [ 12, 14, Pdb_LString(3), :pep1 ], [ 16, 16, Pdb_Character, :chainID1 ], [ 18, 21, Pdb_Integer, :seqNum1 ], [ 22, 22, Pdb_AChar, :icode1 ], [ 26, 28, Pdb_LString(3), :pep2 ], [ 30, 30, Pdb_Character, :chainID2 ], [ 32, 35, Pdb_Integer, :seqNum2 ], [ 36, 36, Pdb_AChar, :icode2 ], [ 44, 46, Pdb_Integer, :modNum ], [ 54, 59, Pdb_Real('6.2'), :measure ]

CISPEP record class

SITE

=

def_rec([ 8, 10, Pdb_Integer, :seqNum ], [ 12, 14, Pdb_LString(3), :siteID ], [ 16, 17, Pdb_Integer, :numRes ], [ 19, 21, Pdb_Residue_name, :resName1 ], [ 23, 23, Pdb_Character, :chainID1 ], [ 24, 27, Pdb_Integer, :seq1 ], [ 28, 28, Pdb_AChar, :iCode1 ], [ 30, 32, Pdb_Residue_name, :resName2 ], [ 34, 34, Pdb_Character, :chainID2 ], [ 35, 38, Pdb_Integer, :seq2 ], [ 39, 39, Pdb_AChar, :iCode2 ], [ 41, 43, Pdb_Residue_name, :resName3 ], [ 45, 45, Pdb_Character, :chainID3 ], [ 46, 49, Pdb_Integer, :seq3 ], [ 50, 50, Pdb_AChar, :iCode3 ], [ 52, 54, Pdb_Residue_name, :resName4 ], [ 56, 56, Pdb_Character, :chainID4 ], [ 57, 60, Pdb_Integer, :seq4 ], [ 61, 61, Pdb_AChar, :iCode4 ]

SITE record class

CRYST1 | = | def_rec([ 7, 15, Pdb_Real('9.3'), :a ], [ 16, 24, Pdb_Real('9.3'), :b ], [ 25, 33, Pdb_Real('9.3'), :c ], [ 34, 40, Pdb_Real('7.2'), :alpha ], [ 41, 47, Pdb_Real('7.2'), :beta ], [ 48, 54, Pdb_Real('7.2'), :gamma ], [ 56, 66, Pdb_LString, :sGroup ], [ 67, 70, Pdb_Integer, :z ] |  | CRYST1 record class
ORIGX1 | = | def_rec([ 11, 20, Pdb_Real('10.6'), :On1 ], [ 21, 30, Pdb_Real('10.6'), :On2 ], [ 31, 40, Pdb_Real('10.6'), :On3 ], [ 46, 55, Pdb_Real('10.5'), :Tn ] |  | ORIGX1 record class ORIGXn n=1, 2, or 3
ORIGX2 | = | new_inherit(ORIGX1) |  | ORIGX2 record class
ORIGX3 | = | new_inherit(ORIGX1) |  | ORIGX3 record class
SCALE1 | = | def_rec([ 11, 20, Pdb_Real('10.6'), :Sn1 ], [ 21, 30, Pdb_Real('10.6'), :Sn2 ], [ 31, 40, Pdb_Real('10.6'), :Sn3 ], [ 46, 55, Pdb_Real('10.5'), :Un ] |  | SCALE1 record class SCALEn n=1, 2, or 3
SCALE2 | = | new_inherit(SCALE1) |  | SCALE2 record class
SCALE3 | = | new_inherit(SCALE1) |  | SCALE3 record class
MTRIX1 | = | def_rec([ 8, 10, Pdb_Integer, :serial ], [ 11, 20, Pdb_Real('10.6'), :Mn1 ], [ 21, 30, Pdb_Real('10.6'), :Mn2 ], [ 31, 40, Pdb_Real('10.6'), :Mn3 ], [ 46, 55, Pdb_Real('10.5'), :Vn ], [ 60, 60, Pdb_Integer, :iGiven ] |  | MTRIX1 record class MTRIXn n=1,2, or 3
MTRIX2 | = | new_inherit(MTRIX1) |  | MTRIX2 record class
MTRIX3 | = | new_inherit(MTRIX1) |  | MTRIX3 record class
TVECT | = | def_rec([ 8, 10, Pdb_Integer, :serial ], [ 11, 20, Pdb_Real('10.5'), :t1 ], [ 21, 30, Pdb_Real('10.5'), :t2 ], [ 31, 40, Pdb_Real('10.5'), :t3 ], [ 41, 70, Pdb_String, :text ] |  | TVECT record class
MODEL | = | def_rec([ 11, 14, Pdb_Integer, :serial ] |  | MODEL record class

ATOM

=

new_direct([ 7, 11, Pdb_Integer, :serial ], [ 13, 16, Pdb_Atom, :name ], [ 17, 17, Pdb_Character, :altLoc ], [ 18, 20, Pdb_Residue_name, :resName ], [ 22, 22, Pdb_Character, :chainID ], [ 23, 26, Pdb_Integer, :resSeq ], [ 27, 27, Pdb_AChar, :iCode ], [ 31, 38, Pdb_Real('8.3'), :x ], [ 39, 46, Pdb_Real('8.3'), :y ], [ 47, 54, Pdb_Real('8.3'), :z ], [ 55, 60, Pdb_Real('6.2'), :occupancy ], [ 61, 66, Pdb_Real('6.2'), :tempFactor ], [ 73, 76, Pdb_LString(4), :segID ], [ 77, 78, Pdb_LString(2), :element ], [ 79, 80, Pdb_LString(2), :charge ]

ATOM record class

SIGATM

=

def_rec([ 7, 11, Pdb_Integer, :serial ], [ 13, 16, Pdb_Atom, :name ], [ 17, 17, Pdb_Character, :altLoc ], [ 18, 20, Pdb_Residue_name, :resName ], [ 22, 22, Pdb_Character, :chainID ], [ 23, 26, Pdb_Integer, :resSeq ], [ 27, 27, Pdb_AChar, :iCode ], [ 31, 38, Pdb_Real('8.3'), :sigX ], [ 39, 46, Pdb_Real('8.3'), :sigY ], [ 47, 54, Pdb_Real('8.3'), :sigZ ], [ 55, 60, Pdb_Real('6.2'), :sigOcc ], [ 61, 66, Pdb_Real('6.2'), :sigTemp ], [ 73, 76, Pdb_LString(4), :segID ], [ 77, 78, Pdb_LString(2), :element ], [ 79, 80, Pdb_LString(2), :charge ]

SIGATM record class

ANISOU

=

def_rec([ 7, 11, Pdb_Integer, :serial ], [ 13, 16, Pdb_Atom, :name ], [ 17, 17, Pdb_Character, :altLoc ], [ 18, 20, Pdb_Residue_name, :resName ], [ 22, 22, Pdb_Character, :chainID ], [ 23, 26, Pdb_Integer, :resSeq ], [ 27, 27, Pdb_AChar, :iCode ], [ 29, 35, Pdb_Integer, :U11 ], [ 36, 42, Pdb_Integer, :U22 ], [ 43, 49, Pdb_Integer, :U33 ], [ 50, 56, Pdb_Integer, :U12 ], [ 57, 63, Pdb_Integer, :U13 ], [ 64, 70, Pdb_Integer, :U23 ], [ 73, 76, Pdb_LString(4), :segID ], [ 77, 78, Pdb_LString(2), :element ], [ 79, 80, Pdb_LString(2), :charge ]

ANISOU record class

SIGUIJ

=

def_rec([ 7, 11, Pdb_Integer, :serial ], [ 13, 16, Pdb_Atom, :name ], [ 17, 17, Pdb_Character, :altLoc ], [ 18, 20, Pdb_Residue_name, :resName ], [ 22, 22, Pdb_Character, :chainID ], [ 23, 26, Pdb_Integer, :resSeq ], [ 27, 27, Pdb_AChar, :iCode ], [ 29, 35, Pdb_Integer, :SigmaU11 ], [ 36, 42, Pdb_Integer, :SigmaU22 ], [ 43, 49, Pdb_Integer, :SigmaU33 ], [ 50, 56, Pdb_Integer, :SigmaU12 ], [ 57, 63, Pdb_Integer, :SigmaU13 ], [ 64, 70, Pdb_Integer, :SigmaU23 ], [ 73, 76, Pdb_LString(4), :segID ], [ 77, 78, Pdb_LString(2), :element ], [ 79, 80, Pdb_LString(2), :charge ]

SIGUIJ record class

TER | = | def_rec([ 7, 11, Pdb_Integer, :serial ], [ 18, 20, Pdb_Residue_name, :resName ], [ 22, 22, Pdb_Character, :chainID ], [ 23, 26, Pdb_Integer, :resSeq ], [ 27, 27, Pdb_AChar, :iCode ] |  | TER record class
HETATM | = | new_inherit(ATOM) |  | HETATM record class
ENDMDL | = | def_rec([ 2, 1, Pdb_Integer, :serial ] # dummy field (always 0) |  | ENDMDL record class

CONECT

=

def_rec([ 7, 11, Pdb_Integer, :serial ], [ 12, 16, Pdb_Integer, :serial ], [ 17, 21, Pdb_Integer, :serial ], [ 22, 26, Pdb_Integer, :serial ], [ 27, 31, Pdb_Integer, :serial ], [ 32, 36, Pdb_Integer, :serial ], [ 37, 41, Pdb_Integer, :serial ], [ 42, 46, Pdb_Integer, :serial ], [ 47, 51, Pdb_Integer, :serial ], [ 52, 56, Pdb_Integer, :serial ], [ 57, 61, Pdb_Integer, :serial ]

CONECT record class

MASTER

=

def_rec([ 11, 15, Pdb_Integer, :numRemark ], [ 16, 20, Pdb_Integer, "0" ], [ 21, 25, Pdb_Integer, :numHet ], [ 26, 30, Pdb_Integer, :numHelix ], [ 31, 35, Pdb_Integer, :numSheet ], [ 36, 40, Pdb_Integer, :numTurn ], [ 41, 45, Pdb_Integer, :numSite ], [ 46, 50, Pdb_Integer, :numXform ], [ 51, 55, Pdb_Integer, :numCoord ], [ 56, 60, Pdb_Integer, :numTer ], [ 61, 65, Pdb_Integer, :numConect ], [ 66, 70, Pdb_Integer, :numSeq ]

MASTER record class

RemarkN | = | def_rec([ 8, 10, Pdb_Integer, :remarkNum ], [ 12, 70, Pdb_LString, :text ] |  | REMARK record class for REMARK n (n>=3)
Default | = | def_rec([ 8, 70, Pdb_LString, :text ]) |  | default (or unknown) record class
Definition | = | create_definition_hash |  | definitions (hash)
End | = | def_rec([ 2, 1, Pdb_Integer, :serial ]) |  | END record class. Because END is a reserved word of Ruby, it is separately added to the hash

### Public Class methods

continue?()

Returns true if this record has a field type which allows continuations.

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 286
    286:       def self.continue?
    287:         @cont
    288:       end

create_definition_hash()

creates definition hash from current classes constants

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 437
    437:       def self.create_definition_hash
    438:         hash = {}
    439:         constants.each do |x|
    440:           x = x.intern # keep compatibility both Ruby 1.8 and 1.9
    441:           hash[x] = const_get(x) if /\A[A-Z][A-Z0-9]+\z/ =~ x.to_s
    442:         end
    443:         if x = const_get(:Default) then
    444:           hash.default = x
    445:         end
    446:         hash
    447:       end

def_rec(*ary)

Creates new class by given field definition The difference from new_direct() is the class created by the method does lazy evaluation.

Internal use only.

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 225
    225:       def self.def_rec(*ary)
    226:         symbolhash, symbolary, cont = parse_field_definitions(ary)
    227:
    228:         klass = Class.new(self.new(*symbolary))
    229:         klass.module_eval {
    230:           @definition = ary
    231:           @symbols = symbolhash
    232:           @cont = cont
    233:         }
    234:         klass.module_eval {
    235:           symbolary.each do |x|
    236:             define_method(x) { do_parse; super() }
    237:           end
    238:         }
    239:         klass
    240:       end

get_record_class(str)

Basically just look up the class in Definition hash do some munging for JRNL and REMARK

[Source]

          # File lib/bio/db/pdb/pdb.rb, line 1388
    1388:       def self.get_record_class(str)
    1389:         t = fetch_record_name(str)
    1390:         t = t.intern unless t.empty?
    1391:         if d = Definition[t] then
    1392:           return d
    1393:         end
    1394:         case t
    1395:         when :JRNL
    1396:           ts = str[12..15].to_s.strip
    1397:           ts = ts.intern unless ts.empty?
    1398:           d = Jrnl::Definition[ts]
    1399:         when :REMARK
    1400:           case str[7..9].to_i
    1401:           when 1
    1402:             ts = str[12..15].to_s.strip
    1403:             ts = ts.intern unless ts.empty?
    1404:             d = Remark1::Definition[ts]
    1405:           when 2
    1406:             if str[28..37] == 'ANGSTROMS.' then
    1407:               d = Remark2::ANGSTROMS
    1408:             elsif str[22..37] == ' NOT APPLICABLE.' then
    1409:               d = Remark2::NOT_APPLICABLE
    1410:             else
    1411:               d = Remark2::Default
    1412:             end
    1413:           else
    1414:             d = RemarkN
    1415:           end
    1416:         else
    1417:           # unknown field
    1418:           d = Default
    1419:         end
    1420:         return d
    1421:       end

new_direct(*ary)

Creates new class by given field definition.

Internal use only.

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 256
    256:       def self.new_direct(*ary)
    257:         symbolhash, symbolary, cont = parse_field_definitions(ary)
    258:         if cont
    259:           raise 'continuation not allowed. please use def_rec instead'
    260:         end
    261:
    262:         klass = Class.new(self.new(*symbolary))
    263:         klass.module_eval {
    264:           @definition = ary
    265:           @symbols = symbolhash
    266:           @cont = cont
    267:         }
    268:         klass.module_eval {
    269:           define_method(:initialize_from_string) { |str|
    270:             r = super(str)
    271:             do_parse
    272:             r
    273:           }
    274:         }
    275:         klass
    276:       end

new_inherit(klass)

creates new class which inherits given class.

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 243
    243:       def self.new_inherit(klass)
    244:         newklass = Class.new(klass)
    245:         newklass.module_eval {
    246:           @definition = klass.module_eval { @definition }
    247:           @symbols    = klass.module_eval { @symbols }
    248:           @cont       = klass.module_eval { @cont }
    249:         }
    250:         newklass
    251:       end

symbols()

symbols

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 279
    279:       def self.symbols
    280:         #p self
    281:         @symbols
    282:       end

### Public Instance methods

add_continuation(str)

Internal use only.

Adds continuation data to the record from str if str is really the continuation of current record. Returns self (= not nil) if str is the continuation. Otherwaise, returns false.

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 420
    420:       def add_continuation(str)
    421:         #Check that this record can continue
    422:         #and that str has the same type and definition
    423:         return false unless self.continue?
    424:         return false unless fetch_record_name(str) == @record_name
    425:         return false unless self.class.get_record_class(str) == self.class
    426:         return false unless fetch_cont(str) >= 2
    427:         #If all this is OK then add onto @cont_data
    428:         unless defined?(@cont_data)
    429:           @cont_data = []
    430:         end
    431:         @cont_data << str
    432:         # Returns self (= not nil) if succeeded.
    433:         self
    434:       end

continue?()

Returns true if this record has a field type which allows continuations.

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 292
    292:       def continue?
    293:         self.class.continue?
    294:       end

do_parse()

In order to speeding up processing of PDB file format, fields have not been parsed before calling this method.

Normally, it is automatically called and you don‘t explicitly need to call it .

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 340
    340:       def do_parse
    341:         return self if @parsed or !@str
    342:         str = @str
    343:         each_symbol do |key, klass, ranges|
    344:           #If we only have one range then pull that out
    345:           #and store it in the hash
    346:           if ranges.size <= 1 then
    347:             self[key] = klass.new(str[ranges.first])
    348:           else
    349:             #Go through each range and add the string to an array
    350:             #set the hash key to point to that array
    351:             ary = []
    352:             ranges.each do |r|
    353:               ary << klass.new(str[r]) unless str[r].to_s.strip.empty?
    354:             end
    355:             self[key] = ary
    356:           end
    357:         end #each_symbol
    358:         #If we have continuations then for each line of extra data...
    359:         if defined?(@cont_data) then
    360:           @cont_data.each do |str|
    361:             #Get the symbol, type and range array
    362:             each_symbol do |key, klass, ranges|
    363:               #If there's one range then grab that range
    364:               if ranges.size <= 1 then
    365:                 r = ranges.first
    366:                 unless str[r].to_s.strip.empty?
    367:                   #and concatenate the new data onto the old
    368:                   v = klass.new(str[r])
    369:                   self[key].concat(v) if self[key] != v
    370:                 end
    371:               else
    372:                 #If there's more than one range then add to the array
    373:                 ary = self[key]
    374:                 ranges.each do |r|
    375:                   ary << klass.new(str[r]) unless str[r].to_s.strip.empty?
    376:                 end
    377:               end
    378:             end
    379:           end
    380:         end
    381:         @parsed = true
    382:         self
    383:       end

each_symbol() {|k, x[0], x[1]| ...}

yields the symbol(k), type(x[0]) and array of ranges of each symbol.

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 298
    298:       def each_symbol
    299:         self.class.symbols.each do |k, x|
    300:           yield k, x[0], x[1]
    301:         end
    302:       end

initialize_from_string(str)

initialize this record from the given string. str must be a line (in PDB format).

You can add continuation lines later using `add_continuation` method.

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 322
    322:       def initialize_from_string(str)
    323:         @str = str
    324:         @record_name = fetch_record_name(str)
    325:         @parsed = false
    326:         self
    327:       end

inspect()

same as Struct#inspect.

Note that `do_parse` is automatically called before `inspect`.

(Warning: The do_parse might sweep hidden bugs in PDB classes.)

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 455
    455:       def inspect
    456:         do_parse
    457:         super
    458:       end

original_data()

Return original string (except that "\n" are truncated) for this record (usually just @str, but sometimes add on the continuation data from other lines. Returns an array of string.

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 309
    309:       def original_data
    310:         if defined?(@cont_data) then
    311:           [ @str, *@cont_data ]
    312:         else
    313:           [ @str ]
    314:         end
    315:       end

record_name()

Record name of this record, e.g. "HEADER", "ATOM".

[Source]

         # File lib/bio/db/pdb/pdb.rb, line 407
    407:       def record_name
    408:         @record_name or self.class.to_s.split(/\:\:/)[-1].to_s.upcase
    409:       end

record_type()

Alias for record_name

[Validate]