Class: CherrypickPipeline

Inherits:
CherrypickingPipeline show all
Includes:
Pipeline::InboxGroupedBySubmission
Defined in:
app/models/cherrypick_pipeline.rb

Overview

Note:

Cherrypicking is typically processed by an SSR, and the batch worksheet is passed over to the lab. Actual lab work is tracked via RobotVerification through the RobotVerificationsController

Processes CherrypickRequest Allows material from wells on one or more source plates to be laid out onto either a NEW plate of a specified PlatePurpose or onto a plate created as part of an earlier cherrypick.

WARNING! Cherrypick requests create their target wells upfront and are laid out onto otherwise well-less plates. This results in odd behaviour:

- You cannot cherrypick onto plates with all their wells, even if those wells are empty
- Prior to processing, wells attached to {CherrypickRequest cherrypick requests} will not
  be assigned to a plate.
- Occasionally it is possible to pick two wells to the same location. This does not result in
  pooling or a tag clash, but rather two wells with the same location on the same plate.

Constant Summary collapse

ALWAYS_SHOW_RELEASE_ACTIONS =
true

Instance Method Summary collapse

Methods included from Pipeline::InboxGroupedBySubmission

included

Methods inherited from CherrypickingPipeline

#robot_verified!

Methods inherited from GenotypingPipeline

#request_actions

Methods included from Pipeline::GroupByParent

#input_labware, #output_labware

Methods inherited from Pipeline

#all_requests_from_submissions_selected?, #allow_tag_collision_on_tagging_task?, #completed_request_as_part_of_release_batch, #detach_request_from_batch, #extract_requests_from_input_params, #has_controls?, #input_labware, #is_read_length_consistent_for_batch?, #on_start_batch, #output_labware, #request_actions, #request_types_including_controls, #robot_verified!

Methods included from SharedBehaviour::Named

included

Methods included from Pipeline::BatchValidation

#validation_of_batch, #validation_of_batch_for_completion

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

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

#post_finish_batch(batch, user) ⇒ Object


21
22
23
# File 'app/models/cherrypick_pipeline.rb', line 21

def post_finish_batch(batch, user)
  # Nothing, we don't want all the requests to be completed
end

#post_release_batch(batch, _user) ⇒ Object


25
26
27
28
29
30
31
32
33
34
35
# File 'app/models/cherrypick_pipeline.rb', line 25

def post_release_batch(batch, _user)
  target_purpose = batch.output_plates.first.purpose.name
  # stock wells
  batch.requests.select(&:passed?).each do |request|
    request.asset.stock_wells.each do |stock|
      EventSender.send_pick_event(stock.id, target_purpose, "Pickup well #{request.asset.id}")
    end
  end
  batch.release_pending_requests
  batch.output_plates.each(&:cherrypick_completed)
end

#update_detached_request(batch, request) ⇒ Object


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

def update_detached_request(batch, request)
  # We do not need to do any of the default behaviour:
  # 1. The requests should just be detached, not blocked
  # 2. The assets are not removed because they are not considered unused
end