class pdb.PdbAtom

Available on all platforms

Container for ATOM or HETATM entry of pdb file.

Class Fields

static function elementName(n:String):String

return element name of atom name n. This function assumes the name n does not contain non-alphabet characters. If your input name contains number such as HG2, use guessElementName.

static function genBondXml(a0:PdbAtom, a1:PdbAtom):String

returns WMXML style xml data of bond between two PdbAtoms, a0 and a1, as a string.

static function getColor(e:String):String

returns the predefined color of the element. e is the element name, and the return value is the color name in string such as "white", "lime".

static function getDistance(a0:PdbAtom, a1:PdbAtom):Float

returns the distance between two PdbAtoms, a0 and a1.

static function getRadii(e:String):Float

Tentatively defined atomic radius; there is no physical/chemical meaning. e is the element name such as H, C, O, and the return value is the radius of the element in angstrom.

static function guessElementName(n:String):String

guess element name from atom name n. return value is the name of the element.

static function readFromText(text:String):Dynamic

read a string and returns the atom data. The return value is an anonymous container. Components are:

  • ci: chain id
  • het: is hetero atom (bool)
  • rn: residue name
  • ri: residue index
  • at: atom data of PdbAtom type

Instance Fields

var altpos:Array<Point3D>

alternate positions; not often used

var bfactor:Float

bfactor in pdb record

var element:String

element name of this atom

var index:Int

atom index; 2nd column in ATOM or HETATM record

var name:String

atom name; 3rd column in ATOM or HETATM record

var occupancy:Float

occupancy in pdb record

var pos:Point3D

position of this atom

function new(n:String, i:Int, p:Point3D, oc:Float, bf:Float, e:String):Void

Constructor.

  • n: atom name
  • i: atom index
  • p: atom position
  • oc: occupancy
  • bf: B factor
  • e: element name

function addAlternatePos(p:Point3D):Void

add an alternate position to this atom

function clone():PdbAtom

returns clone of this instance.

function genAtomXml():String

returns ATOM record for WMXML xml of this atom.

function get_altpos():Array<Point3D>

getter of altpos

function get_bfactor():Float

getter of bfactor

function get_element():String

getter of element

function get_index():Int

getter of index

function get_name():String

getter of name

function get_occupancy():Float

getter of occupancy

function get_pos():Point3D

getter of get_pos

function set_bfactor(f:Float):Float

setter of bfactor

function set_element(e:String):String

setter of element

function set_index(i:Int):Int

setter of index

function set_name(n:String):String

setter of name

function set_occupancy(o:Float):Float

setter of occupancy

function set_pos(p:Point3D):Point3D

setter of get_pos