Class: Rafflesia::SequenceInspectData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::SequenceInspectData
- Defined in:
- lib/rafflesia/sequences/sequence_inspect_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ alphabet: :alphabet, ambiguous_count: :ambiguous_count, gap_count: :gap_count, length: :length, objects: :objects, residue_composition: :residue_composition, sequence_id: :sequence_id, sha256: :sha_256 }.freeze
Instance Attribute Summary collapse
-
#alphabet ⇒ Object
Returns the value of attribute alphabet.
-
#ambiguous_count ⇒ Object
Returns the value of attribute ambiguous_count.
-
#gap_count ⇒ Object
Returns the value of attribute gap_count.
-
#length ⇒ Object
Returns the value of attribute length.
-
#objects ⇒ Object
Returns the value of attribute objects.
-
#residue_composition ⇒ Object
Returns the value of attribute residue_composition.
-
#sequence_id ⇒ Object
Returns the value of attribute sequence_id.
-
#sha_256 ⇒ Object
Returns the value of attribute sha_256.
Instance Method Summary collapse
-
#initialize(json) ⇒ SequenceInspectData
constructor
A new instance of SequenceInspectData.
Constructor Details
#initialize(json) ⇒ SequenceInspectData
Returns a new instance of SequenceInspectData.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rafflesia/sequences/sequence_inspect_data.rb', line 29 def initialize(json) super() hash = self.class.normalize(json) @alphabet = hash[:alphabet] @ambiguous_count = hash[:ambiguous_count] @gap_count = hash[:gap_count] @length = hash[:length] @objects = (hash[:objects] || []).map { |item| item ? Rafflesia::ObjectRef.new(item) : nil } @residue_composition = hash[:residue_composition] || {} @sequence_id = hash[:sequence_id] @sha_256 = hash[:sha256] end |
Instance Attribute Details
#alphabet ⇒ Object
Returns the value of attribute alphabet.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_inspect_data.rb', line 19 def alphabet @alphabet end |
#ambiguous_count ⇒ Object
Returns the value of attribute ambiguous_count.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_inspect_data.rb', line 19 def ambiguous_count @ambiguous_count end |
#gap_count ⇒ Object
Returns the value of attribute gap_count.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_inspect_data.rb', line 19 def gap_count @gap_count end |
#length ⇒ Object
Returns the value of attribute length.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_inspect_data.rb', line 19 def length @length end |
#objects ⇒ Object
Returns the value of attribute objects.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_inspect_data.rb', line 19 def objects @objects end |
#residue_composition ⇒ Object
Returns the value of attribute residue_composition.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_inspect_data.rb', line 19 def residue_composition @residue_composition end |
#sequence_id ⇒ Object
Returns the value of attribute sequence_id.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_inspect_data.rb', line 19 def sequence_id @sequence_id end |
#sha_256 ⇒ Object
Returns the value of attribute sha_256.
19 20 21 |
# File 'lib/rafflesia/sequences/sequence_inspect_data.rb', line 19 def sha_256 @sha_256 end |