Class: Rafflesia::VariantMapData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::VariantMapData
- Defined in:
- lib/rafflesia/proteins/variant_map_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ chain: :chain, relation: :relation, sequence_id: :sequence_id, sequence_length: :sequence_length, structure_id: :structure_id, target_id: :target_id, variants: :variants, warnings: :warnings }.freeze
Instance Attribute Summary collapse
-
#chain ⇒ Object
Returns the value of attribute chain.
-
#relation ⇒ Object
Returns the value of attribute relation.
-
#sequence_id ⇒ Object
Returns the value of attribute sequence_id.
-
#sequence_length ⇒ Object
Returns the value of attribute sequence_length.
-
#structure_id ⇒ Object
Returns the value of attribute structure_id.
-
#target_id ⇒ Object
Returns the value of attribute target_id.
-
#variants ⇒ Object
Returns the value of attribute variants.
-
#warnings ⇒ Object
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#initialize(json) ⇒ VariantMapData
constructor
A new instance of VariantMapData.
Constructor Details
#initialize(json) ⇒ VariantMapData
Returns a new instance of VariantMapData.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rafflesia/proteins/variant_map_data.rb', line 29 def initialize(json) super() hash = self.class.normalize(json) @chain = hash[:chain] @relation = hash[:relation] ? Rafflesia::RelationArtifactData.new(hash[:relation]) : nil @sequence_id = hash[:sequence_id] @sequence_length = hash[:sequence_length] @structure_id = hash[:structure_id] @target_id = hash[:target_id] @variants = (hash[:variants] || []).map { |item| item ? Rafflesia::MappedVariant.new(item) : nil } @warnings = (hash[:warnings] || []).map { |item| item ? Rafflesia::SearchWarning.new(item) : nil } end |
Instance Attribute Details
#chain ⇒ Object
Returns the value of attribute chain.
19 20 21 |
# File 'lib/rafflesia/proteins/variant_map_data.rb', line 19 def chain @chain end |
#relation ⇒ Object
Returns the value of attribute relation.
19 20 21 |
# File 'lib/rafflesia/proteins/variant_map_data.rb', line 19 def relation @relation end |
#sequence_id ⇒ Object
Returns the value of attribute sequence_id.
19 20 21 |
# File 'lib/rafflesia/proteins/variant_map_data.rb', line 19 def sequence_id @sequence_id end |
#sequence_length ⇒ Object
Returns the value of attribute sequence_length.
19 20 21 |
# File 'lib/rafflesia/proteins/variant_map_data.rb', line 19 def sequence_length @sequence_length end |
#structure_id ⇒ Object
Returns the value of attribute structure_id.
19 20 21 |
# File 'lib/rafflesia/proteins/variant_map_data.rb', line 19 def structure_id @structure_id end |
#target_id ⇒ Object
Returns the value of attribute target_id.
19 20 21 |
# File 'lib/rafflesia/proteins/variant_map_data.rb', line 19 def target_id @target_id end |
#variants ⇒ Object
Returns the value of attribute variants.
19 20 21 |
# File 'lib/rafflesia/proteins/variant_map_data.rb', line 19 def variants @variants end |
#warnings ⇒ Object
Returns the value of attribute warnings.
19 20 21 |
# File 'lib/rafflesia/proteins/variant_map_data.rb', line 19 def warnings @warnings end |