Class: Utility::ConcentrationNormalisationCalculator

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, CommonDilutionCalculations
Defined in:
app/models/utility/concentration_normalisation_calculator.rb

Overview

Handles the Computations for Concentration Normalisation. Used by the Concentration Normalised Plate class to handle the normalisation processing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly) Originally defined in module CommonDilutionCalculations

Returns the value of attribute config.

Instance Method Details

#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.

Parameters:

  • sample_conc (float)

    The concentration of the source sample in ng/ul

Returns:

  • (float)

    The volume of the source required in ul.

#compute_well_transfers(plate) ⇒ Object



13
14
15
16
# File 'app/models/utility/concentration_normalisation_calculator.rb', line 13

def compute_well_transfers(plate)
  norm_details = normalisation_details(plate.wells_in_columns)
  build_transfers_hash(norm_details)
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.

Parameters:

  • child_uuid (string)

    The uuid of the child plate being transferred into.

  • transfer_hash (hash)

    The transfers hash from which we extract the destination concentrations.

Returns:

  • (array)

    An array of qc assay details for the child plate, ready to send via Api to sequencescape.

#extract_destination_concentrations(transfer_hash) ⇒ hash Originally defined in module CommonDilutionCalculations

Refactor the transfers hash to give destination concentrations

Parameters:

  • transfer_hash (hash)

    The transfer details.

Returns:

  • (hash)

    A refactored hash of well concentrations.

#initialize(config) ⇒ Object Originally defined in module CommonDilutionCalculations

The calculators all use a common configuration structure stored on the plate purpose.

Parameters:

  • config (hash)

    The relevant section from the plate purpose configuration.

#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.

Parameters:

  • wells (Wells)

    The source wells being normalised.

Returns:

  • (hash)

    The well details hash containing calculated normalisation values.