Exemple #1
0
    def _create_worklist_series(self):
        """
        Generates all the buffer dilution worklists (as series).
        The worklists for the transfer from 1-molecule-design stock rack to
        pool stock rack are not included but stored at the ISO sample
        stock racks to enable quadrant tracking.
        """
        self.add_debug('Create worklist series ...')

        volume_calculator = \
          VolumeCalculator(self.target_volume, self.target_concentration,
                           self.__number_designs, self.__stock_concentration)
        generator = StockSampleCreationWorklistGenerator(
            volume_calculator, self.iso_request_label, parent=self)
        self.__worklist_series = generator.get_result()
        if self.__worklist_series is None:
            msg = 'Error when trying to generate worklist series.'
            self.add_error(msg)
        else:
            self.__adj_target_volume = \
                                volume_calculator.get_adjusted_target_volume()
            if not self.__adj_target_volume is None:
                robot_specs = get_pipetting_specs_cybio()
                msg = 'The target volume you have requested needs to be ' \
                      'increased slightly because of the constraints of the ' \
                      'pipetting robot (%s, min. transfer volume: %s ul, ' \
                      'step size: 0.1 ul). The target volume will be ' \
                      'increased from %s ul to %s ul.' \
                      % (robot_specs.name,
                         get_trimmed_string(robot_specs.min_transfer_volume \
                                            * VOLUME_CONVERSION_FACTOR),
                         get_trimmed_string(self.target_volume),
                         get_trimmed_string(self.__adj_target_volume))
                self.add_warning(msg)
Exemple #2
0
    def _create_worklist_series(self):
        """
        Generates all the buffer dilution worklists (as series).
        The worklists for the transfer from 1-molecule-design stock rack to
        pool stock rack are not included but stored at the ISO sample
        stock racks to enable quadrant tracking.
        """
        self.add_debug('Create worklist series ...')

        volume_calculator = \
          VolumeCalculator(self.target_volume, self.target_concentration,
                           self.__number_designs, self.__stock_concentration)
        generator = StockSampleCreationWorklistGenerator(
                                    volume_calculator, self.iso_request_label,
                                    parent=self)
        self.__worklist_series = generator.get_result()
        if self.__worklist_series is None:
            msg = 'Error when trying to generate worklist series.'
            self.add_error(msg)
        else:
            self.__adj_target_volume = \
                                volume_calculator.get_adjusted_target_volume()
            if not self.__adj_target_volume is None:
                robot_specs = get_pipetting_specs_cybio()
                msg = 'The target volume you have requested needs to be ' \
                      'increased slightly because of the constraints of the ' \
                      'pipetting robot (%s, min. transfer volume: %s ul, ' \
                      'step size: 0.1 ul). The target volume will be ' \
                      'increased from %s ul to %s ul.' \
                      % (robot_specs.name,
                         get_trimmed_string(robot_specs.min_transfer_volume \
                                            * VOLUME_CONVERSION_FACTOR),
                         get_trimmed_string(self.target_volume),
                         get_trimmed_string(self.__adj_target_volume))
                self.add_warning(msg)
Exemple #3
0
 def _get_stock_transfer_pipetting_specs(self):
     """
     Sector stock racks use the CyBio, others use the Biomek.
     """
     if len(self._stock_rack_sectors) > 0:
         return get_pipetting_specs_cybio()
     else:
         return get_pipetting_specs_biomek_stock()
Exemple #4
0
 def _get_stock_transfer_pipetting_specs(self):
     """
     Sector stock racks use the CyBio, others use the Biomek.
     """
     if len(self._stock_rack_sectors) > 0:
         return get_pipetting_specs_cybio()
     else:
         return get_pipetting_specs_biomek_stock()
