Class: Bio::PDB::Record::ATOM

Inherits:
Object
  • Object
show all
Includes:
Utils, Comparable
Defined in:
lib/bio/db/pdb/pdb.rb

Overview

ATOM record class

Constant Summary

Constant Summary

Constants included from Utils

Utils::ElementMass

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from Utils

acos, calculatePlane, #centreOfGravity, convert_to_xyz, dihedral_angle, distance, #finder, #geometricCentre, rad2deg, to_xyz

Instance Attribute Details

- (Object) anisou

ANISOU record



957
958
959
# File 'lib/bio/db/pdb/pdb.rb', line 957

def anisou
  @anisou
end

- (Object) residue

residue the atom belongs to.



951
952
953
# File 'lib/bio/db/pdb/pdb.rb', line 951

def residue
  @residue
end

- (Object) sigatm

SIGATM record



954
955
956
# File 'lib/bio/db/pdb/pdb.rb', line 954

def sigatm
  @sigatm
end

- (Object) ter

TER record



960
961
962
# File 'lib/bio/db/pdb/pdb.rb', line 960

def ter
  @ter
end

Instance Method Details

- (Object) <=>(other)

Sorts based on serial numbers



973
974
975
# File 'lib/bio/db/pdb/pdb.rb', line 973

def <=>(other)
  return serial <=> other.serial
end

- (Object) do_parse



977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
# File 'lib/bio/db/pdb/pdb.rb', line 977

def do_parse
  return self if @parsed or !@str
  self.serial     = @str[6..10].to_i
  self.name       = @str[12..15].strip
  self.altLoc     = @str[16..16]
  self.resName    = @str[17..19].strip
  self.chainID    = @str[21..21]
  self.resSeq     = @str[22..25].to_i
  self.iCode      = @str[26..26].strip
  self.x          = @str[30..37].to_f
  self.y          = @str[38..45].to_f
  self.z          = @str[46..53].to_f
  self.occupancy  = @str[54..59].to_f
  self.tempFactor = @str[60..65].to_f
  self.segID      = @str[72..75].to_s.rstrip
  self.element    = @str[76..77].to_s.lstrip
  self.charge     = @str[78..79].to_s.strip
  @parsed = true
  self
end

- (Object) to_a

Returns an array of the xyz positions



968
969
970
# File 'lib/bio/db/pdb/pdb.rb', line 968

def to_a
  [ x, y, z ]
end

- (Object) to_s



1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
# File 'lib/bio/db/pdb/pdb.rb', line 1045

def to_s
  atomname = justify_atomname
  sprintf("%-6s%5d %-4s%-1s%3s %-1s%4d%-1s   %8.3f%8.3f%8.3f%6.2f%6.2f      %-4s%2s%-2s\n",
          self.record_name,
          self.serial, 
          atomname,
          self.altLoc,
          self.resName,
          self.chainID,
          self.resSeq,
          self.iCode,
          self.x, self.y, self.z,
          self.occupancy,
          self.tempFactor,
          self.segID,
          self.element,
          self.charge)
end

- (Object) xyz

Returns a Coordinate class instance of the xyz positions



963
964
965
# File 'lib/bio/db/pdb/pdb.rb', line 963

def xyz
  Coordinate[ x, y, z ]
end