libraries/HighThroughputHelper.rb
def prep_glycerol_stock_inoculants(inoculation_prep_hash:, input_item_hash:, input_media_hash:)
    tube_num = 1        
    tubeNum_hash = nested_hash_data_structure
    resuspension_hash = nested_hash_data_structure
    inoculation_prep_hash.each do |out_collection_id, inoculation_item_hash|
      inoculation_item_hash.each do |input_item_id, media_rc_list_hash|
        media_rc_list_hash.each do |media_item_id, rc_list|
          media_vol_ml = ((rc_list.length*SATURATION_CULT_VOL*1.1)/1000.0).round(3) # mL w/ 10%
          if (resuspension_hash[input_item_id][media_item_id]).instance_of? Hash
            resuspension_hash[input_item_id][media_item_id] = media_vol_ml 
          else 
            resuspension_hash[input_item_id][media_item_id] += media_vol_ml
            resuspension_hash[input_item_id][media_item_id].round(3)
          end
          if tubeNum_hash[input_item_id][media_item_id].instance_of? Hash
            tubeNum_hash[input_item_id][media_item_id] = tube_num
            tube_num += 1
          end
        end
      end
    end
    display_table = [['Tube Label #',"Media Type", "Media Vol (#{MILLILITERS})", 'Input Item ID','Item Location']] # Headers of table
    resuspension_hash.each do |input_item_id, media_volume_hash|
      media_volume_hash.each do |media_item_id, media_vol_ml|
        dtable_row = make_checkable(value: tubeNum_hash[input_item_id][media_item_id]).concat([input_media_hash[media_item_id].sample.name]).concat(
          make_checkable(value: media_vol_ml)).concat([input_item_id]).concat(make_checkable(value: input_item_hash[input_item_id].location)
          )
        display_table.push(dtable_row)
      end
    end
    show do
      title "Resuspend Inoculants"
      separator
      note "Use the <b>Tube Label #</b> column to determine how many inoculants to prepare."
      note "Use the <b>Media Vol (#{MILLILITERS})</b> column to determine the appropriate sized tube."
      check "Gather tubes and label with tube label number"
      check "Next, fill tubes with the appropriate amount of media."
      check "Finally, retrieve glycerol stock, take a sample using aseptic technique, then resuspend in pre-filled tube."
      note "Follow the table below to resuspend the input item into the appropriate media."
      table display_table
    end
    return tubeNum_hash
  end
# Guides tech through labelling and resuspending glycerol stock sample into specified volume of media for inoculation.
Guides tech through labelling and resuspending glycerol stock sample into specified volume of media for inoculation.
Guides tech through labelling and resuspending glycerol stock sample into specified volume of media for inoculation .
def prep_glycerol_stock_inoculants(inoculation_prep_hash:, input_item_hash:, input_media_hash:)
    tube_num = 1        
    tubeNum_hash = nested_hash_data_structure
    resuspension_hash = nested_hash_data_structure
    inoculation_prep_hash.each do |out_collection_id, inoculation_item_hash|
      inoculation_item_hash.each do |input_item_id, media_rc_list_hash|
        media_rc_list_hash.each do |media_item_id, rc_list|
          media_vol_ml = ((rc_list.length*SATURATION_CULT_VOL*1.1)/1000.0).round(3) 
          if (resuspension_hash[input_item_id][media_item_id]).instance_of? Hash
            resuspension_hash[input_item_id][media_item_id] = media_vol_ml 
          else 
            resuspension_hash[input_item_id][media_item_id] += media_vol_ml
            resuspension_hash[input_item_id][media_item_id].round(3)
          end
          if tubeNum_hash[input_item_id][media_item_id].instance_of? Hash
            tubeNum_hash[input_item_id][media_item_id] = tube_num
            tube_num += 1
          end
        end
      end
    end
    display_table = [['Tube Label #',"Media Type", "Media Vol (#{MILLILITERS})", 'Input Item ID','Item Location']] 
    resuspension_hash.each do |input_item_id, media_volume_hash|
      media_volume_hash.each do |media_item_id, media_vol_ml|
        dtable_row = make_checkable(value: tubeNum_hash[input_item_id][media_item_id]).concat([input_media_hash[media_item_id].sample.name]).concat(
          make_checkable(value: media_vol_ml)).concat([input_item_id]).concat(make_checkable(value: input_item_hash[input_item_id].location)
          )
        display_table.push(dtable_row)
      end
    end
    show do
      title "Resuspend Inoculants"
      separator
      note "Use the <b>Tube Label #</b> column to determine how many inoculants to prepare."
      note "Use the <b>Media Vol (#{MILLILITERS})</b> column to determine the appropriate sized tube."
      check "Gather tubes and label with tube label number"
      check "Next, fill tubes with the appropriate amount of media."
      check "Finally, retrieve glycerol stock, take a sample using aseptic technique, then resuspend in pre-filled tube."
      note "Follow the table below to resuspend the input item into the appropriate media."
      table display_table
    end
    return tubeNum_hash
  end
def prep_glycerol_stock_inoculants ( inoculation_prep_hash : , input_item_hash : , input_media_hash : ) tube_num = 1 tubeNum_hash = nested_hash_data_structure resuspension_hash = nested_hash_data_structure inoculation_prep_hash . each do | out_collection_id , inoculation_item_hash | inoculation_item_hash . each do | input_item_id , media_rc_list_hash | media_rc_list_hash . each do | media_item_id , rc_list | media_vol_ml = ( ( rc_list . length * SATURATION_CULT_VOL * 1.1 ) / 1000.0 ) . round ( 3 ) if ( resuspension_hash [ input_item_id ] [ media_item_id ] ) . instance_of? Hash resuspension_hash [ input_item_id ] [ media_item_id ] = media_vol_ml else resuspension_hash [ input_item_id ] [ media_item_id ] += media_vol_ml resuspension_hash [ input_item_id ] [ media_item_id ] . round ( 3 ) end if tubeNum_hash [ input_item_id ] [ media_item_id ] . instance_of? Hash tubeNum_hash [ input_item_id ] [ media_item_id ] = tube_num tube_num += 1 end end end end display_table = [ [ 'Tube Label #' , "Media Type" , "Media Vol (#{MILLILITERS})" , 'Input Item ID' , 'Item Location' ] ] resuspension_hash . each do | input_item_id , media_volume_hash | media_volume_hash . each do | media_item_id , media_vol_ml | dtable_row = make_checkable ( value : tubeNum_hash [ input_item_id ] [ media_item_id ] ) . concat ( [ input_media_hash [ media_item_id ] . sample . name ] ) . concat ( make_checkable ( value : media_vol_ml ) ) . concat ( [ input_item_id ] ) . concat ( make_checkable ( value : input_item_hash [ input_item_id ] . location ) ) display_table . push ( dtable_row ) end end show do title "Resuspend Inoculants" separator note "Use the <b>Tube Label #</b> column to determine how many inoculants to prepare." note "Use the <b>Media Vol (#{MILLILITERS})</b> column to determine the appropriate sized tube." check "Gather tubes and label with tube label number" check "Next, fill tubes with the appropriate amount of media." check "Finally, retrieve glycerol stock, take a sample using aseptic technique, then resuspend in pre-filled tube." note "Follow the table below to resuspend the input item into the appropriate media." table display_table end return tubeNum_hash end
Guides tech through labelling and resuspending glycerol stock sample into specified volume of media for inoculation.
Guides tech through labelling and resuspending glycerol stock sample into specified volume of media for inoculation .
# mL w/ 10% # Headers of table
inoculation_prep_hash
input_item_hash
input_media_hash