Class: Rafflesia::LigandNeighborsData

Inherits:
Types::BaseModel
  • Object
show all
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

Instance Method Summary collapse

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_countObject

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

#contactsObject

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_countObject

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_filteredObject

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_truncatedObject

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_countObject

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

#ligandsObject

Returns the value of attribute ligands.



24
25
26
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24

def ligands
  @ligands
end

#neighbor_countObject

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

#neighborsObject

Returns the value of attribute neighbors.



24
25
26
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24

def neighbors
  @neighbors
end

#radiusObject

Returns the value of attribute radius.



24
25
26
# File 'lib/rafflesia/proteins/ligand_neighbors_data.rb', line 24

def radius
  @radius
end

#relationObject

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_countObject

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_idObject

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