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, DummyDirectionModule, InColumns, InColumnsThenColumns, InColumnsThenRows, InInverseColumns, InInverseRows, InRows Classes: AsFixedGroupByPlate, AsGroupByPlate, CombinatorialSequential, DualIndexWalker, DummyWalkingHelper, Quadrants, TemplateSubmission, WalkManualWellsByPools, WalkManualWellsOfPlate, WalkWellsByPools, WalkWellsOfPlate, Walker

Constant Summary collapse

DIRECTION_ALGORITHMS =
{
  'column' => 'TagLayout::InColumns',
  'row' => 'TagLayout::InRows',
  'inverse column' => 'TagLayout::InInverseColumns',
  'inverse row' => 'TagLayout::InInverseRows',
  'column then row' => 'TagLayout::InColumnsThenRows',
  'column then column' => 'TagLayout::InColumnsThenColumns',
  '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

alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Squishify

extended

Instance Attribute Details

#tags_per_wellObject

Returns the value of attribute tags_per_well.



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

def tags_per_well
  @tags_per_well
end

Instance Method Details

#direction=(new_direction) ⇒ Object



74
75
76
# File 'app/models/tag_layout.rb', line 74

def direction=(new_direction)
  self.direction_algorithm = DIRECTION_ALGORITHMS.fetch(new_direction, TagLayout::DummyDirectionModule)
end

#direction_algorithm_moduleObject



86
87
88
# File 'app/models/tag_layout.rb', line 86

def direction_algorithm_module
  direction_algorithm.constantize
end

#walking_by=(walk) ⇒ Object



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

def walking_by=(walk)
  self.walking_algorithm = WALKING_ALGORITHMS.fetch(walk, TagLayout::DummyWalkingHelper)
end

#wells_in_walking_orderObject



82
83
84
# File 'app/models/tag_layout.rb', line 82

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