Module: Cherrypick::VolumeByNanoGramsPerMicroLitre

Included in:
Well
Defined in:
app/models/cherrypick/volume_by_nano_grams_per_micro_litre.rb

Overview

Included in Well to provide calculations for cherrypicking

Instance Method Summary collapse

Instance Method Details

#volume_to_cherrypick_by_nano_grams_per_micro_litre(final_volume_desired, final_conc_desired, source_concentration, source_volume, robot_minimum_pick_vol = 0.0) ⇒ Float

Used in the cherrypicking process to calculate the relative volumes of source and buffer required to reach the target volume and concentration.

  • Ideally will aim for a target well containing volume final_volume_desired at concentration final_conc_desired
  • This will be made by combining material from the source well (well_attribute.picked_volume) and buffer (well_attribute.buffer_volume)
  • Maximum picked_volume is limited by the amount available (source_volume) and the amount you want in the target well (final_volume_desired)
  • If source_volume < final_volume_desired then buffer will be added to make up final_volume_desired even if it reduces the target concentration below final_conc_desired

rubocop:todo Metrics/MethodLength, Metrics/AbcSize

Parameters:

  • final_volume_desired (Float)

    The volume to aim for in the target well (self)

  • final_conc_desired (Float)

    The concentration to aim for in the target well (self)

  • source_concentration (Float)

    The concentration (ng/ul) in the source well

  • source_volume (Float)

    The volume (ul) in the source well (ie. the maximum pick)

  • robot_minimum_pick_vol (Float) (defaults to: 0.0)

    (ul) the minimum volume the robot can pick (the robot software will reject requests to pick less than this)

Returns:

  • (Float)

    The volume that we will instruct to robot to pick from the source well



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'app/models/cherrypick/volume_by_nano_grams_per_micro_litre.rb', line 27

 do
  # NOTE: The following attribute is not required for Microarray Genotyping.
  # I think this might be broken and suggests that there should be separate classes for project: one for
  # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
  # that doesn't.
  include ProjectManager::Associations
  include BudgetDivision::Associations

  custom_attribute(:project_cost_code, required: true)
  custom_attribute(:funding_comments)
  custom_attribute(:collaborators)
  custom_attribute(:external_funding_source)
  custom_attribute(:sequencing_budget_cost_centre)
  custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
  custom_attribute(:gt_committee_tracking_id)

  before_validation do |record|
    record.project_cost_code = nil if record.project_cost_code.blank?
    record.project_funding_model = nil if record.project_funding_model.blank?
  end
end