Class: Rafflesia::ParsedVariant
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::ParsedVariant
- 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
-
#is_valid ⇒ Object
Returns the value of attribute is_valid.
-
#mutant_aa ⇒ Object
Returns the value of attribute mutant_aa.
-
#mutation_type ⇒ Object
Returns the value of attribute mutation_type.
-
#position ⇒ Object
Returns the value of attribute position.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#warnings ⇒ Object
Returns the value of attribute warnings.
-
#wildtype_aa ⇒ Object
Returns the value of attribute wildtype_aa.
Instance Method Summary collapse
-
#initialize(json) ⇒ ParsedVariant
constructor
A new instance of ParsedVariant.
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_valid ⇒ Object
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_aa ⇒ Object
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_type ⇒ Object
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 |
#position ⇒ Object
Returns the value of attribute position.
18 19 20 |
# File 'lib/rafflesia/proteins/parsed_variant.rb', line 18 def position @position end |
#raw ⇒ Object
Returns the value of attribute raw.
18 19 20 |
# File 'lib/rafflesia/proteins/parsed_variant.rb', line 18 def raw @raw end |
#warnings ⇒ Object
Returns the value of attribute warnings.
18 19 20 |
# File 'lib/rafflesia/proteins/parsed_variant.rb', line 18 def warnings @warnings end |
#wildtype_aa ⇒ Object
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 |