Class: Rafflesia::ParsedVariant

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/proteins/parsed_variant.rb

Constant Summary collapse

HASH_ATTRS =
{
  is_valid: :is_valid,
  mutant_aa: :mutant_aa,
  mutation_type: :mutation_type,
  position: :position,
  raw: :raw,
  warnings: :warnings,
  wildtype_aa: :wildtype_aa
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ParsedVariant

Returns a new instance of ParsedVariant.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rafflesia/proteins/parsed_variant.rb', line 27

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @is_valid = hash[:is_valid]
  @mutant_aa = hash[:mutant_aa]
  @mutation_type = hash[:mutation_type]
  @position = hash[:position]
  @raw = hash[:raw]
  @warnings = (hash[:warnings] || []).map { |item| item ? Rafflesia::SearchWarning.new(item) : nil }
  @wildtype_aa = hash[:wildtype_aa]
end

Instance Attribute Details

#is_validObject

Returns the value of attribute is_valid.



18
19
20
# File 'lib/rafflesia/proteins/parsed_variant.rb', line 18

def is_valid
  @is_valid
end

#mutant_aaObject

Returns the value of attribute mutant_aa.



18
19
20
# File 'lib/rafflesia/proteins/parsed_variant.rb', line 18

def mutant_aa
  @mutant_aa
end

#mutation_typeObject

Returns the value of attribute mutation_type.



18
19
20
# File 'lib/rafflesia/proteins/parsed_variant.rb', line 18

def mutation_type
  @mutation_type
end

#positionObject

Returns the value of attribute position.



18
19
20
# File 'lib/rafflesia/proteins/parsed_variant.rb', line 18

def position
  @position
end

#rawObject

Returns the value of attribute raw.



18
19
20
# File 'lib/rafflesia/proteins/parsed_variant.rb', line 18

def raw
  @raw
end

#warningsObject

Returns the value of attribute warnings.



18
19
20
# File 'lib/rafflesia/proteins/parsed_variant.rb', line 18

def warnings
  @warnings
end

#wildtype_aaObject

Returns the value of attribute wildtype_aa.



18
19
20
# File 'lib/rafflesia/proteins/parsed_variant.rb', line 18

def wildtype_aa
  @wildtype_aa
end