Class: Chem::MDL::MDLAtom

Inherits:
Object
  • Object
show all
Includes:
Atom
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

#cdk_atom, #color, #label, #mass, #ob_atom, #rings, #v_pos, #visible

Instance Method Summary collapse

Methods included from Atom

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

Methods included from Transform::ThreeDimension

#z=

Methods included from Transform::TwoDimension

#pos, #x=, #y=

Constructor Details

#initialize(line) ⇒ MDLAtom

Returns a new instance of MDLAtom.



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

def initialize line  ; @line              = line                       ; end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Chem::Atom

Instance Attribute Details

#numberObject

Returns the value of attribute number.



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

def number
  @number
end

Instance Method Details

#chargeObject



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

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

#elementObject

Returns atomic symbol



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

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

#exact_chargeObject



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

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

#h0_designatorObject



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

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

#hydrogen_countObject



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

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

#inversionObject



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

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

#mappingObject

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



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

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

#mass_differenceObject

Difference from mass in periodic table.



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

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

#stereo_care_boxObject



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

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

#stereo_parityObject



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

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

#valenceObject



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

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

#xObject



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

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

#yObject



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

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

#zObject

Coordinates for z-axis



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

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