libraries/HighThroughputHelper.rb
# Determines what method to use for collection inoculation. Different methods when using different input object types. ie: Yeast Glycerol Stock vs. Yeast Plate
Determines what method to use for collection inoculation. Different methods when using different input object types. ie: Yeast Glycerol Stock vs. Yeast Plate
Determines what method to use for collection inoculation . Different methods when using different input object types . ie : Yeast Glycerol Stock vs . Yeast Plate
def inoculate_culture_plates(new_output_collections:, inoculation_prep_hash:)
    item_ids = []; media_ids = []
    inoculation_prep_hash.each {|collection_id, item_media_hash| item_media_hash.each {|item_id, media_to_rc_list| item_ids.push(item_id); media_ids.push(media_to_rc_list.keys) } }
    uniq_input_items = Item.find(item_ids.flatten.uniq); uniq_media_items = Item.find(media_ids.flatten.uniq)
    input_item_hash = Hash.new();                        input_media_hash = Hash.new()
    uniq_input_items.each {|item| input_item_hash[item.id] = item }; uniq_media_items.each {|item| input_media_hash[item.id] = item }
    gather_materials(empty_containers: new_output_collections, transfer_required: false, new_materials: ["P1000 Multichannel Pipette", "Media Reservoir", "Aera Breathable Seals"], take_items: uniq_media_items)
    uniq_input_items.group_by {|item| item.object_type.name }.each do |ot_name, items|
      case ot_name
      when 'Yeast Glycerol Stock', 'E coli Glycerol Stock', 'Yeast Overnight Suspension'
        tubeNum_hash = prep_glycerol_stock_inoculants(inoculation_prep_hash: inoculation_prep_hash, input_item_hash: input_item_hash, input_media_hash: input_media_hash)
        inoculate_glycerol_stock_inoculates(inoculation_prep_hash: inoculation_prep_hash, tubeNum_hash: tubeNum_hash)
      when 'Yeast Plate', 'E coli Plate of Plasmid'
        take items, interactive: true
        new_output_collections.each do |collection|
          inoculate_colonies_from_agar_plates(collection: collection, input_media_hash: input_media_hash, inoculation_prep_hash: inoculation_prep_hash)
          seal_plate(collection_id=collection.id)
        end
      when '96 Well PCR Plate' 
        raise 'There are no steps for inoculating an experiment when coming from a Glycerol Stock Plate'.upcase
      else
        raise "This object type  #{ot_name} is not compatable to inoculate culture plate"
      end
    end
  end
def inoculate_culture_plates ( new_output_collections : , inoculation_prep_hash : ) item_ids = [ ] ; media_ids = [ ] inoculation_prep_hash . each { | collection_id , item_media_hash | item_media_hash . each { | item_id , media_to_rc_list | item_ids . push ( item_id ) ; media_ids . push ( media_to_rc_list . keys ) } } uniq_input_items = Item . find ( item_ids . flatten . uniq ) ; uniq_media_items = Item . find ( media_ids . flatten . uniq ) input_item_hash = Hash . new ( ) ; input_media_hash = Hash . new ( ) uniq_input_items . each { | item | input_item_hash [ item . id ] = item } ; uniq_media_items . each { | item | input_media_hash [ item . id ] = item } gather_materials ( empty_containers : new_output_collections , transfer_required : false , new_materials : [ "P1000 Multichannel Pipette" , "Media Reservoir" , "Aera Breathable Seals" ] , take_items : uniq_media_items ) uniq_input_items . group_by { | item | item . object_type . name } . each do | ot_name , items | case ot_name when 'Yeast Glycerol Stock' , 'E coli Glycerol Stock' , 'Yeast Overnight Suspension' tubeNum_hash = prep_glycerol_stock_inoculants ( inoculation_prep_hash : inoculation_prep_hash , input_item_hash : input_item_hash , input_media_hash : input_media_hash ) inoculate_glycerol_stock_inoculates ( inoculation_prep_hash : inoculation_prep_hash , tubeNum_hash : tubeNum_hash ) when 'Yeast Plate' , 'E coli Plate of Plasmid' take items , interactive : true new_output_collections . each do | collection | inoculate_colonies_from_agar_plates ( collection : collection , input_media_hash : input_media_hash , inoculation_prep_hash : inoculation_prep_hash ) seal_plate ( collection_id = collection . id ) end when '96 Well PCR Plate' raise 'There are no steps for inoculating an experiment when coming from a Glycerol Stock Plate' . upcase else raise "This object type  #{ot_name} is not compatable to inoculate culture plate" end end end
Determines what method to use for collection inoculation.
Determines what method to use for collection inoculation .
# Grab plates # Yeast Glycerol stock plate
new_output_collections
inoculation_prep_hash