Exemple #5
0
 def __create_prep_to_aliquot_worklist(self):
     # There is one rack transfer for each sector (many-to-one transfer).
     # Each transfer is executed once per aliquot plate.
     self.add_debug("Add worklist for transfer into aliquot plates ...")
     volume = DEFAULT_ALIQUOT_PLATE_VOLUME / VOLUME_CONVERSION_FACTOR
     rack_transfers = []
     for sector_index in self.__sector_layouts.keys():
         rack_transfer = PlannedRackSampleTransfer.get_entity(volume, NUMBER_SECTORS, 0, sector_index)
         rack_transfers.append(rack_transfer)
     label = self.PREP_TO_ALIQUOT_TRANSFER_WORKLIST_LABEL % (self.library_name)
     worklist = PlannedWorklist(
         label,
         TRANSFER_TYPES.RACK_SAMPLE_TRANSFER,
         get_pipetting_specs_cybio(),
         planned_liquid_transfers=rack_transfers,
     )
     self.__worklist_series.add_worklist(self.__last_worklist_index, worklist)
     self.__last_worklist_index += 1
Exemple #6
0
    def __create_worklist(self, worklist_label, planned_liquid_transfers,
                          transfer_type, trg_plate_marker, series_key):
        # The indices for the worklists are subsequent numbers.
        if transfer_type == TRANSFER_TYPES.RACK_SAMPLE_TRANSFER:
            robot_specs = get_pipetting_specs_cybio()
        elif transfer_type == TRANSFER_TYPES.SAMPLE_DILUTION:
            robot_specs = self.builder.dilution_pipetting_specs[
                                                        trg_plate_marker]
        else:
            robot_specs = get_pipetting_specs_biomek()

        worklist = PlannedWorklist(label=worklist_label,
                           transfer_type=transfer_type,
                           pipetting_specs=robot_specs,
                           planned_liquid_transfers=planned_liquid_transfers)
        worklist_number = self.__get_current_worklist_number(False)
        worklist_series = self.__series_map[series_key]
        worklist_series.add_worklist(worklist_number, worklist)
Exemple #7
0
    def __create_worklist(self, worklist_label, planned_liquid_transfers,
                          transfer_type, trg_plate_marker, series_key):
        # The indices for the worklists are subsequent numbers.
        if transfer_type == TRANSFER_TYPES.RACK_SAMPLE_TRANSFER:
            robot_specs = get_pipetting_specs_cybio()
        elif transfer_type == TRANSFER_TYPES.SAMPLE_DILUTION:
            robot_specs = self.builder.dilution_pipetting_specs[
                trg_plate_marker]
        else:
            robot_specs = get_pipetting_specs_biomek()

        worklist = PlannedWorklist(
            label=worklist_label,
            transfer_type=transfer_type,
            pipetting_specs=robot_specs,
            planned_liquid_transfers=planned_liquid_transfers)
        worklist_number = self.__get_current_worklist_number(False)
        worklist_series = self.__series_map[series_key]
        worklist_series.add_worklist(worklist_number, worklist)
Exemple #8
0
 def __create_transfers(self):
     # Creates a :class:`PlannedSampleDilution` for each rack position
     # in a 8x12 rack shape.
     self.add_debug('Create transfers ...')
     self._run_and_record_error(self.volume_calculator.calculate,
                         'Error when trying to determine buffer volume: ',
                         ValueError)
     buffer_volume = self.volume_calculator.get_buffer_volume()
     if buffer_volume is not None:
         volume = buffer_volume / VOLUME_CONVERSION_FACTOR
         wl_label = LABELS.create_buffer_worklist_label(
                                                 self.iso_request_label)
         wl = PlannedWorklist(wl_label,
                              TRANSFER_TYPES.SAMPLE_DILUTION,
                              get_pipetting_specs_cybio())
         for rack_pos in get_positions_for_shape(RACK_SHAPE_NAMES.SHAPE_96):
             psd = PlannedSampleDilution.get_entity(volume=volume,
                   target_position=rack_pos, diluent_info=DILUENT_INFO)
             wl.planned_liquid_transfers.append(psd)
         self.__worklist_series.add_worklist(self.BUFFER_WORKLIST_INDEX, wl)
