Class: Chem::MDL::MDLAtom
- Inherits:
-
Object
- Object
- Chem::MDL::MDLAtom
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
#z=
#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
#number ⇒ Object
Returns the value of attribute number.
100
101
102
|
# File 'lib/chem/db/mdl.rb', line 100
def number
@number
end
|
Instance Method Details
#charge ⇒ Object
112
|
# File 'lib/chem/db/mdl.rb', line 112
def charge ; @charge ||= @line[36..38].to_i ; end
|
#element ⇒ Object
105
|
# File 'lib/chem/db/mdl.rb', line 105
def element ; @element ||= @line[30..32].strip.intern ; end
|
#exact_charge ⇒ Object
123
|
# File 'lib/chem/db/mdl.rb', line 123
def exact_charge ; @exact_charge ||= @line[66..68].to_i ; end
|
#h0_designator ⇒ Object
118
|
# File 'lib/chem/db/mdl.rb', line 118
def h0_designator ; @h0_designator ||= @line[51..53].to_i ; end
|
#hydrogen_count ⇒ Object
114
|
# File 'lib/chem/db/mdl.rb', line 114
def hydrogen_count ; @hydrogen_count ||= @line[42..44].to_i ; end
|
#inversion ⇒ Object
122
|
# File 'lib/chem/db/mdl.rb', line 122
def inversion ; @inversion ||= @line[63..65].to_i ; end
|
#mapping ⇒ Object
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_difference ⇒ Object
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_box ⇒ Object
115
|
# File 'lib/chem/db/mdl.rb', line 115
def stereo_care_box ; @stereo_care_box ||= @line[45..47].to_i ; end
|
#stereo_parity ⇒ Object
113
|
# File 'lib/chem/db/mdl.rb', line 113
def stereo_parity ; @stereo_parity ||= @line[39..41].to_i ; end
|
#valence ⇒ Object
117
|
# File 'lib/chem/db/mdl.rb', line 117
def valence ; @valence ||= @line[48..50].to_i ; end
|
#x ⇒ Object
106
|
# File 'lib/chem/db/mdl.rb', line 106
def x ; @x ||= @line[0..9].to_f ; end
|
#y ⇒ Object
107
|
# File 'lib/chem/db/mdl.rb', line 107
def y ; @y ||= @line[10..19].to_f ; end
|
#z ⇒ Object
109
|
# File 'lib/chem/db/mdl.rb', line 109
def z ; @z ||= @line[20..29].to_f ; end
|