Class: Rafflesia::VariantQueryRecord

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

Constant Summary collapse

HASH_ATTRS =
{
  alt: :alt,
  chrom: :chrom,
  filter: :filter,
  id: :id,
  info: :info,
  pos: :pos,
  qual: :qual,
  ref: :ref,
  samples: :samples
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ VariantQueryRecord

Returns a new instance of VariantQueryRecord.



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/rafflesia/genomes/variant_query_record.rb', line 31

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

Instance Attribute Details

#altObject

Returns the value of attribute alt.



20
21
22
# File 'lib/rafflesia/genomes/variant_query_record.rb', line 20

def alt
  @alt
end

#chromObject

Returns the value of attribute chrom.



20
21
22
# File 'lib/rafflesia/genomes/variant_query_record.rb', line 20

def chrom
  @chrom
end

#filterObject

Returns the value of attribute filter.



20
21
22
# File 'lib/rafflesia/genomes/variant_query_record.rb', line 20

def filter
  @filter
end

#idObject

Returns the value of attribute id.



20
21
22
# File 'lib/rafflesia/genomes/variant_query_record.rb', line 20

def id
  @id
end

#infoObject

Returns the value of attribute info.



20
21
22
# File 'lib/rafflesia/genomes/variant_query_record.rb', line 20

def info
  @info
end

#posObject

Returns the value of attribute pos.



20
21
22
# File 'lib/rafflesia/genomes/variant_query_record.rb', line 20

def pos
  @pos
end

#qualObject

Returns the value of attribute qual.



20
21
22
# File 'lib/rafflesia/genomes/variant_query_record.rb', line 20

def qual
  @qual
end

#refObject

Returns the value of attribute ref.



20
21
22
# File 'lib/rafflesia/genomes/variant_query_record.rb', line 20

def ref
  @ref
end

#samplesObject

Returns the value of attribute samples.



20
21
22
# File 'lib/rafflesia/genomes/variant_query_record.rb', line 20

def samples
  @samples
end