Class: Utility::CommonDilutionCalculations::Binner
- Inherits:
-
Object
- Object
- Utility::CommonDilutionCalculations::Binner
- Defined in:
- app/models/utility/common_dilution_calculations.rb
Overview
Class used by calculators that perform binning of wells according to concentration. Handles the determination of the next well location for bins.
Instance Attribute Summary collapse
-
#column ⇒ Object
Returns the value of attribute column.
-
#row ⇒ Object
Returns the value of attribute row.
Instance Method Summary collapse
-
#initialize(compression_reqd, number_of_rows) ⇒ Binner
constructor
Sets up an instance of the Binner class for a plate.
-
#next_well_location(index_within_bin, bin_size) ⇒ Object
Work out what the next well location will be.
Constructor Details
#initialize(compression_reqd, number_of_rows) ⇒ Binner
Sets up an instance of the Binner class for a plate.
new bin in a new column. Depends on number of bins and wells containing aliquots on the plate.
162 163 164 165 166 167 168 |
# File 'app/models/utility/common_dilution_calculations.rb', line 162 def initialize(compression_reqd, number_of_rows) @compression_reqd = compression_reqd @number_of_rows = number_of_rows @row = 0 @column = 0 validate_initial_arguments end |
Instance Attribute Details
#column ⇒ Object
Returns the value of attribute column.
152 153 154 |
# File 'app/models/utility/common_dilution_calculations.rb', line 152 def column @column end |
#row ⇒ Object
Returns the value of attribute row.
152 153 154 |
# File 'app/models/utility/common_dilution_calculations.rb', line 152 def row @row end |
Instance Method Details
#next_well_location(index_within_bin, bin_size) ⇒ Object
Work out what the next well location will be. This depends on whether we are in the last well of a bin, whether compression is required, and whether we are in the last row of the plate and will need to start a new column. NB. rows and columns are zero-based here.
181 182 183 184 185 186 187 188 189 190 191 |
# File 'app/models/utility/common_dilution_calculations.rb', line 181 def next_well_location(index_within_bin, bin_size) validate_next_well_arguments(index_within_bin, bin_size) if index_within_bin == bin_size - 1 # last well in bin, so next well location depends on whether compression is required @compression_reqd ? determine_next_available_location : reset_to_top_of_next_column else # there are more wells yet in this bin so continue determine_next_available_location end end |