Class: Rafflesia::GenomeRegionData

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

Constant Summary collapse

HASH_ATTRS =
{
  assembly_id: :assembly_id,
  contig: :contig,
  coordinate_system: :coordinate_system,
  end: :end,
  length_bp: :length_bp,
  normalized: :normalized,
  start: :start,
  strand: :strand,
  warnings: :warnings
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ GenomeRegionData

Returns a new instance of GenomeRegionData.



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

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @assembly_id = hash[:assembly_id]
  @contig = hash[:contig]
  @coordinate_system = hash[:coordinate_system]
  @end = hash[:end]
  @length_bp = hash[:length_bp]
  @normalized = hash[:normalized]
  @start = hash[:start]
  @strand = hash[:strand]
  @warnings = (hash[:warnings] || []).map { |item| item ? Rafflesia::SearchWarning.new(item) : nil }
end

Instance Attribute Details

#assembly_idObject

Returns the value of attribute assembly_id.



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

def assembly_id
  @assembly_id
end

#contigObject

Returns the value of attribute contig.



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

def contig
  @contig
end

#coordinate_systemObject

Returns the value of attribute coordinate_system.



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

def coordinate_system
  @coordinate_system
end

#endObject

Returns the value of attribute end.



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

def end
  @end
end

#length_bpObject

Returns the value of attribute length_bp.



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

def length_bp
  @length_bp
end

#normalizedObject

Returns the value of attribute normalized.



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

def normalized
  @normalized
end

#startObject

Returns the value of attribute start.



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

def start
  @start
end

#strandObject

Returns the value of attribute strand.



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

def strand
  @strand
end

#warningsObject

Returns the value of attribute warnings.



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

def warnings
  @warnings
end