Module: LabwareCreators::RequireWellsWithConcentrations

Extended by:
ActiveSupport::Concern
Included in:
ConcentrationNormalisedPlate, PartialStampedPlate
Defined in:
app/models/concerns/labware_creators/require_wells_with_concentrations.rb

Overview

Can be included in plate creators which require well aliquots to have concentrations

Constant Summary collapse

PLATE_INCLUDES =
'wells.aliquots,wells.qc_results,wells.requests_as_source.request_type,wells.aliquots.request.request_type'

Instance Method Summary collapse

Instance Method Details

#dilutions_configObject

The configuration from the plate purpose.



15
16
17
# File 'app/models/concerns/labware_creators/require_wells_with_concentrations.rb', line 15

def dilutions_config
  purpose_config.fetch(:dilutions)
end

#parentObject



10
11
12
# File 'app/models/concerns/labware_creators/require_wells_with_concentrations.rb', line 10

def parent
  @parent ||= Sequencescape::Api::V2.plate_with_custom_includes(PLATE_INCLUDES, uuid: parent_uuid)
end

#wells_with_aliquots_must_have_concentrationsObject

Validation method that can be called to check that all wells with aliquots have an associated qc_result concentration value.



21
22
23
24
25
26
27
# File 'app/models/concerns/labware_creators/require_wells_with_concentrations.rb', line 21

def wells_with_aliquots_must_have_concentrations
  concs_missing = wells_with_missing_concs
  return if concs_missing.empty?

  msg = 'wells missing a concentration (have you uploaded concentrations via QuantHub?):'
  errors.add(:parent, "#{msg} #{concs_missing.join(', ')}")
end