Module: Limber::TagLayoutTemplate::InInverseRows

Defined in:
app/models/limber/tag_layout_template/in_inverse_rows.rb

Overview

rubocop:todo Style/Documentation

Instance Method Summary collapse

Instance Method Details

#group_wells_of_plate(plate) ⇒ Object



4
5
6
7
8
# File 'app/models/limber/tag_layout_template/in_inverse_rows.rb', line 4

def group_wells_of_plate(plate)
  group_wells(plate) do |well_location_pool_pair|
    WellHelpers.row_order(plate.size).reverse.map { |row_column| well_location_pool_pair.call(row_column) }
  end
end

#primary_index(row, column, scale, height, width) ⇒ Integer

Returns the tag index for the primary (i7) tag That is the one laid out in inverse rows (H12 -> A1) with four copies of each i5 follows the same pattern, but isn’t actually shown in limber

Parameters:

  • row (Integer)

    Zero indexed row co-ordinate of the well

  • column (Integer)

    Zero-indexed column co-ordinate of the well

  • scale (Integer)

    The number of times each tag is repeated in a given row/column. eg. 2 for quad stamps.

  • height (Integer)

    The number of rows on a plate

  • _width (Integer)

    The number of columns on a plate (unused)

Returns:

  • (Integer)

    The index of the tag to use for the well



22
23
24
25
26
# File 'app/models/limber/tag_layout_template/in_inverse_rows.rb', line 22

def primary_index(row, column, scale, height, width)
  tag_col = (column / scale)
  tag_row = (row / scale)
  ((height / scale) * (width / scale)) - (tag_col + (width / scale * tag_row)) - 1
end