Module: Receptacle::DownstreamAliquotsRemoval::PrivateMethods

Defined in:
app/models/receptacle/downstream_aliquots_removal.rb

Overview

Private methods to provide functionality for the mixin

Class Method Summary collapse

Class Method Details

.creation_batches_for_requests(instance) ⇒ Array[Batch]

Get the sequencing creations batches by following the outer requests graph. Supposing this outer requests graph: Library Creation —> Multiplexing –> Sequencing The path to solve the creation batches is as follows: 1) Get the submissions from the outer requests that wrap this current node 2) From each submission, get the multiplexed labware, which is the labware that is the target of a multiplexed request (outer request before sequencing) 3) From this multiplexed labware, it goes to the next labware created from it (sequencing tube). 4) For this labware, it access to the creation batches (groups of sequencing requests that will go into a flowcell) 5) It returns the aggregation of all creation batches from all submissions

Parameters:

  • instance (Receptacle)

    The well we want to obtain creation batche from

Returns:

  • (Array[Batch])

    List of batches



45
46
47
48
49
50
51
# File 'app/models/receptacle/downstream_aliquots_removal.rb', line 45

def self.creation_batches_for_requests(instance)
  PrivateMethods
    .submissions_for_requests(instance)
    .map { |submission| submission&.multiplexed_labware&.children&.map(&:creation_batches) }
    .flatten
    .compact
end

.submissions_for_requests(instance) ⇒ Array[Submission]

Gets the submissions of all outer requests that wrap this well

Parameters:

  • instance (Receptacle)

    The well we want to obtain submissions from

Returns:



26
27
28
# File 'app/models/receptacle/downstream_aliquots_removal.rb', line 26

def self.submissions_for_requests(instance)
  instance.aliquot_requests.map(&:submission)&.flatten&.uniq || []
end