Class: LabwareCreators::PartialStampedPlateWithoutDilution
- Inherits:
-
StampedPlate
- Object
- Base
- StampedPlate
- LabwareCreators::PartialStampedPlateWithoutDilution
- Defined in:
- app/models/labware_creators/partial_stamped_plate_without_dilution.rb
Overview
These creators handle a partial submission of wells on their parent plate, and use a well filter to select those wells with requests that have the correct request type, library type and request state.
Instance Method Summary collapse
-
#get_destination_location(source_well) ⇒ String
Returns the destination location for a given source well.
-
#get_well_for_plate_location(plate, well_location) ⇒ Well
Returns the well object at a specified well location on a given plate.
-
#labware_wells ⇒ Array<Well>
Returns the lists of wells from the parent labware in column order, i.e., A1, B1, …
-
#parent_wells_to_transfer ⇒ Array<Well>
Returns an array of the filtered parent wells.
-
#request_hash(source_well, child_plate, additional_parameters) ⇒ Hash
Returns attributes for a transfer request from a source well to the child plate.
-
#well_filter ⇒ Object
The well filter will be used to identify the parent wells to be taken forward.
Constructor Details
This class inherits a constructor from LabwareCreators::Base
Instance Method Details
#get_destination_location(source_well) ⇒ String
Returns the destination location for a given source well. The index of the source well in the array of parent wells to transfer (after filtering) is used to calculate the destination. This is because wells are compressed to the top-left on the child plate.
51 52 53 54 |
# File 'app/models/labware_creators/partial_stamped_plate_without_dilution.rb', line 51 def get_destination_location(source_well) index = parent_wells_to_transfer.index(source_well) WellHelpers.well_at_column_index(index) end |
#get_well_for_plate_location(plate, well_location) ⇒ Well
Returns the well object at a specified well location on a given plate.
39 40 41 |
# File 'app/models/labware_creators/partial_stamped_plate_without_dilution.rb', line 39 def get_well_for_plate_location(plate, well_location) plate.wells.detect { |well| well.location == well_location } end |
#labware_wells ⇒ Array<Well>
Returns the lists of wells from the parent labware in column order, i.e., A1, B1, … H1, A2, B2, … etc. This method is invoked by well_filter. The order of wells returned by the ‘filtered’ method of the well_filter is influenced by the order of wells returned by this method.
21 22 23 |
# File 'app/models/labware_creators/partial_stamped_plate_without_dilution.rb', line 21 def labware_wells parent.wells_in_columns end |
#parent_wells_to_transfer ⇒ Array<Well>
Returns an array of the filtered parent wells.
29 30 31 |
# File 'app/models/labware_creators/partial_stamped_plate_without_dilution.rb', line 29 def parent_wells_to_transfer well_filter.filtered.map(&:first) end |
#request_hash(source_well, child_plate, additional_parameters) ⇒ Hash
Returns attributes for a transfer request from a source well to the child plate. This method is invoked by the ‘transfer_request_attributes’ for each filtered source well.
65 66 67 68 69 70 71 |
# File 'app/models/labware_creators/partial_stamped_plate_without_dilution.rb', line 65 def request_hash(source_well, child_plate, additional_parameters) dest_location = get_destination_location(source_well) { 'source_asset' => source_well.uuid, 'target_asset' => get_well_for_plate_location(child_plate, dest_location)&.uuid }.merge(additional_parameters) end |
#well_filter ⇒ Object
The well filter will be used to identify the parent wells to be taken forward. Filters on request type, library type and state.
10 11 12 |
# File 'app/models/labware_creators/partial_stamped_plate_without_dilution.rb', line 10 def well_filter @well_filter ||= WellFilterAllowingPartials.new(creator: self, request_state: 'pending') end |