Class: Utility::NormalisedBinningCalculator
- Inherits:
-
Object
- Object
- Utility::NormalisedBinningCalculator
- Includes:
- ActiveModel::Model, CommonDilutionCalculations
- Defined in:
- app/models/utility/normalised_binning_calculator.rb
Overview
Handles the Computations for Normalised Binning Used by the Normalised Binned Plate and Presenter classes to handle the normalisation, compute the bins and provide helpers on displaying the bins on the child plate.
Instance Attribute Summary collapse
-
#config ⇒ Object
included
from CommonDilutionCalculations
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#compute_presenter_bin_details(plate) ⇒ Object
Used by the plate presenter.
-
#compute_vol_source_reqd(sample_conc) ⇒ float
included
from CommonDilutionCalculations
Computes the volume of source material required for normalisation based on the sample concentration and attributes from the purpose configuration (target amount and volume, minimum source volume).
- #compute_well_transfers(parent_plate, filtered_wells) ⇒ Object
- #compute_well_transfers_hash(norm_details, number_of_rows, number_of_columns) ⇒ Object
-
#construct_dest_qc_assay_attributes(child_uuid, transfer_hash) ⇒ array
included
from CommonDilutionCalculations
Constructs the qc_assays collection details for use when writing calculated concentrations for the newly created child plate.
-
#extract_destination_concentrations(transfer_hash) ⇒ hash
included
from CommonDilutionCalculations
Refactor the transfers hash to give destination concentrations.
-
#initialize(config) ⇒ Object
included
from CommonDilutionCalculations
The calculators all use a common configuration structure stored on the plate purpose.
-
#normalisation_details(wells) ⇒ hash
included
from CommonDilutionCalculations
Creates a hash of well normalisation details for a plate used when generating the well transfers and qc assays.
Instance Attribute Details
#config ⇒ Object (readonly) Originally defined in module CommonDilutionCalculations
Returns the value of attribute config.
Instance Method Details
#compute_presenter_bin_details(plate) ⇒ Object
Used by the plate presenter. Uses the concentration in the well and the plate purpose config to work out the well bin colour and number of PCR cycles.
27 28 29 30 |
# File 'app/models/utility/normalised_binning_calculator.rb', line 27 def compute_presenter_bin_details(plate) well_amounts = compute_well_amounts_for_presenter(plate) compute_bin_details_by_well(well_amounts) end |
#compute_vol_source_reqd(sample_conc) ⇒ float Originally defined in module CommonDilutionCalculations
Computes the volume of source material required for normalisation based on the sample concentration and attributes from the purpose configuration (target amount and volume, minimum source volume). Includes checks for minimum source volume and rounding for low diluent volumes due to liquid handler robot restrictions.
#compute_well_transfers(parent_plate, filtered_wells) ⇒ Object
14 15 16 17 |
# File 'app/models/utility/normalised_binning_calculator.rb', line 14 def compute_well_transfers(parent_plate, filtered_wells) norm_details = normalisation_details(filtered_wells) compute_well_transfers_hash(norm_details, parent_plate.number_of_rows, parent_plate.number_of_columns) end |
#compute_well_transfers_hash(norm_details, number_of_rows, number_of_columns) ⇒ Object
19 20 21 22 23 |
# File 'app/models/utility/normalised_binning_calculator.rb', line 19 def compute_well_transfers_hash(norm_details, number_of_rows, number_of_columns) conc_bins = concentration_bins(norm_details) compression_reqd = compression_required?(conc_bins, number_of_rows, number_of_columns) build_transfers_hash(conc_bins, number_of_rows, compression_reqd) end |
#construct_dest_qc_assay_attributes(child_uuid, transfer_hash) ⇒ array Originally defined in module CommonDilutionCalculations
Constructs the qc_assays collection details for use when writing calculated concentrations for the newly created child plate.
#extract_destination_concentrations(transfer_hash) ⇒ hash Originally defined in module CommonDilutionCalculations
Refactor the transfers hash to give destination concentrations
#initialize(config) ⇒ Object Originally defined in module CommonDilutionCalculations
The calculators all use a common configuration structure stored on the plate purpose.
#normalisation_details(wells) ⇒ hash Originally defined in module CommonDilutionCalculations
Creates a hash of well normalisation details for a plate used when generating the well transfers and qc assays.