Class: TagLayout

Inherits:
ApplicationRecord show all
Includes:
Asset::Ownership::ChangesOwner, ModelExtensions::TagLayout, Uuid::Uuidable
Defined in:
app/models/tag_layout.rb

Overview

Lays out the tags in the specified tag group in a particular pattern.

In pulldown they use only one set of tags and put them into wells in a particular pattern: by columns, or by rows. Depending on the size of the tag group that is used by the layout template it either repeats (for example, 8 tags in the group laid out in columns would repeat the tags across the plate), or it doesn't (for example, a 96 tag group would occupy an entire 96 well plate).

Defined Under Namespace

Modules: CombByRows, InColumns, InColumnsThenRows, InInverseColumns, InInverseRows, InRows Classes: AsFixedGroupByPlate, AsGroupByPlate, CombinatorialSequential, DualIndexWalker, Quadrants, TemplateSubmission, UnknownDirection, UnknownWalking, WalkManualWellsByPools, WalkManualWellsOfPlate, WalkWellsByPools, WalkWellsOfPlate, Walker

Constant Summary collapse

DIRECTIONS =
{
  'column' => 'TagLayout::InColumns',
  'row' => 'TagLayout::InRows',
  'inverse column' => 'TagLayout::InInverseColumns',
  'inverse row' => 'TagLayout::InInverseRows',
  'column then row' => 'TagLayout::InColumnsThenRows',
  'combinatorial by row' => 'TagLayout::CombByRows'
}.freeze
WALKING_ALGORITHMS =
{
  'wells in pools' => 'TagLayout::WalkWellsByPools',
  'wells of plate' => 'TagLayout::WalkWellsOfPlate',
  'manual by pool' => 'TagLayout::WalkManualWellsByPools',
  'as group by plate' => 'TagLayout::AsGroupByPlate',
  'manual by plate' => 'TagLayout::WalkManualWellsOfPlate',
  'quadrants' => 'TagLayout::Quadrants',
  'as fixed group by plate' => 'TagLayout::AsFixedGroupByPlate',
  'combinatorial sequential' => 'TagLayout::CombinatorialSequential'
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Asset::Ownership::ChangesOwner

included

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Attribute Details

#tags_per_wellObject

Returns the value of attribute tags_per_well


12
13
14
# File 'app/models/tag_layout.rb', line 12

def tags_per_well
  @tags_per_well
end

Instance Method Details

#direction=(new_direction) ⇒ Object


63
64
65
# File 'app/models/tag_layout.rb', line 63

def direction=(new_direction)
  self.direction_algorithm = DIRECTIONS.fetch(new_direction) { UnknownDirection.new(new_direction) }
end

#direction_algorithm_moduleObject


77
78
79
# File 'app/models/tag_layout.rb', line 77

def direction_algorithm_module
  direction_algorithm.constantize
end

#walking_by=(walk) ⇒ Object


67
68
69
# File 'app/models/tag_layout.rb', line 67

def walking_by=(walk)
  self.walking_algorithm = WALKING_ALGORITHMS.fetch(walk) { UnknownWalking.new(walk) }
end

#wells_in_walking_orderObject


71
72
73
74
75
# File 'app/models/tag_layout.rb', line 71

def wells_in_walking_order
  @wiwo ||= plate.wells
                 .send(direction_algorithm_module.well_order_scope)
                 .includes(aliquots: [:tag, :tag2])
end