Class: Rafflesia::GenomeAssemblyData

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

Constant Summary collapse

HASH_ATTRS =
{
  assembly_id: :assembly_id,
  contigs: :contigs,
  name: :name,
  organism: :organism,
  source: :source,
  source_version: :source_version,
  taxon: :taxon,
  warnings: :warnings
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ GenomeAssemblyData

Returns a new instance of GenomeAssemblyData.



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rafflesia/genomes/genome_assembly_data.rb', line 29

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @assembly_id = hash[:assembly_id]
  @contigs = (hash[:contigs] || []).map { |item| item ? Rafflesia::GenomeContig.new(item) : nil }
  @name = hash[:name]
  @organism = hash[:organism]
  @source = hash[:source]
  @source_version = hash[:source_version]
  @taxon = hash[:taxon]
  @warnings = (hash[:warnings] || []).map { |item| item ? Rafflesia::SearchWarning.new(item) : nil }
end

Instance Attribute Details

#assembly_idObject

Returns the value of attribute assembly_id.



19
20
21
# File 'lib/rafflesia/genomes/genome_assembly_data.rb', line 19

def assembly_id
  @assembly_id
end

#contigsObject

Returns the value of attribute contigs.



19
20
21
# File 'lib/rafflesia/genomes/genome_assembly_data.rb', line 19

def contigs
  @contigs
end

#nameObject

Returns the value of attribute name.



19
20
21
# File 'lib/rafflesia/genomes/genome_assembly_data.rb', line 19

def name
  @name
end

#organismObject

Returns the value of attribute organism.



19
20
21
# File 'lib/rafflesia/genomes/genome_assembly_data.rb', line 19

def organism
  @organism
end

#sourceObject

Returns the value of attribute source.



19
20
21
# File 'lib/rafflesia/genomes/genome_assembly_data.rb', line 19

def source
  @source
end

#source_versionObject

Returns the value of attribute source_version.



19
20
21
# File 'lib/rafflesia/genomes/genome_assembly_data.rb', line 19

def source_version
  @source_version
end

#taxonObject

Returns the value of attribute taxon.



19
20
21
# File 'lib/rafflesia/genomes/genome_assembly_data.rb', line 19

def taxon
  @taxon
end

#warningsObject

Returns the value of attribute warnings.



19
20
21
# File 'lib/rafflesia/genomes/genome_assembly_data.rb', line 19

def warnings
  @warnings
end