Class: Limber::Plate::Pool

Inherits:
Object
  • Object
show all
Defined in:
app/models/limber/plate/pool.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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(submission_uuid, pool_hash) ⇒ Pool

Create a new Pools from the pool information.

Parameters:

  • submission_uuid (String)

    The submission uuid of the pool (the key in the pools hash)

  • pool_hash (Hash)

    As provided by the values in the pools hash in the plate json



19
20
21
22
23
# File 'app/models/limber/plate/pool.rb', line 19

def initialize(submission_uuid, pool_hash)
  @submission_uuid = submission_uuid
  pool_hash ||= {}
  @pool_hash = pool_hash
end

Instance Attribute Details

#submission_uuidObject (readonly)

The uuid of the submission associated with the pool



11
12
13
# File 'app/models/limber/plate/pool.rb', line 11

def submission_uuid
  @submission_uuid
end

Instance Method Details

#insert_sizeObject



29
30
31
32
# File 'app/models/limber/plate/pool.rb', line 29

def insert_size
  sizes = @pool_hash.fetch('insert_size', ['Unknown'])
  sizes.to_a.join(' ')
end

#library_type_nameObject



25
26
27
# File 'app/models/limber/plate/pool.rb', line 25

def library_type_name
  @pool_hash.dig('library_type', 'name') || 'Unknown'
end

#primer_panelObject



34
35
36
# File 'app/models/limber/plate/pool.rb', line 34

def primer_panel
  @primer_panel ||= Limber::Plate::PrimerPanel.new(@pool_hash['primer_panel'])
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)


40
41
42
# File 'app/models/limber/plate/pool.rb', line 40

def ready_for_custom_pooling?
  @pool_hash.fetch('for_multiplexing', false)
end