Class: Sequencescape::Api::V2::Plate::Pool

Inherits:
Object
  • Object
show all
Defined in:
app/sequencescape/sequencescape/api/v2/plate/pool.rb

Overview

A pool is a set of samples forming part of the same submission, usually to be pooled together. The Pool class takes an individual pool, and provides a convenient interface

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(submission_id, pool_index) ⇒ Pool

Create a new Pools from the pool information.

Parameters:

  • submission)id (String)

    The submission id of the pool



16
17
18
19
20
# File 'app/sequencescape/sequencescape/api/v2/plate/pool.rb', line 16

def initialize(submission_id, pool_index)
  @submission_id = submission_id
  @subpools = []
  @pool_index = pool_index
end

Instance Attribute Details

#pool_indexObject (readonly)

The uuid of the submission associated with the pool



8
9
10
# File 'app/sequencescape/sequencescape/api/v2/plate/pool.rb', line 8

def pool_index
  @pool_index
end

#submission_idObject (readonly) Also known as: id

The uuid of the submission associated with the pool



8
9
10
# File 'app/sequencescape/sequencescape/api/v2/plate/pool.rb', line 8

def submission_id
  @submission_id
end

#subpoolsObject (readonly)

The uuid of the submission associated with the pool



8
9
10
# File 'app/sequencescape/sequencescape/api/v2/plate/pool.rb', line 8

def subpools
  @subpools
end

Instance Method Details

#add_well_request(well, request) ⇒ Object



26
27
28
29
# File 'app/sequencescape/sequencescape/api/v2/plate/pool.rb', line 26

def add_well_request(well, request)
  @lane_count ||= request.submission&.lanes_of_sequencing
  compatible_subpool(well, request).add_well_request(well, request)
end

#lane_countObject



22
23
24
# File 'app/sequencescape/sequencescape/api/v2/plate/pool.rb', line 22

def lane_count
  @lane_count || '?'
end

#well_countObject

The total number of wells contributing to the pool Note: If a well goes down two separate routes, then it will be counted twice.



34
35
36
# File 'app/sequencescape/sequencescape/api/v2/plate/pool.rb', line 34

def well_count
  subpools.sum(&:well_count)
end

#well_locationsObject



38
39
40
# File 'app/sequencescape/sequencescape/api/v2/plate/pool.rb', line 38

def well_locations
  subpools.flat_map(&:well_locations)
end