Class: Limber::Plate::Pools

Inherits:
Object
  • Object
show all
Defined in:
app/models/limber/plate/pools.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 Pools class takes the pools hash, and provides a convenient interface for accessing the information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pools_hash) ⇒ Pools

Create a new Pools from the pool information.

Parameters:

  • pools_hash (Hash)

    As provided by the pools hash in the plate json



30
31
32
33
34
35
36
# File 'app/models/limber/plate/pools.rb', line 30

def initialize(pools_hash)
  pools_hash ||= {}
  @number_of_pools = pools_hash.length
  @submissions = pools_hash.keys
  @pools = pools_hash.map { |uuid, pool| Limber::Plate::Pool.new(uuid, pool) }
  @example_pool = @pools.first || Limber::Plate::Pool.new(nil, {})
end

Instance Attribute Details

#example_poolObject (readonly)

A number of attributes should be consistent across the plate. The example pool provides a source of this information We should possibly move away from this assumption



21
22
23
# File 'app/models/limber/plate/pools.rb', line 21

def example_pool
  @example_pool
end

#number_of_poolsObject (readonly)

The total number of pools listed on the plate. In most cases indicated the number of tubes which will be created



13
14
15
# File 'app/models/limber/plate/pools.rb', line 13

def number_of_pools
  @number_of_pools
end

#submissionsObject (readonly)

An array of the uuids of the submissions associated with the plate



16
17
18
# File 'app/models/limber/plate/pools.rb', line 16

def submissions
  @submissions
end

Instance Method Details

#ready_for_automatic_pooling?Boolean

Plates are ready for pooling once we’re in to the multiplex phase of the pipeline This is indicated by the request type on the pools, and indicates that the plates have been charged and passed. We need at least one pool for automatic pooling to function.

Returns:

  • (Boolean)


42
43
44
# File 'app/models/limber/plate/pools.rb', line 42

def ready_for_automatic_pooling?
  @pools.present? && ready_for_custom_pooling?
end

#ready_for_custom_pooling?Boolean

Custom pooling is a little more flexible. Than automatic pooling, in that it DOESNT require downstream submission and is completely happy with empty pools

Returns:

  • (Boolean)


48
49
50
# File 'app/models/limber/plate/pools.rb', line 48

def ready_for_custom_pooling?
  @pools.empty? || @pools.any?(&:ready_for_custom_pooling?)
end