Class: MultiplexedCherrypickingTask

Inherits:
Task show all
Includes:
Tasks::PlatePurposeBehavior
Defined in:
app/models/multiplexed_cherrypicking_task.rb

Defined Under Namespace

Classes: AssignTubesToWellsData

Instance Method Summary collapse

Methods inherited from Task

#find_batch, #find_batch_requests, #get_descriptor_value, #get_subclass_attribute_options, get_subclass_attribute_options, #get_subclass_attribute_value, get_subclass_attributes, #get_subclass_attributes, init_class, #set_descriptor_value, set_subclass_attribute, #set_subclass_attribute_value, #sub_events_for

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Method Details

#create_render_element(request) ⇒ Object


16
17
18
# File 'app/models/multiplexed_cherrypicking_task.rb', line 16

def create_render_element(request)
  request.asset && AssignTubesToWellsData.new(request)
end

#do_task(workflow, params) ⇒ Object


37
38
39
40
41
# File 'app/models/multiplexed_cherrypicking_task.rb', line 37

def do_task(workflow, params)
  destination_plate = target_plate(params[:existing_plate_barcode], params[:plate_purpose_id])
  workflow.do_assign_requests_to_multiplexed_wells_task(self, params, destination_plate) &&
    workflow.do_assign_pick_volume_task(self, params)
end

#included_for_do_taskObject


20
21
22
# File 'app/models/multiplexed_cherrypicking_task.rb', line 20

def included_for_do_task
  [{ requests: [:request_metadata, { asset: :aliquots }, :target_asset] }, :pipeline]
end

#included_for_render_taskObject


24
25
26
# File 'app/models/multiplexed_cherrypicking_task.rb', line 24

def included_for_render_task
  [requests: { asset: [:samples, { plate: :barcodes }, :map] }]
end

#partialObject


12
13
14
# File 'app/models/multiplexed_cherrypicking_task.rb', line 12

def partial
  'assign_wells_to_wells'
end

#plate_purpose_options(_ = nil) ⇒ Object


33
34
35
# File 'app/models/multiplexed_cherrypicking_task.rb', line 33

def plate_purpose_options(_ = nil)
  PlatePurpose.cherrypickable_as_target.order(name: :asc).pluck(:name, :size, :id)
end

#render_task(workflow, params) ⇒ Object


28
29
30
31
# File 'app/models/multiplexed_cherrypicking_task.rb', line 28

def render_task(workflow, params)
  super
  workflow.plate_purpose_options = plate_purpose_options
end

#target_plate(barcode, plate_purpose_id) ⇒ Object


43
44
45
46
47
# File 'app/models/multiplexed_cherrypicking_task.rb', line 43

def target_plate(barcode, plate_purpose_id)
  return Plate.with_barcode(barcode).first unless barcode.blank?

  PlatePurpose.find(plate_purpose_id).create!
end