Beispiel #1
0
 def __get_sorted_transfers(self):
     """
     Sorts the planned transfers of the worklist by source position.
     """
     source_positions = dict()
     for plt in self.planned_worklist:
         source_pos = plt.source_position
         if not source_positions.has_key(source_pos):
             source_positions[source_pos] = []
         source_positions[source_pos].append(plt)
     sorted_source_positions = sort_rack_positions(source_positions.keys())
     sorted_transfers = []
     for source_pos in sorted_source_positions:
         planned_transfers = source_positions[source_pos]
         if len(planned_transfers) == 1:
             sorted_transfers.append(planned_transfers[0])
         else:
             target_positions = dict()
             for plt in planned_transfers:
                 target_pos = plt.target_position
                 target_positions[target_pos] = plt
             sorted_target_positions = sort_rack_positions(
                                                     target_positions.keys())
             for target_pos in sorted_target_positions:
                 sorted_transfers.append(target_positions[target_pos])
     return sorted_transfers
Beispiel #2
0
 def __get_sorted_transfers(self):
     """
     Sorts the planned transfers of the worklist by source position.
     """
     source_positions = dict()
     for plt in self.planned_worklist:
         source_pos = plt.source_position
         if not source_positions.has_key(source_pos):
             source_positions[source_pos] = []
         source_positions[source_pos].append(plt)
     sorted_source_positions = sort_rack_positions(source_positions.keys())
     sorted_transfers = []
     for source_pos in sorted_source_positions:
         planned_transfers = source_positions[source_pos]
         if len(planned_transfers) == 1:
             sorted_transfers.append(planned_transfers[0])
         else:
             target_positions = dict()
             for plt in planned_transfers:
                 target_pos = plt.target_position
                 target_positions[target_pos] = plt
             sorted_target_positions = sort_rack_positions(
                 target_positions.keys())
             for target_pos in sorted_target_positions:
                 sorted_transfers.append(target_positions[target_pos])
     return sorted_transfers
Beispiel #3
0
 def __store_design_rack_value(self, label):
     # Stores the values for a particular design rack.
     self.add_debug('Store values for design rack %s ...' % (label))
     tf_layout = self.association_layouts[label]
     concentrations = self.final_concentrations[label]
     missing_final_concentration = []
     for tf_pos in tf_layout.get_sorted_working_positions():
         cell_plate_positions = tf_pos.cell_plate_positions
         cell_plate_positions = sort_rack_positions(cell_plate_positions)
         # design rack position might lack ISO volume and conc
         src_pos = self.source_layout.get_working_position(
                                                 tf_pos.rack_position)
         for trg_pos in cell_plate_positions:
             self.__source_well_values.append(tf_pos.rack_position.label)
             self.__design_rack_values.append(label)
             self.__target_well_values.append(trg_pos.label)
             self.__iso_volume_values.append(src_pos.iso_volume)
             self.__iso_concentration_values.append(
                                                 src_pos.iso_concentration)
             if not concentrations.has_key(trg_pos):
                 missing_final_concentration.append(trg_pos.label)
                 continue
             final_conc = concentrations[trg_pos]
             self.__final_concentration_values.append(final_conc)
     if len(missing_final_concentration) > 0:
         msg = 'There are final concentrations missing for the following ' \
               'rack positions of design rack %s: %s' \
               % (label, missing_final_concentration)
         self.add_error(msg)
