Class: Rafflesia::VariantRecord

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/genomes/variant_record.rb

Constant Summary collapse

HASH_ATTRS =
{
  alt: :alt,
  chrom: :chrom,
  id: :id,
  pos: :pos,
  ref: :ref
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ VariantRecord

Returns a new instance of VariantRecord.



23
24
25
26
27
28
29
30
31
# File 'lib/rafflesia/genomes/variant_record.rb', line 23

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @alt = hash[:alt]
  @chrom = hash[:chrom]
  @id = hash[:id]
  @pos = hash[:pos]
  @ref = hash[:ref]
end

Instance Attribute Details

#altObject

Returns the value of attribute alt.



16
17
18
# File 'lib/rafflesia/genomes/variant_record.rb', line 16

def alt
  @alt
end

#chromObject

Returns the value of attribute chrom.



16
17
18
# File 'lib/rafflesia/genomes/variant_record.rb', line 16

def chrom
  @chrom
end

#idObject

Returns the value of attribute id.



16
17
18
# File 'lib/rafflesia/genomes/variant_record.rb', line 16

def id
  @id
end

#posObject

Returns the value of attribute pos.



16
17
18
# File 'lib/rafflesia/genomes/variant_record.rb', line 16

def pos
  @pos
end

#refObject

Returns the value of attribute ref.



16
17
18
# File 'lib/rafflesia/genomes/variant_record.rb', line 16

def ref
  @ref
end