Class: Rafflesia::MsaInspectData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/cache/msa_inspect_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  alignment_length: :alignment_length,
  alignment_object_id: :alignment_object_id,
  alignment_path: :alignment_path,
  column_count: :column_count,
  columns: :columns,
  consensus: :consensus,
  gap_fraction: :gap_fraction,
  mean_conservation: :mean_conservation,
  relation: :relation,
  sequence_count: :sequence_count,
  sequence_ids: :sequence_ids,
  total_gaps: :total_gaps,
  total_residues: :total_residues
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ MsaInspectData

Returns a new instance of MsaInspectData.



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 39

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @alignment_length = hash[:alignment_length]
  @alignment_object_id = hash[:alignment_object_id]
  @alignment_path = hash[:alignment_path]
  @column_count = hash[:column_count]
  @columns = (hash[:columns] || []).map { |item| item ? Rafflesia::MsaColumnSummary.new(item) : nil }
  @consensus = hash[:consensus]
  @gap_fraction = hash[:gap_fraction]
  @mean_conservation = hash[:mean_conservation]
  @relation = hash[:relation] ? Rafflesia::RelationArtifactData.new(hash[:relation]) : nil
  @sequence_count = hash[:sequence_count]
  @sequence_ids = (hash[:sequence_ids] || [])
  @total_gaps = hash[:total_gaps]
  @total_residues = hash[:total_residues]
end

Instance Attribute Details

#alignment_lengthObject

Returns the value of attribute alignment_length.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def alignment_length
  @alignment_length
end

#alignment_object_idObject

Returns the value of attribute alignment_object_id.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def alignment_object_id
  @alignment_object_id
end

#alignment_pathObject

Returns the value of attribute alignment_path.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def alignment_path
  @alignment_path
end

#column_countObject

Returns the value of attribute column_count.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def column_count
  @column_count
end

#columnsObject

Returns the value of attribute columns.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def columns
  @columns
end

#consensusObject

Returns the value of attribute consensus.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def consensus
  @consensus
end

#gap_fractionObject

Returns the value of attribute gap_fraction.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def gap_fraction
  @gap_fraction
end

#mean_conservationObject

Returns the value of attribute mean_conservation.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def mean_conservation
  @mean_conservation
end

#relationObject

Returns the value of attribute relation.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def relation
  @relation
end

#sequence_countObject

Returns the value of attribute sequence_count.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def sequence_count
  @sequence_count
end

#sequence_idsObject

Returns the value of attribute sequence_ids.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def sequence_ids
  @sequence_ids
end

#total_gapsObject

Returns the value of attribute total_gaps.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def total_gaps
  @total_gaps
end

#total_residuesObject

Returns the value of attribute total_residues.



24
25
26
# File 'lib/rafflesia/cache/msa_inspect_data.rb', line 24

def total_residues
  @total_residues
end