Beispiel #4
0
 def __store_design_rack_value(self, label):
     # Stores the values for a particular design rack.
     self.add_debug('Store values for design rack %s ...' % (label))
     tf_layout = self.association_layouts[label]
     concentrations = self.final_concentrations[label]
     missing_final_concentration = []
     for tf_pos in tf_layout.get_sorted_working_positions():
         cell_plate_positions = tf_pos.cell_plate_positions
         cell_plate_positions = sort_rack_positions(cell_plate_positions)
         # design rack position might lack ISO volume and conc
         src_pos = self.source_layout.get_working_position(
             tf_pos.rack_position)
         for trg_pos in cell_plate_positions:
             self.__source_well_values.append(tf_pos.rack_position.label)
             self.__design_rack_values.append(label)
             self.__target_well_values.append(trg_pos.label)
             self.__iso_volume_values.append(src_pos.iso_volume)
             self.__iso_concentration_values.append(
                 src_pos.iso_concentration)
             if not concentrations.has_key(trg_pos):
                 missing_final_concentration.append(trg_pos.label)
                 continue
             final_conc = concentrations[trg_pos]
             self.__final_concentration_values.append(final_conc)
     if len(missing_final_concentration) > 0:
         msg = 'There are final concentrations missing for the following ' \
               'rack positions of design rack %s: %s' \
               % (label, missing_final_concentration)
         self.add_error(msg)
Beispiel #5
0
    def __get_sorted_transfers(self):
        # Sorts the planned transfers of the worklist by source position.
        target_positions = dict()
        for plt in self.planned_worklist:
            target_pos = plt.target_position
            target_positions[target_pos] = plt

        sorted_target_positions = sort_rack_positions(target_positions.keys())
        sorted_transfers = []
        for target_pos in sorted_target_positions:
            plt = target_positions[target_pos]
            sorted_transfers.append(plt)

        return sorted_transfers
Beispiel #6
0
 def __create_tube_transfers(self):
     # Creates the tube transfers.
     self.add_debug('Schedule tube transfers ...')
     for donor_barcode, donor_rack in self.__donor_racks.iteritems():
         src_positions = sort_rack_positions(
                                 rack_positions=donor_rack.tubes.keys())
         transfer_count = 0
         for receiver_barcode, number_tubes in donor_rack.\
                                             associated_racks.iteritems():
             receiver_rack = self.__receiver_racks[receiver_barcode]
             free_positions = sort_rack_positions(
                                 receiver_rack.get_positions_without_tube())
             for i in range(number_tubes):
                 src_pos = src_positions[i + transfer_count]
                 trg_pos = free_positions[i]
                 tube_barcode = donor_rack.tubes[src_pos]
                 tt_data = TubeTransferData(tube_barcode=tube_barcode,
                                 src_rack_barcode=donor_barcode,
                                 src_pos=src_pos,
                                 trg_rack_barcode=receiver_barcode,
                                 trg_pos=trg_pos)
                 self.__tube_transfers.append(tt_data)
             transfer_count += number_tubes
Beispiel #7
0
    def __get_sorted_transfers(self):
        # Sorts the planned transfers of the worklist by source position.
        target_positions = dict()
        for plt in self.planned_worklist:
            target_pos = plt.target_position
            target_positions[target_pos] = plt

        sorted_target_positions = sort_rack_positions(target_positions.keys())
        sorted_transfers = []
        for target_pos in sorted_target_positions:
            plt = target_positions[target_pos]
            sorted_transfers.append(plt)

        return sorted_transfers
Beispiel #8
0
 def __create_tube_transfers(self):
     # Creates the tube transfers.
     self.add_debug('Schedule tube transfers ...')
     for donor_barcode, donor_rack in self.__donor_racks.iteritems():
         src_positions = sort_rack_positions(
             rack_positions=donor_rack.tubes.keys())
         transfer_count = 0
         for receiver_barcode, number_tubes in donor_rack.\
                                             associated_racks.iteritems():
             receiver_rack = self.__receiver_racks[receiver_barcode]
             free_positions = sort_rack_positions(
                 receiver_rack.get_positions_without_tube())
             for i in range(number_tubes):
                 src_pos = src_positions[i + transfer_count]
                 trg_pos = free_positions[i]
                 tube_barcode = donor_rack.tubes[src_pos]
                 tt_data = TubeTransferData(
                     tube_barcode=tube_barcode,
                     src_rack_barcode=donor_barcode,
                     src_pos=src_pos,
                     trg_rack_barcode=receiver_barcode,
                     trg_pos=trg_pos)
                 self.__tube_transfers.append(tt_data)
             transfer_count += number_tubes