Exemple #9
0
 def __make_stock_rack_worklist_series(self, label, volume, layout):
     # Builds a sector 0 -> sector 0 rack transfer worklist series.
     pip_specs_cy = get_pipetting_specs_cybio()
     wl_series = WorklistSeries()
     psts = []
     if layout is None:
         # Rack transfer (only for pool stock rack -> prep plate transfer).
         pst = PlannedRackSampleTransfer.get_entity(volume, 1, 0, 0)
         psts.append(pst)
         pwl_type = TRANSFER_TYPES.RACK_SAMPLE_TRANSFER
     else:
         # Sample transfers (for single stock transfer).
         for rack_pos in layout.get_positions():
             pst = PlannedSampleTransfer.get_entity(volume, rack_pos,
                                                    rack_pos)
             psts.append(pst)
         pwl_type = TRANSFER_TYPES.SAMPLE_TRANSFER
     wl = PlannedWorklist(label, pwl_type,
                          pip_specs_cy, planned_liquid_transfers=psts)
     wl_series.add_worklist(0, wl)
     return wl_series
Exemple #10
0
 def __create_transfers(self):
     # Creates a :class:`PlannedSampleDilution` for each rack position
     # in a 8x12 rack shape.
     self.add_debug('Create transfers ...')
     self._run_and_record_error(
         self.volume_calculator.calculate,
         'Error when trying to determine buffer volume: ', ValueError)
     buffer_volume = self.volume_calculator.get_buffer_volume()
     if buffer_volume is not None:
         volume = buffer_volume / VOLUME_CONVERSION_FACTOR
         wl_label = LABELS.create_buffer_worklist_label(
             self.iso_request_label)
         wl = PlannedWorklist(wl_label, TRANSFER_TYPES.SAMPLE_DILUTION,
                              get_pipetting_specs_cybio())
         for rack_pos in get_positions_for_shape(RACK_SHAPE_NAMES.SHAPE_96):
             psd = PlannedSampleDilution.get_entity(
                 volume=volume,
                 target_position=rack_pos,
                 diluent_info=DILUENT_INFO)
             wl.planned_liquid_transfers.append(psd)
         self.__worklist_series.add_worklist(self.BUFFER_WORKLIST_INDEX, wl)
Exemple #11
0
 def __create_prep_to_aliquot_worklist(self):
     # There is one rack transfer for each sector (many-to-one transfer).
     # Each transfer is executed once per aliquot plate.
     self.add_debug('Add worklist for transfer into aliquot plates ...')
     volume = DEFAULT_ALIQUOT_PLATE_VOLUME / VOLUME_CONVERSION_FACTOR
     rack_transfers = []
     for sector_index in self.__sector_layouts.keys():
         rack_transfer = PlannedRackSampleTransfer.get_entity(
                                                         volume,
                                                         NUMBER_SECTORS,
                                                         0,
                                                         sector_index)
         rack_transfers.append(rack_transfer)
     label = self.PREP_TO_ALIQUOT_TRANSFER_WORKLIST_LABEL % (
                                                         self.library_name)
     worklist = PlannedWorklist(label,
                                TRANSFER_TYPES.RACK_SAMPLE_TRANSFER,
                                get_pipetting_specs_cybio(),
                                planned_liquid_transfers=rack_transfers)
     self.__worklist_series.add_worklist(self.__last_worklist_index,
                                         worklist)
     self.__last_worklist_index += 1
Exemple #12
0
 def __make_stock_rack_worklist_series(self, label, volume, layout):
     # Builds a sector 0 -> sector 0 rack transfer worklist series.
     pip_specs_cy = get_pipetting_specs_cybio()
     wl_series = WorklistSeries()
     psts = []
     if layout is None:
         # Rack transfer (only for pool stock rack -> prep plate transfer).
         pst = PlannedRackSampleTransfer.get_entity(volume, 1, 0, 0)
         psts.append(pst)
         pwl_type = TRANSFER_TYPES.RACK_SAMPLE_TRANSFER
     else:
         # Sample transfers (for single stock transfer).
         for rack_pos in layout.get_positions():
             pst = PlannedSampleTransfer.get_entity(volume, rack_pos,
                                                    rack_pos)
             psts.append(pst)
         pwl_type = TRANSFER_TYPES.SAMPLE_TRANSFER
     wl = PlannedWorklist(label,
                          pwl_type,
                          pip_specs_cy,
                          planned_liquid_transfers=psts)
     wl_series.add_worklist(0, wl)
     return wl_series