Class: Rafflesia::LigandNeighborsData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::LigandNeighborsData
- Defined in:
- lib/rafflesia/proteins/ligand_neighbors_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ contact_count: :contact_count, contacts: :contacts, hydrogen_bond_count: :hydrogen_bond_count, is_ligand_filtered: :is_ligand_filtered, is_truncated: :is_truncated, ligand_count: :ligand_count, ligands: :ligands, neighbor_count: :neighbor_count, neighbors: :neighbors, radius: :radius, relation: :relation, returned_neighbor_count: :returned_neighbor_count, structure_id: :structure_id }.freeze
Instance Attribute Summary collapse
-
#contact_count ⇒ Object
Returns the value of attribute contact_count.
-
#contacts ⇒ Object
Returns the value of attribute contacts.
-
#hydrogen_bond_count ⇒ Object
Returns the value of attribute hydrogen_bond_count.
-
#is_ligand_filtered ⇒ Object
Returns the value of attribute is_ligand_filtered.
-
#is_truncated ⇒ Object
Returns the value of attribute is_truncated.
-
#ligand_count ⇒ Object
Returns the value of attribute ligand_count.
-
#ligands ⇒ Object
Returns the value of attribute ligands.
-
#neighbor_count ⇒ Object
Returns the value of attribute neighbor_count.
-
#neighbors ⇒ Object
Returns the value of attribute neighbors.
-
#radius ⇒ Object
Returns the value of attribute radius.
-
#relation ⇒ Object
Returns the value of attribute relation.
-
#returned_neighbor_count ⇒ Object
Returns the value of attribute returned_neighbor_count.
-
#structure_id ⇒ Object
Returns the value of attribute structure_id.
Instance Method Summary collapse
-
#initialize(json) ⇒ LigandNeighborsData
constructor
A new instance of LigandNeighborsData.
Constructor Details
#initialize(json) ⇒ LigandNeighborsData
Returns a new instance of LigandNeighborsData.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 39 def initialize(json) super() hash = self.class.normalize(json) @contact_count = hash[:contact_count] @contacts = (hash[:contacts] || []).map { |item| item ? Rafflesia::LigandContact.new(item) : nil } @hydrogen_bond_count = hash[:hydrogen_bond_count] @is_ligand_filtered = hash[:is_ligand_filtered] @is_truncated = hash[:is_truncated] @ligand_count = hash[:ligand_count] @ligands = (hash[:ligands] || []).map { |item| item ? Rafflesia::Ligand.new(item) : nil } @neighbor_count = hash[:neighbor_count] @neighbors = (hash[:neighbors] || []).map { |item| item ? Rafflesia::LigandNeighbor.new(item) : nil } @radius = hash[:radius] @relation = hash[:relation] ? Rafflesia::RelationArtifactData.new(hash[:relation]) : nil @returned_neighbor_count = hash[:returned_neighbor_count] @structure_id = hash[:structure_id] end |
Instance Attribute Details
#contact_count ⇒ Object
Returns the value of attribute contact_count.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def contact_count @contact_count end |
#contacts ⇒ Object
Returns the value of attribute contacts.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def contacts @contacts end |
#hydrogen_bond_count ⇒ Object
Returns the value of attribute hydrogen_bond_count.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def hydrogen_bond_count @hydrogen_bond_count end |
#is_ligand_filtered ⇒ Object
Returns the value of attribute is_ligand_filtered.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def is_ligand_filtered @is_ligand_filtered end |
#is_truncated ⇒ Object
Returns the value of attribute is_truncated.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def is_truncated @is_truncated end |
#ligand_count ⇒ Object
Returns the value of attribute ligand_count.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def ligand_count @ligand_count end |
#ligands ⇒ Object
Returns the value of attribute ligands.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def ligands @ligands end |
#neighbor_count ⇒ Object
Returns the value of attribute neighbor_count.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def neighbor_count @neighbor_count end |
#neighbors ⇒ Object
Returns the value of attribute neighbors.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def neighbors @neighbors end |
#radius ⇒ Object
Returns the value of attribute radius.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def radius @radius end |
#relation ⇒ Object
Returns the value of attribute relation.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def relation @relation end |
#returned_neighbor_count ⇒ Object
Returns the value of attribute returned_neighbor_count.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def returned_neighbor_count @returned_neighbor_count end |
#structure_id ⇒ Object
Returns the value of attribute structure_id.
24 25 26 |
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24 def structure_id @structure_id end |