Class: Rafflesia::MappedVariant

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

Constant Summary collapse

HASH_ATTRS =
{
  is_valid: :is_valid,
  mutant_aa: :mutant_aa,
  mutation_type: :mutation_type,
  raw: :raw,
  sequence_position: :sequence_position,
  structure_chain_id: :structure_chain_id,
  structure_residue_aa: :structure_residue_aa,
  structure_residue_index: :structure_residue_index,
  structure_residue_number: :structure_residue_number,
  warnings: :warnings,
  wildtype_aa: :wildtype_aa,
  wildtype_matches: :wildtype_matches
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ MappedVariant

Returns a new instance of MappedVariant.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 37

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

Instance Attribute Details

#is_validObject

Returns the value of attribute is_valid.



23
24
25
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 23

def is_valid
  @is_valid
end

#mutant_aaObject

Returns the value of attribute mutant_aa.



23
24
25
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 23

def mutant_aa
  @mutant_aa
end

#mutation_typeObject

Returns the value of attribute mutation_type.



23
24
25
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 23

def mutation_type
  @mutation_type
end

#rawObject

Returns the value of attribute raw.



23
24
25
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 23

def raw
  @raw
end

#sequence_positionObject

Returns the value of attribute sequence_position.



23
24
25
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 23

def sequence_position
  @sequence_position
end

#structure_chain_idObject

Returns the value of attribute structure_chain_id.



23
24
25
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 23

def structure_chain_id
  @structure_chain_id
end

#structure_residue_aaObject

Returns the value of attribute structure_residue_aa.



23
24
25
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 23

def structure_residue_aa
  @structure_residue_aa
end

#structure_residue_indexObject

Returns the value of attribute structure_residue_index.



23
24
25
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 23

def structure_residue_index
  @structure_residue_index
end

#structure_residue_numberObject

Returns the value of attribute structure_residue_number.



23
24
25
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 23

def structure_residue_number
  @structure_residue_number
end

#warningsObject

Returns the value of attribute warnings.



23
24
25
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 23

def warnings
  @warnings
end

#wildtype_aaObject

Returns the value of attribute wildtype_aa.



23
24
25
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 23

def wildtype_aa
  @wildtype_aa
end

#wildtype_matchesObject

Returns the value of attribute wildtype_matches.



23
24
25
# File 'lib/rafflesia/proteins/mapped_variant.rb', line 23

def wildtype_matches
  @wildtype_matches
end