Module: TagLayout::InColumnsThenColumns
- Defined in:
- app/models/tag_layout/in_columns_then_columns.rb
Overview
Lays out the tags so that they are column then column ordered. e.g. a dual index plate with 96 tags in tag group 1 and 4 in tag group 2 is laid out as follows for the first 4 rows/columns on a 384-well plate:
1 2 3 4 etc.
—————————— A 1,1 1,3 9,1 9,3 B 1,2 1,4 9,2 9,4 C 2,1 2,3 10,1 10,3 D 2,2 2,4 10,2 10,4 etc. This version is a variation of the tag 2 order used in the InColumnsThenRows layout.
Class Method Summary collapse
- .direction ⇒ Object
-
.tag2_index(row, column, scale, _height, _width) ⇒ Object
Returns the tag index for the secondary tag e.g.
-
.tag_index(row, column, scale, height, _width) ⇒ Object
Returns the tag index for the primary tag That is the one laid out in columns with four copies of each (scale = 4).
-
.well_order_scope ⇒ Object
We don’t rely on well sorting, so lets not worry about it.
Class Method Details
.direction ⇒ Object
15 16 17 |
# File 'app/models/tag_layout/in_columns_then_columns.rb', line 15 def self.direction 'column then column' end |
.tag2_index(row, column, scale, _height, _width) ⇒ Object
Returns the tag index for the secondary tag e.g. 4 tags in group, A1 = 1, B1 = 2, A2 = 3, B2 = 4
36 37 38 |
# File 'app/models/tag_layout/in_columns_then_columns.rb', line 36 def self.tag2_index(row, column, scale, _height, _width) ((column % scale) * scale) + (row % scale) end |
.tag_index(row, column, scale, height, _width) ⇒ Object
Returns the tag index for the primary tag That is the one laid out in columns with four copies of each (scale = 4). The row and column are the indexes of the position, height and width are the plate dimensions.
28 29 30 31 32 |
# File 'app/models/tag_layout/in_columns_then_columns.rb', line 28 def self.tag_index(row, column, scale, height, _width) tag_col = (column / scale) tag_row = (row / scale) tag_row + (height / scale * tag_col) end |
.well_order_scope ⇒ Object
We don’t rely on well sorting, so lets not worry about it.
21 22 23 |
# File 'app/models/tag_layout/in_columns_then_columns.rb', line 21 def self.well_order_scope :all end |