sanger/limber

View on GitHub
app/views/exports/cellaca_input_file.csv.erb

Summary

Maintainability
Test Coverage
<%
   cols_per_file = 3
   start = @page * cols_per_file
   rows_per_file = @plate.number_of_rows

   # This generates a CSV file containing 24 cells in a 3*8 grid.
   # Each column represents a single column of the plate, and each file
   # contains three such columns. The @page parameter (zero-indexed) indicates
   # which set of colums we are concerned with. Eg 0 => 1-3, 1 => 4-6 etc.
   # Currently if passed a 384 well plate it will generate a 3*16 well grid;
   # this is unlikely to be the required behaviour should this process get used
   # with a 384 well plate.
   #
   # Each cell is filled with the plate barcode and well name, separated by a
   # colon. eg. 'DN1S:A1'
   #
   # We don't walk the actual wells of the plate, as some plates (mostly out of)
   # cherrypicking don't model empty wells. Instead we use a well helper to
   # generate out well names.
-%>
<%- rows_per_file.times do |row| -%>
<%=  Array.new(cols_per_file) { |col| "#{@plate.human_barcode}:#{WellHelpers.well_name(row, col+start)}" }.to_csv -%>
<%- end -%>