Class: Sequencescape::Api::V2::Plate::Subpool
- Inherits:
-
Object
- Object
- Sequencescape::Api::V2::Plate::Subpool
- Defined in:
- app/sequencescape/sequencescape/api/v2/plate/subpool.rb
Overview
A pool is a set of samples due to be processed together with similar parameters. Usually they will end up eventually being combined together in a ‘pool although increasingly this definition is being stretched. Pool information is supplied as part of the plate json. The Pool class takes an individual pool, and provides a convenient interface
Defined Under Namespace
Classes: WellRequest
Instance Attribute Summary collapse
-
#group_identifier ⇒ Object
The group identifier is formed by either the pre-capture group or the order-id.
Instance Method Summary collapse
- #add_well_request(well, request) ⇒ Object
-
#compatible?(_well, request) ⇒ type
Returns true if a well/request may form part of a sub-pool Subpools are currently formed by pre-capture group, or, if not specified order id.
-
#initialize ⇒ Subpool
constructor
A new instance of Subpool.
- #well_count ⇒ Object
- #well_locations ⇒ Object
Constructor Details
#initialize ⇒ Subpool
Returns a new instance of Subpool.
16 17 18 |
# File 'app/sequencescape/sequencescape/api/v2/plate/subpool.rb', line 16 def initialize @well_requests = [] end |
Instance Attribute Details
#group_identifier ⇒ Object
The group identifier is formed by either the pre-capture group or the order-id
14 15 16 |
# File 'app/sequencescape/sequencescape/api/v2/plate/subpool.rb', line 14 def group_identifier @group_identifier end |
Instance Method Details
#add_well_request(well, request) ⇒ Object
32 33 34 35 |
# File 'app/sequencescape/sequencescape/api/v2/plate/subpool.rb', line 32 def add_well_request(well, request) self.group_identifier = request.group_identifier @well_requests << WellRequest.new(well, request) end |
#compatible?(_well, request) ⇒ type
Returns true if a well/request may form part of a sub-pool Subpools are currently formed by pre-capture group, or, if not specified order id. Future changes should ensure the following: 1) That any of the request options displayed here are consistent across the group 2) That each well only appears once in each subpool
56 57 58 |
# File 'app/sequencescape/sequencescape/api/v2/plate/subpool.rb', line 56 def compatible?(_well, request) group_identifier == request.group_identifier end |
#well_count ⇒ Object
20 21 22 |
# File 'app/sequencescape/sequencescape/api/v2/plate/subpool.rb', line 20 def well_count @well_requests.length end |
#well_locations ⇒ Object
24 25 26 |
# File 'app/sequencescape/sequencescape/api/v2/plate/subpool.rb', line 24 def well_locations @well_requests.map { |well_request| well_request.well.location } end |