Class: Rafflesia::CoevolutionData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/sequences/coevolution_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  alignment_length: :alignment_length,
  alignment_object_id: :alignment_object_id,
  alignment_path: :alignment_path,
  effective_sequences: :effective_sequences,
  method: :method,
  pair_count: :pair_count,
  pairs: :pairs,
  reference_id: :reference_id,
  scored_columns: :scored_columns,
  sequence_count: :sequence_count,
  used_sequences: :used_sequences
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ CoevolutionData

Returns a new instance of CoevolutionData.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/rafflesia/sequences/coevolution_data.rb', line 35

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]
  @effective_sequences = hash[:effective_sequences]
  @method = hash[:method]
  @pair_count = hash[:pair_count]
  @pairs = (hash[:pairs] || []).map { |item| item ? Rafflesia::CoevolutionPair.new(item) : nil }
  @reference_id = hash[:reference_id]
  @scored_columns = hash[:scored_columns]
  @sequence_count = hash[:sequence_count]
  @used_sequences = hash[:used_sequences]
end

Instance Attribute Details

#alignment_lengthObject

Returns the value of attribute alignment_length.



22
23
24
# File 'lib/rafflesia/sequences/coevolution_data.rb', line 22

def alignment_length
  @alignment_length
end

#alignment_object_idObject

Returns the value of attribute alignment_object_id.



22
23
24
# File 'lib/rafflesia/sequences/coevolution_data.rb', line 22

def alignment_object_id
  @alignment_object_id
end

#alignment_pathObject

Returns the value of attribute alignment_path.



22
23
24
# File 'lib/rafflesia/sequences/coevolution_data.rb', line 22

def alignment_path
  @alignment_path
end

#effective_sequencesObject

Returns the value of attribute effective_sequences.



22
23
24
# File 'lib/rafflesia/sequences/coevolution_data.rb', line 22

def effective_sequences
  @effective_sequences
end

#methodObject

Returns the value of attribute method.



22
23
24
# File 'lib/rafflesia/sequences/coevolution_data.rb', line 22

def method
  @method
end

#pair_countObject

Returns the value of attribute pair_count.



22
23
24
# File 'lib/rafflesia/sequences/coevolution_data.rb', line 22

def pair_count
  @pair_count
end

#pairsObject

Returns the value of attribute pairs.



22
23
24
# File 'lib/rafflesia/sequences/coevolution_data.rb', line 22

def pairs
  @pairs
end

#reference_idObject

Returns the value of attribute reference_id.



22
23
24
# File 'lib/rafflesia/sequences/coevolution_data.rb', line 22

def reference_id
  @reference_id
end

#scored_columnsObject

Returns the value of attribute scored_columns.



22
23
24
# File 'lib/rafflesia/sequences/coevolution_data.rb', line 22

def scored_columns
  @scored_columns
end

#sequence_countObject

Returns the value of attribute sequence_count.



22
23
24
# File 'lib/rafflesia/sequences/coevolution_data.rb', line 22

def sequence_count
  @sequence_count
end

#used_sequencesObject

Returns the value of attribute used_sequences.



22
23
24
# File 'lib/rafflesia/sequences/coevolution_data.rb', line 22

def used_sequences
  @used_sequences
end