Class: FlexStationData::Sample

Inherits:
Object
  • Object
show all
Defined in:
lib/flex_station_data/sample.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label, wells, plate) ⇒ Sample

Returns a new instance of Sample.



13
14
15
16
17
# File 'lib/flex_station_data/sample.rb', line 13

def initialize(label, wells, plate)
  @label = label
  @wells = wells
  @plate = plate
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



9
10
11
# File 'lib/flex_station_data/sample.rb', line 9

def label
  @label
end

#plateObject (readonly)

Returns the value of attribute plate.



9
10
11
# File 'lib/flex_station_data/sample.rb', line 9

def plate
  @plate
end

#wellsObject (readonly)

Returns the value of attribute wells.



9
10
11
# File 'lib/flex_station_data/sample.rb', line 9

def wells
  @wells
end

Instance Method Details

#meanObject



27
28
29
# File 'lib/flex_station_data/sample.rb', line 27

def mean
  @mean ||= values.transpose.map(&ComputeMean)
end

#readingsObject



23
24
25
# File 'lib/flex_station_data/sample.rb', line 23

def readings
  @readings ||= wells.zip(values).map { |well, v| Readings.new(well, v) }
end

#valuesObject



19
20
21
# File 'lib/flex_station_data/sample.rb', line 19

def values
  wells.map(&plate_wells.method(:values))
end