libraries/PlateReaderHelper.rb
# TODO: Make compataible with both statistics and matrix uploads
# Takes in a csv upload file, extracts the information on it
# into a datamatrix object which is returned.
# Specificly tuned to the output file of the biotek plate reader.
#
# @param upload [Upload]  the object which can be resolved to calibration csv
# @return [WellMatrix]  a WellMatrix holding the measurement for each well
Make compataible with both statistics and matrix uploads
Takes in a csv upload file, extracts the information on it
into a datamatrix object which is returned.
Specificly tuned to the output file of the biotek plate reader.
Make compataible with both statistics and matrix uploads Takes in a csv upload file extracts the information on it into a datamatrix object which is returned . Specificly tuned to the output file of the biotek plate reader .
def extract_measurement_matrix_from_csv(upload:)
    table = parse_upload_csv(upload: upload)
    dm =  Array.new(8) { Array.new(12) {-1} } 
    table.each_with_index do |row, idx|
      next if idx.zero?
      well_coord = row[2]
      next if well_coord.nil?
      measurement = row[3].to_f
      next if measurement.nil?
      r, c = find_rc_from_alpha_coord(well_coord).first
      (dm[r][c]) ? dm[r][c] = measurement : -1
    end
    dm
  end
def extract_measurement_matrix_from_csv ( upload : ) table = parse_upload_csv ( upload : upload ) dm = Array . new ( 8 ) { Array . new ( 12 ) { - 1 } } table . each_with_index do | row , idx | next if idx . zero? well_coord = row [ 2 ] next if well_coord . nil? measurement = row [ 3 ] . to_f next if measurement . nil? r , c = find_rc_from_alpha_coord ( well_coord ) . first ( dm [ r ] [ c ] ) ? dm [ r ] [ c ] = measurement : - 1 end dm end
TODO: Make compataible with both statistics and matrix uploads
Takes in a csv upload file, extracts the information on it
into a datamatrix object which is returned.
TODO : Make compataible with both statistics and matrix uploads Takes in a csv upload file extracts the information on it into a datamatrix object which is returned .
# dm = (table.length > 25) ? Array.new(8) { Array.new(12) {-1} } : Array.new(4) { Array.new(6) {-1} } # If the file that is saved, exported, and uploaded was formatted as a 'Statistics' table
a WellMatrix holding the measurement for each well
a WellMatrix holding the measurement for each well
WellMatrix
upload
the object which can be resolved to calibration csv
the object which can be resolved to calibration csv