Module: Chem::Atom
- Includes:
- Transform::ThreeDimension
- Included in:
- CDK::CDKAtom, CMLAtom, GSpanAtom, MDL::MDLAtom, MDL::RxnAtom, OpenBabel::OBAtom, SkeletonAtom, SmilesAtom, Sybyl::SybylAtom, TINKER::TinkerAtom, XYZ::XyzAtom, Record::HETATM
- Defined in:
- lib/chem/model.rb,
lib/chem.rb,
lib/chem/db/mdl.rb,
lib/chem/db/sybyl.rb,
lib/chem/db/vector.rb,
lib/chem/utils/cdk.rb,
lib/chem/utils/prop.rb,
lib/chem/utils/openbabel.rb,
lib/chem/utils/fingerprint.rb
Overview
CDK module
Constant Summary collapse
- MDLAtomLineFormat =
"%10.4f%10.4f%10.4f %2s%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d%3d"
Instance Attribute Summary collapse
-
#cdk_atom ⇒ Object
Returns the value of attribute cdk_atom.
-
#charge ⇒ Object
charge.
-
#color ⇒ Object
[r, g, b].
-
#element ⇒ Object
atomic symbol (Symbol object).
-
#label ⇒ Object
supplimentary information.
-
#mass ⇒ Object
Returns atomic mass.
-
#ob_atom ⇒ Object
Returns the value of attribute ob_atom.
-
#rings ⇒ Object
Returns the value of attribute rings.
-
#v_pos ⇒ Object
position vector for visualization.
-
#visible ⇒ Object
true if visible (for visualization).
-
#x ⇒ Object
x-axis position.
-
#y ⇒ Object
y-axis position.
-
#z ⇒ Object
z-axis position.
Instance Method Summary collapse
-
#atomic_number ⇒ Object
Returns Atomic Number.
-
#electro_negativity ⇒ Object
Returns electro negativity see chem/data/electronegativity.rb.
- #method_missing(m, *args) ⇒ Object
-
#natural_bond_order ⇒ Object
Returns Natural Bond Order of this atom :C => 4, :H => 1…
- #to_mdl(mapping = 0) ⇒ Object
- #to_sybyl ⇒ Object
-
#weight ⇒ Object
Returns Atomic weight see chem/data/atomic_weight.rb.
Methods included from Transform::TwoDimension
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
137 138 139 140 141 142 143 |
# File 'lib/chem.rb', line 137 def method_missing(m, *args) if not @ob_atom.nil? and @ob_atom.respond_to?(m) @ob_atom.__send__(m, *args) else super(m, *args) end end |
Instance Attribute Details
#cdk_atom ⇒ Object
Returns the value of attribute cdk_atom.
104 105 106 |
# File 'lib/chem/utils/cdk.rb', line 104 def cdk_atom @cdk_atom end |
#charge ⇒ Object
charge
37 38 39 |
# File 'lib/chem/model.rb', line 37 def charge @charge end |
#color ⇒ Object
- r, g, b
22 23 24 |
# File 'lib/chem/model.rb', line 22 def color @color end |
#element ⇒ Object
atomic symbol (Symbol object)
25 26 27 |
# File 'lib/chem/model.rb', line 25 def element @element end |
#label ⇒ Object
supplimentary information
29 30 31 |
# File 'lib/chem/db/vector.rb', line 29 def label @label end |
#mass ⇒ Object
Returns atomic mass
40 41 42 |
# File 'lib/chem/model.rb', line 40 def mass @mass end |
#ob_atom ⇒ Object
Returns the value of attribute ob_atom.
9 10 11 |
# File 'lib/chem/utils/openbabel.rb', line 9 def ob_atom @ob_atom end |
#rings ⇒ Object
Returns the value of attribute rings.
25 26 27 |
# File 'lib/chem/utils/fingerprint.rb', line 25 def rings @rings end |
#v_pos ⇒ Object
position vector for visualization
27 28 29 |
# File 'lib/chem/db/vector.rb', line 27 def v_pos @v_pos end |
#visible ⇒ Object
true if visible (for visualization)
20 21 22 |
# File 'lib/chem/model.rb', line 20 def visible @visible end |
#x ⇒ Object
x-axis position
28 29 30 |
# File 'lib/chem/model.rb', line 28 def x @x end |
#y ⇒ Object
y-axis position
31 32 33 |
# File 'lib/chem/model.rb', line 31 def y @y end |
#z ⇒ Object
z-axis position
34 35 36 |
# File 'lib/chem/model.rb', line 34 def z @z end |
Instance Method Details
#atomic_number ⇒ Object
Returns Atomic Number. If unknown return 100.
44 45 46 |
# File 'lib/chem/model.rb', line 44 def atomic_number Number2Element.index(element) ? Number2Element.index(element) : 100 end |
#electro_negativity ⇒ Object
Returns electro negativity see chem/data/electronegativity.rb
11 12 13 |
# File 'lib/chem/utils/prop.rb', line 11 def electro_negativity ElectroNegativity[self.element] end |
#natural_bond_order ⇒ Object
Returns Natural Bond Order of this atom :C => 4, :H => 1… see chem/data/character.rb
18 19 20 |
# File 'lib/chem/utils/prop.rb', line 18 def natural_bond_order NaturalBondOrder[self.element] end |
#to_mdl(mapping = 0) ⇒ Object
45 46 47 48 49 50 |
# File 'lib/chem/db/mdl.rb', line 45 def to_mdl(mapping = 0) self.x ||= 0 self.y ||= 0 self.z ||= 0 MDLAtomLineFormat % [x, y, z, element, 0, 0, 0, 0, 0, 0, 0, 0, 0, mapping, 0, 0] end |
#to_sybyl ⇒ Object
14 15 16 17 |
# File 'lib/chem/db/sybyl.rb', line 14 def to_sybyl " 1 C1 -3.262565 -0.588014 -0.082185 C.3 1 <1> -0.020001 " "%7d" % [1] end |
#weight ⇒ Object
Returns Atomic weight see chem/data/atomic_weight.rb
24 25 26 |
# File 'lib/chem/utils/prop.rb', line 24 def weight AtomicWeight[self.element] end |