Class: Sequencescape::Api::V2::Plate::Pool
- Inherits:
-
Object
- Object
- Sequencescape::Api::V2::Plate::Pool
- 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
-
#pool_index ⇒ Object
readonly
The uuid of the submission associated with the pool.
-
#submission_id ⇒ Object
(also: #id)
readonly
The uuid of the submission associated with the pool.
-
#subpools ⇒ Object
readonly
The uuid of the submission associated with the pool.
Instance Method Summary collapse
- #add_well_request(well, request) ⇒ Object
-
#initialize(submission_id, pool_index) ⇒ Pool
constructor
Create a new Pools from the pool information.
- #lane_count ⇒ Object
-
#well_count ⇒ Object
The total number of wells contributing to the pool Note: If a well goes down two separate routes, then it will be counted twice.
- #well_locations ⇒ Object
Constructor Details
#initialize(submission_id, pool_index) ⇒ Pool
Create a new Pools from the pool information.
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_index ⇒ Object (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_id ⇒ Object (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 |
#subpools ⇒ Object (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_count ⇒ Object
22 23 24 |
# File 'app/sequencescape/sequencescape/api/v2/plate/pool.rb', line 22 def lane_count @lane_count || '?' end |
#well_count ⇒ Object
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_locations ⇒ Object
38 39 40 |
# File 'app/sequencescape/sequencescape/api/v2/plate/pool.rb', line 38 def well_locations subpools.flat_map(&:well_locations) end |