class Bio::PDB::Record::ATOM

ATOM record class

Attributes

anisou[RW]

ANISOU record

residue[RW]

residue the atom belongs to.

sigatm[RW]

SIGATM record

ter[RW]

TER record

Public Instance Methods

<=>(other) click to toggle source

Sorts based on serial numbers

    # File lib/bio/db/pdb/pdb.rb
974 def <=>(other)
975   return serial <=> other.serial
976 end
do_parse() click to toggle source
    # File lib/bio/db/pdb/pdb.rb
978 def do_parse
979   return self if @parsed or !@str
980   self.serial     = @str[6..10].to_i
981   self.name       = @str[12..15].strip
982   self.altLoc     = @str[16..16]
983   self.resName    = @str[17..19].strip
984   self.chainID    = @str[21..21]
985   self.resSeq     = @str[22..25].to_i
986   self.iCode      = @str[26..26].strip
987   self.x          = @str[30..37].to_f
988   self.y          = @str[38..45].to_f
989   self.z          = @str[46..53].to_f
990   self.occupancy  = @str[54..59].to_f
991   self.tempFactor = @str[60..65].to_f
992   self.segID      = @str[72..75].to_s.rstrip
993   self.element    = @str[76..77].to_s.lstrip
994   self.charge     = @str[78..79].to_s.strip
995   @parsed = true
996   self
997 end
to_a() click to toggle source

Returns an array of the xyz positions

    # File lib/bio/db/pdb/pdb.rb
969 def to_a
970   [ x, y, z ]
971 end
to_s() click to toggle source
     # File lib/bio/db/pdb/pdb.rb
1046 def to_s
1047   atomname = justify_atomname
1048   sprintf("%-6s%5d %-4s%-1s%3s %-1s%4d%-1s   %8.3f%8.3f%8.3f%6.2f%6.2f      %-4s%2s%-2s\n",
1049           self.record_name,
1050           self.serial, 
1051           atomname,
1052           self.altLoc,
1053           self.resName,
1054           self.chainID,
1055           self.resSeq,
1056           self.iCode,
1057           self.x, self.y, self.z,
1058           self.occupancy,
1059           self.tempFactor,
1060           self.segID,
1061           self.element,
1062           self.charge)
1063 end
xyz() click to toggle source

Returns a Coordinate class instance of the xyz positions

    # File lib/bio/db/pdb/pdb.rb
964 def xyz
965   Coordinate[ x, y, z ]
966 end