Class: Rafflesia::RegionSplitData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/proteins/region_split_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  algorithm: :algorithm,
  confidence_metric: :confidence_metric,
  method: :method,
  regions: :regions,
  relation: :relation,
  structure_id: :structure_id,
  threshold: :threshold
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ RegionSplitData

Returns a new instance of RegionSplitData.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rafflesia/proteins/region_split_data.rb', line 27

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @algorithm = hash[:algorithm] ? Rafflesia::RegionSplitAlgorithm.new(hash[:algorithm]) : nil
  @confidence_metric = hash[:confidence_metric]
  @method = hash[:method]
  @regions = (hash[:regions] || []).map { |item| item ? Rafflesia::Region.new(item) : nil }
  @relation = hash[:relation] ? Rafflesia::RelationArtifactData.new(hash[:relation]) : nil
  @structure_id = hash[:structure_id]
  @threshold = hash[:threshold]
end

Instance Attribute Details

#algorithmObject

Returns the value of attribute algorithm.



18
19
20
# File 'lib/rafflesia/proteins/region_split_data.rb', line 18

def algorithm
  @algorithm
end

#confidence_metricObject

Returns the value of attribute confidence_metric.



18
19
20
# File 'lib/rafflesia/proteins/region_split_data.rb', line 18

def confidence_metric
  @confidence_metric
end

#methodObject

Returns the value of attribute method.



18
19
20
# File 'lib/rafflesia/proteins/region_split_data.rb', line 18

def method
  @method
end

#regionsObject

Returns the value of attribute regions.



18
19
20
# File 'lib/rafflesia/proteins/region_split_data.rb', line 18

def regions
  @regions
end

#relationObject

Returns the value of attribute relation.



18
19
20
# File 'lib/rafflesia/proteins/region_split_data.rb', line 18

def relation
  @relation
end

#structure_idObject

Returns the value of attribute structure_id.



18
19
20
# File 'lib/rafflesia/proteins/region_split_data.rb', line 18

def structure_id
  @structure_id
end

#thresholdObject

Returns the value of attribute threshold.



18
19
20
# File 'lib/rafflesia/proteins/region_split_data.rb', line 18

def threshold
  @threshold
end