Class: Robot::Generator::TecanV3
- Includes:
- Behaviours::TecanDefault
- Defined in:
- app/models/robot/generator/tecan_v3.rb
Overview
Handles picking file generation for Tecan robots with reusing tips for buffer addition steps
Constant Summary
Constants inherited from TecanV2
Robot::Generator::TecanV2::NUM_BUFFER_CHANNELS
Instance Attribute Summary
Attributes inherited from Base
#batch, #ctrl_barcode_index, #dest_barcode_index, #picking_data, #plate_barcode, #source_barcode_index
Instance Method Summary collapse
-
#buffer_separator ⇒ String
Adds a 'Break' command between the buffer and sample addition steps.
-
#buffers(data_object) ⇒ String
Groups buffer addition steps by channel, adds 'Comment' lines between steps, appends a 'Wash' command at the end of each channel group.
Methods inherited from TecanV2
Methods inherited from Base
#initialize, #total_volume, #type
Constructor Details
This class inherits a constructor from Robot::Generator::Base
Instance Method Details
#buffer_separator ⇒ String
Adds a 'Break' command between the buffer and sample addition steps.
47 48 49 |
# File 'app/models/robot/generator/tecan_v3.rb', line 47 def buffer_separator 'B;' end |
#buffers(data_object) ⇒ String
Groups buffer addition steps by channel, adds 'Comment' lines between steps, appends a 'Wash' command at the end of each channel group. This enables reusing tips for buffer addition steps within each channel.
rubocop:disable Metrics/AbcSize,Metrics/MethodLength
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/models/robot/generator/tecan_v3.rb', line 16 def buffers(data_object) groups = Hash.new { |h, k| h[k] = [] } # channel => [steps] each_mapping(data_object) do |mapping, , plate_details| next unless total_volume > mapping['volume'] dest_name = data_object['destination'][]['name'] volume = mapping['buffer_volume'] vert_map_id = description_to_column_index(mapping['dst_well'], plate_details['plate_size']) channel = channel_number(vert_map_id) # No Wash after each step, as we are reusing tips for each channel. step = <<~TECAN.chomp A;#{buffer_info(vert_map_id)};;#{tecan_precision_value(volume)} D;#{};;#{dest_name};#{vert_map_id};;#{tecan_precision_value(volume)} TECAN groups[channel] << step end blocks = groups.keys.sort.map do |channel| # Add 'Comment' between steps, append 'Wash', and join lines. (intersperse(groups[channel], 'C;') << 'W;').join("\n") end blocks.join("\n") end |