Class: Rafflesia::SequenceAlignData

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

Constant Summary collapse

HASH_ATTRS =
{
  algorithm: :algorithm,
  alignment_length: :alignment_length,
  gap_count: :gap_count,
  identity_count: :identity_count,
  identity_fraction: :identity_fraction,
  mismatch_count: :mismatch_count,
  nw_score: :nw_score,
  parameters: :parameters,
  position_mappings: :position_mappings,
  query_aligned: :query_aligned,
  target_aligned: :target_aligned
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ SequenceAlignData

Returns a new instance of SequenceAlignData.



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

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @algorithm = hash[:algorithm]
  @alignment_length = hash[:alignment_length]
  @gap_count = hash[:gap_count]
  @identity_count = hash[:identity_count]
  @identity_fraction = hash[:identity_fraction]
  @mismatch_count = hash[:mismatch_count]
  @nw_score = hash[:nw_score]
  @parameters = hash[:parameters] ? Rafflesia::SequenceAlignDataParametersStruct.new(hash[:parameters]) : nil
  @position_mappings = (hash[:position_mappings] || []).map { |item| item ? Rafflesia::SequencePositionMapping.new(item) : nil }
  @query_aligned = hash[:query_aligned]
  @target_aligned = hash[:target_aligned]
end

Instance Attribute Details

#algorithmObject

Returns the value of attribute algorithm.



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

def algorithm
  @algorithm
end

#alignment_lengthObject

Returns the value of attribute alignment_length.



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

def alignment_length
  @alignment_length
end

#gap_countObject

Returns the value of attribute gap_count.



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

def gap_count
  @gap_count
end

#identity_countObject

Returns the value of attribute identity_count.



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

def identity_count
  @identity_count
end

#identity_fractionObject

Returns the value of attribute identity_fraction.



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

def identity_fraction
  @identity_fraction
end

#mismatch_countObject

Returns the value of attribute mismatch_count.



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

def mismatch_count
  @mismatch_count
end

#nw_scoreObject

Returns the value of attribute nw_score.



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

def nw_score
  @nw_score
end

#parametersObject

Returns the value of attribute parameters.



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

def parameters
  @parameters
end

#position_mappingsObject

Returns the value of attribute position_mappings.



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

def position_mappings
  @position_mappings
end

#query_alignedObject

Returns the value of attribute query_aligned.



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

def query_aligned
  @query_aligned
end

#target_alignedObject

Returns the value of attribute target_aligned.



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

def target_aligned
  @target_aligned
end