Class: Rafflesia::MoleculeDescriptors

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/molecules/molecule_descriptors.rb

Constant Summary collapse

HASH_ATTRS =
{
  aromatic_atoms: :aromatic_atoms,
  aromatic_fraction: :aromatic_fraction,
  hbond_acceptors: :hbond_acceptors,
  hbond_donors: :hbond_donors,
  heavy_atoms: :heavy_atoms,
  logp: :logp,
  molecular_weight: :molecular_weight,
  rings: :rings,
  rotatable_bonds: :rotatable_bonds,
  tpsa: :tpsa
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ MoleculeDescriptors

Returns a new instance of MoleculeDescriptors.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rafflesia/molecules/molecule_descriptors.rb', line 33

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @aromatic_atoms = hash[:aromatic_atoms]
  @aromatic_fraction = hash[:aromatic_fraction]
  @hbond_acceptors = hash[:hbond_acceptors]
  @hbond_donors = hash[:hbond_donors]
  @heavy_atoms = hash[:heavy_atoms]
  @logp = hash[:logp]
  @molecular_weight = hash[:molecular_weight]
  @rings = hash[:rings]
  @rotatable_bonds = hash[:rotatable_bonds]
  @tpsa = hash[:tpsa]
end

Instance Attribute Details

#aromatic_atomsObject

Returns the value of attribute aromatic_atoms.



21
22
23
# File 'lib/rafflesia/molecules/molecule_descriptors.rb', line 21

def aromatic_atoms
  @aromatic_atoms
end

#aromatic_fractionObject

Returns the value of attribute aromatic_fraction.



21
22
23
# File 'lib/rafflesia/molecules/molecule_descriptors.rb', line 21

def aromatic_fraction
  @aromatic_fraction
end

#hbond_acceptorsObject

Returns the value of attribute hbond_acceptors.



21
22
23
# File 'lib/rafflesia/molecules/molecule_descriptors.rb', line 21

def hbond_acceptors
  @hbond_acceptors
end

#hbond_donorsObject

Returns the value of attribute hbond_donors.



21
22
23
# File 'lib/rafflesia/molecules/molecule_descriptors.rb', line 21

def hbond_donors
  @hbond_donors
end

#heavy_atomsObject

Returns the value of attribute heavy_atoms.



21
22
23
# File 'lib/rafflesia/molecules/molecule_descriptors.rb', line 21

def heavy_atoms
  @heavy_atoms
end

#logpObject

Returns the value of attribute logp.



21
22
23
# File 'lib/rafflesia/molecules/molecule_descriptors.rb', line 21

def logp
  @logp
end

#molecular_weightObject

Returns the value of attribute molecular_weight.



21
22
23
# File 'lib/rafflesia/molecules/molecule_descriptors.rb', line 21

def molecular_weight
  @molecular_weight
end

#ringsObject

Returns the value of attribute rings.



21
22
23
# File 'lib/rafflesia/molecules/molecule_descriptors.rb', line 21

def rings
  @rings
end

#rotatable_bondsObject

Returns the value of attribute rotatable_bonds.



21
22
23
# File 'lib/rafflesia/molecules/molecule_descriptors.rb', line 21

def rotatable_bonds
  @rotatable_bonds
end

#tpsaObject

Returns the value of attribute tpsa.



21
22
23
# File 'lib/rafflesia/molecules/molecule_descriptors.rb', line 21

def tpsa
  @tpsa
end