Example #1
0
 def __write_prep_creation_section(self):
     # This part deals with the transfer to the preparation plates.
     self.add_debug('Writing preparation plate section.')
     self._write_headline(header_text=self.HEADER_PREP_CREATION)
     pp_vol = self.iso.iso_request.preparation_plate_volume \
              * VOLUME_CONVERSION_FACTOR
     if not self.pool_stock_rack_map is None:
         src_conc = DEFAULT_POOL_STOCK_RACK_CONCENTRATION
         src_rack_map = self.pool_stock_rack_map
     else:
         src_conc = self.iso.iso_request.stock_concentration \
                    * CONCENTRATION_CONVERSION_FACTOR
         src_rack_map = dict([(idx, bcs[0])
                              for (idx, bcs) in
                              self.single_stock_rack_map.items()
                              if idx in self.__sector_prep_plate_map])
     trf_vol = get_preparation_plate_transfer_volume(
                                         source_concentration=src_conc,
                                         preparation_plate_volume=pp_vol)
     volume_line = self.VOLUME_LINE % trf_vol
     lines = [volume_line]
     buffer_volume = pp_vol - trf_vol
     buffer_line = self.BUFFER_LINE % buffer_volume
     lines.append(buffer_line)
     for sector_index in sorted(src_rack_map.keys()):
         lines.append('')
         lines.append(self.QUADRANT_LINE % (sector_index + 1))
         pool_barcode = src_rack_map[sector_index]
         prep_plate = self.__sector_prep_plate_map[sector_index]
         src_term = '%s (%s)' % (prep_plate.barcode, prep_plate.label)
         lines.append(self.SOURCE_LINE % pool_barcode)
         lines.append(self.TARGET_LINE % src_term)
     self._write_body_lines(lines)
Example #2
0
 def __create_worklist_series(self):
     # Generates the buffer transfer worklists.
     self.add_debug("Create worklist series ...")
     if self.create_pool_racks:
         pool_buf_vol = get_pool_buffer_volume()
         prep_trf_vol = get_preparation_plate_transfer_volume(preparation_plate_volume=self.preparation_plate_volume)
         prep_buf_vol = self.preparation_plate_volume - prep_trf_vol
     else:
         pool_buf_vol = None
         prep_buf_vol = self.preparation_plate_volume - self.__stock_transfer_volume * self.number_designs
     generator = LibraryCreationWorklistGenerator(
         self.__base_layout,
         self.__stock_concentration,
         self.library_name,
         prep_buf_vol,
         pool_buffer_volume=pool_buf_vol,
         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)
Example #3
0
 def __write_general_section(self):
     # The general section contains library name, layout number, sector
     # index, number of tubes, and transfer volume.
     if self.has_pool_stock_racks:
         vol = get_pool_transfer_volume(
                     number_designs=self.iso.iso_request.number_designs)
     else:
         pp_vol = self.iso.iso_request.preparation_plate_volume \
                  * VOLUME_CONVERSION_FACTOR
         src_conc = self.iso.iso_request.stock_concentration \
                    * CONCENTRATION_CONVERSION_FACTOR
         vol = get_preparation_plate_transfer_volume(
                                         source_concentration=src_conc,
                                         preparation_plate_volume=pp_vol)
     self._write_headline(self.GENERAL_HEADER, preceding_blank_lines=1)
     general_lines = [self.LIBRARY_LINE % self.iso.iso_request.label,
                      self.LAYOUT_NUMBER_LINE % self.iso.layout_number]
     if not self.sector_index is None:
         general_lines.append(
                      self.SECTOR_NUMBER_LINE % (self.sector_index + 1))
     general_lines.extend([self.TUBE_NO_LINE % len(self.tube_transfers),
                           self.VOLUME_LINE % vol])
     self._write_body_lines(general_lines)
Example #4
0
 def __process_pool_transfers(self, sector_index, sector_layout):
     pp_vol = self.iso.iso_request.preparation_plate_volume \
              * VOLUME_CONVERSION_FACTOR
     # Create a worklist series for the stock transfer.
     wl_label = LABELS.create_sector_stock_transfer_worklist_label(
                                                 self.iso.label,
                                                 LABELS.ROLE_POOL_STOCK,
                                                 sector_index)
     prep_transfer_volume = get_preparation_plate_transfer_volume(
                                     preparation_plate_volume=pp_vol) \
                             / VOLUME_CONVERSION_FACTOR
     wl_series = self.__make_stock_rack_worklist_series(
                                                 wl_label,
                                                 prep_transfer_volume,
                                                 None)
     # Process the new pool rack.
     self.__process_stock_rack(
                     LABELS.ROLE_POOL_STOCK,
                     sector_index,
                     None,
                     self.__pool_stock_rack_map[sector_index],
                     wl_series,
                     sector_layout)