Class: LabwareCreators::BaitedPlate

Inherits:
StampedPlate show all
Includes:
CustomPage, SupportParent::PlateOnly
Defined in:
app/models/labware_creators/baited_plate.rb

Overview

In ISC pipeline. Provides a user with a preview of the expected bait library layout Creates a new plate, which is a stamp of the parent. Applies the bait library to the aliquots of the plate in accordance with the baits specified at submission.

Defined Under Namespace

Classes: Baits

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from LabwareCreators::Base

Instance Method Details

#bait_library_layout_previewObject



27
28
29
# File 'app/models/labware_creators/baited_plate.rb', line 27

def bait_library_layout_preview
  @bait_library_layout_preview ||= api.bait_library_layout.preview!(plate: parent_uuid, user: user_uuid).layout
end

#baitsObject



37
38
39
# File 'app/models/labware_creators/baited_plate.rb', line 37

def baits
  wells.select { |w| w.bait.present? }
end

#create_labware!Object



31
32
33
34
35
# File 'app/models/labware_creators/baited_plate.rb', line 31

def create_labware!
  create_plate_with_standard_transfer! do |child|
    api.bait_library_layout.create!(plate: child.uuid, user: user_uuid)
  end
end

#parentObject Originally defined in module SupportParent::PlateOnly

#plateObject



23
24
25
# File 'app/models/labware_creators/baited_plate.rb', line 23

def plate
  parent
end

#wellsObject



41
42
43
44
45
46
47
48
# File 'app/models/labware_creators/baited_plate.rb', line 41

def wells
  parent.locations_in_rows.map do |location|
    bait = bait_library_layout_preview[location]
    aliquot = bait # Fudge, will be nil if no bait

    Baits.new(location, bait, [aliquot].compact, nil)
  end
end

#wells_by_rowObject



50
51
52
# File 'app/models/labware_creators/baited_plate.rb', line 50

def wells_by_row
  PlateWalking::Walker.new(parent, wells)
end