Class: Chem::MDL::MDLAtom

Inherits:
Object
  • Object
show all
Includes:
Atom, Transform::ThreeDimension
Defined in:
lib/chem/db/mdl.rb

Constant Summary collapse

Stereo =
{
  0 => :not_stereo,
  1 => :odd,
  2 => :even,
  3 => :either
}

Constants included from Atom

Atom::MDLAtomLineFormat

Instance Attribute Summary collapse

Attributes included from Atom

#color, #mass, #v_pos, #visible

Instance Method Summary collapse

Methods included from Transform::ThreeDimension

#z=

Methods included from Transform::TwoDimension

#pos, #x=, #y=

Methods included from Atom

#atomic_number, #electro_negativity, #natural_bond_order, #to_mdl, #to_sybyl, #weight

Constructor Details

#initialize(line) ⇒ MDLAtom

Returns a new instance of MDLAtom.



89
# File 'lib/chem/db/mdl.rb', line 89

def initialize line  ; @line              = line                       ; end

Instance Attribute Details

#numberObject

Returns the value of attribute number.



87
88
89
# File 'lib/chem/db/mdl.rb', line 87

def number
  @number
end

Instance Method Details

#chargeObject



99
# File 'lib/chem/db/mdl.rb', line 99

def charge           ; @charge          ||= @line[36..38].to_i         ; end

#elementObject

Returns atomic symbol



92
# File 'lib/chem/db/mdl.rb', line 92

def element          ; @element         ||= @line[30..32].strip.intern ; end

#exact_chargeObject



110
# File 'lib/chem/db/mdl.rb', line 110

def exact_charge     ; @exact_charge    ||= @line[66..68].to_i         ; end

#h0_designatorObject



105
# File 'lib/chem/db/mdl.rb', line 105

def h0_designator    ; @h0_designator   ||= @line[51..53].to_i         ; end

#hydrogen_countObject



101
# File 'lib/chem/db/mdl.rb', line 101

def hydrogen_count   ; @hydrogen_count  ||= @line[42..44].to_i         ; end

#inversionObject



109
# File 'lib/chem/db/mdl.rb', line 109

def inversion        ; @inversion       ||= @line[63..65].to_i         ; end

#mappingObject

54..56 Not used 57..59 Not used



108
# File 'lib/chem/db/mdl.rb', line 108

def mapping          ; @mapping         ||= @line[60..62].to_i         ; end

#mass_differenceObject

Difference from mass in periodic table.



98
# File 'lib/chem/db/mdl.rb', line 98

def mass_difference  ; @mass_difference ||= @line[33..35]              ; end

#stereo_care_boxObject



102
# File 'lib/chem/db/mdl.rb', line 102

def stereo_care_box  ; @stereo_care_box ||= @line[45..47].to_i         ; end

#stereo_parityObject



100
# File 'lib/chem/db/mdl.rb', line 100

def stereo_parity    ; @stereo_parity   ||= @line[39..41].to_i         ; end

#valenceObject



104
# File 'lib/chem/db/mdl.rb', line 104

def valence          ; @valence         ||= @line[48..50].to_i         ; end

#xObject



93
# File 'lib/chem/db/mdl.rb', line 93

def x                ; @x               ||= @line[0..9].to_f           ; end

#yObject



94
# File 'lib/chem/db/mdl.rb', line 94

def y                ; @y               ||= @line[10..19].to_f         ; end

#zObject

Coordinates for z-axis



96
# File 'lib/chem/db/mdl.rb', line 96

def z                ; @z               ||= @line[20..29].to_f         ; end