Esempio n. 1
0
    def __init__(self, lab_iso_plate, for_job, lab_iso_layout=None,
                 parent=None):
        """
        Constructor.

        :param lab_iso_plate: The lab ISO plate to be checked.
        :type lab_iso_plate: :class:`IsoPlate` or
            :class:`IsoJobPreparationPlate`
        :param for_job: Do we check the job processing (*True*) or the ISO?
        :type for_job: :class:`bool`
        :param lab_iso_layout: The layout containing the molecule design
            data. Must not be None for :class:`IsoAliquotPlate` or
            :class:`LibraryPlate` objects.
        :type lab_iso_layout: :class:`LabIsoLayout`
        """
        BaseRackVerifier.__init__(self,
                                  reference_layout=lab_iso_layout,
                                  parent=parent)
        #: The lab ISO plate to be checked.
        self.lab_iso_plate = lab_iso_plate
        #: Do we check the job processing (*True*) or the ISO (*False*)?
        self.for_job = for_job
        #: In aliquot and (for controls positions) preparation plates,
        #: we can ignore positions that are derived from another position
        #: at the same plate because the intraplate transfers might be
        #: part of the processing of the second entity.
        self.__ignore_positions = None
        #: This is kind of a hack. We cannot make safe statement about ignored
        #: positions, for this reason, the comparison for ignored positions
        #: is temporarily disabled (until the next position).
        self.__disable_comparison = None
Esempio n. 2
0
    def __init__(self,
                 lab_iso_plate,
                 for_job,
                 lab_iso_layout=None,
                 parent=None):
        """
        Constructor.

        :param lab_iso_plate: The lab ISO plate to be checked.
        :type lab_iso_plate: :class:`IsoPlate` or
            :class:`IsoJobPreparationPlate`
        :param for_job: Do we check the job processing (*True*) or the ISO?
        :type for_job: :class:`bool`
        :param lab_iso_layout: The layout containing the molecule design
            data. Must not be None for :class:`IsoAliquotPlate` or
            :class:`LibraryPlate` objects.
        :type lab_iso_layout: :class:`LabIsoLayout`
        """
        BaseRackVerifier.__init__(self,
                                  reference_layout=lab_iso_layout,
                                  parent=parent)
        #: The lab ISO plate to be checked.
        self.lab_iso_plate = lab_iso_plate
        #: Do we check the job processing (*True*) or the ISO (*False*)?
        self.for_job = for_job
        #: In aliquot and (for controls positions) preparation plates,
        #: we can ignore positions that are derived from another position
        #: at the same plate because the intraplate transfers might be
        #: part of the processing of the second entity.
        self.__ignore_positions = None
        #: This is kind of a hack. We cannot make safe statement about ignored
        #: positions, for this reason, the comparison for ignored positions
        #: is temporarily disabled (until the next position).
        self.__disable_comparison = None
Esempio n. 3
0
 def _check_input(self):
     BaseRackVerifier._check_input(self)
     if not isinstance(self.lab_iso_plate, (IsoPlate, LibraryPlate,
                                            IsoJobPreparationPlate)):
         msg = 'The lab ISO plate must be an %s, %s or an %s ' \
               '(obtained: %s).' % (IsoPlate.__name__, LibraryPlate.__name__,
                 IsoJobPreparationPlate.__name__,
                 self.lab_iso_plate.__class__.__name__)
         self.add_error(msg)
     self._check_input_class('"for job" flag', self.for_job, bool)
Esempio n. 4
0
 def _check_input(self):
     BaseRackVerifier._check_input(self)
     if not isinstance(self.lab_iso_plate,
                       (IsoPlate, LibraryPlate, IsoJobPreparationPlate)):
         msg = 'The lab ISO plate must be an %s, %s or an %s ' \
               '(obtained: %s).' % (IsoPlate.__name__, LibraryPlate.__name__,
                 IsoJobPreparationPlate.__name__,
                 self.lab_iso_plate.__class__.__name__)
         self.add_error(msg)
     self._check_input_class('"for job" flag', self.for_job, bool)
Esempio n. 5
0
    def __init__(self, stock_rack, stock_rack_layout=None, parent=None):
        """
        Constructor.

        :param stock_rack: The stock rack to be checked.
        :type stock_rack: :class:`thelma.entities.iso.StockRack`
        :param stock_rack_layout: The layout containing the molecule design
            and volume data. Can be set here or derived during the run.
        :type stock_rack_layout:  :class:`StockRackLayout`
        """
        BaseRackVerifier.__init__(self, reference_layout=stock_rack_layout, parent=parent)
        #: The stock rack to be checked.
        self.stock_rack = stock_rack
Esempio n. 6
0
 def _get_ids_for_pool(self, md_pool):
     """
     If a floating placeholder occurs for the first time we have dictionary
     instead of a pool.
     """
     if isinstance(md_pool, dict):
         id_map = dict()
         for iso_label, pool in md_pool.iteritems():
             ids = BaseRackVerifier._get_ids_for_pool(self, pool)
             id_map[iso_label] = ids
         return id_map
     else:
         return BaseRackVerifier._get_ids_for_pool(self, md_pool)
Esempio n. 7
0
 def _get_ids_for_pool(self, md_pool):
     """
     If a floating placeholder occurs for the first time we have dictionary
     instead of a pool.
     """
     if isinstance(md_pool, dict):
         id_map = dict()
         for iso_label, pool in md_pool.iteritems():
             ids = BaseRackVerifier._get_ids_for_pool(self, pool)
             id_map[iso_label] = ids
         return id_map
     else:
         return BaseRackVerifier._get_ids_for_pool(self, md_pool)
Esempio n. 8
0
    def __init__(self, stock_rack, stock_rack_layout=None, parent=None):
        """
        Constructor.

        :param stock_rack: The stock rack to be checked.
        :type stock_rack: :class:`thelma.entities.iso.StockRack`
        :param stock_rack_layout: The layout containing the molecule design
            and volume data. Can be set here or derived during the run.
        :type stock_rack_layout:  :class:`StockRackLayout`
        """
        BaseRackVerifier.__init__(self,
                                  reference_layout=stock_rack_layout,
                                  parent=parent)
        #: The stock rack to be checked.
        self.stock_rack = stock_rack
Esempio n. 9
0
    def _are_matching_molecule_designs(self, rack_mds, exp_mds):
        """
        Checks whether the molecule designs for the positions match.
        The method will also try to determine the ISO if this has not
        been happened so far.
        """
        if exp_mds is None or isinstance(exp_mds, list):
            return BaseRackVerifier._are_matching_molecule_designs(
                self, rack_mds, exp_mds)

        # In case of floating position and unknown ISO ...
        for iso_label, iso_mds in exp_mds.iteritems():
            if BaseRackVerifier._are_matching_molecule_designs(
                    self, rack_mds, iso_mds):
                self._used_iso = iso_label
                return True

        return False
Esempio n. 10
0
    def _are_matching_molecule_designs(self, rack_mds, exp_mds):
        """
        Checks whether the molecule designs for the positions match.
        The method will also try to determine the ISO if this has not
        been happened so far.
        """
        if exp_mds is None or isinstance(exp_mds, list):
            return BaseRackVerifier._are_matching_molecule_designs(self,
                                                      rack_mds, exp_mds)

        # In case of floating position and unknown ISO ...
        for iso_label, iso_mds in exp_mds.iteritems():
            if BaseRackVerifier._are_matching_molecule_designs(self,
                                                      rack_mds, iso_mds):
                self._used_iso = iso_label
                return True

        return False
Esempio n. 11
0
    def __init__(self, source_plate, iso_request, parent=None):
        """
        Constructor.

        :param iso_request: The ISO request the plate must represent.
        :type iso_request: :class:`thelma.entities.iso.isoRequest`
        :param source_plate: The plate to be checked.
        :type source_plate: :class:`thelma.entities.rack.Plate`
        """
        BaseRackVerifier.__init__(self, parent=parent)
        #: The ISO request the plate must represent.
        self.iso_request = iso_request
        #: The plate to be checked.
        self.source_plate = source_plate
        #: Maps floating maps (molecule design pools for placeholders) onto ISO
        #: label - is only used when there are floating positions in the ISO
        #: layout.
        self._iso_map = dict()
        #: The name of the ISO the source rack represents.
        self._used_iso = None
Esempio n. 12
0
 def _are_matching_molecule_designs(self, rack_mds, exp_mds):
     """
     If comparison is disabled (because the current position is ignored)
     we always return *True*.
     In any case, comparison is enabled again.
     """
     if self.__disable_comparison:
         self.__disable_comparison = False
         return True
     return BaseRackVerifier._are_matching_molecule_designs(
         self, rack_mds, exp_mds)
Esempio n. 13
0
    def __init__(self, source_plate, iso_request, parent=None):
        """
        Constructor.

        :param iso_request: The ISO request the plate must represent.
        :type iso_request: :class:`thelma.entities.iso.isoRequest`
        :param source_plate: The plate to be checked.
        :type source_plate: :class:`thelma.entities.rack.Plate`
        """
        BaseRackVerifier.__init__(self, parent=parent)
        #: The ISO request the plate must represent.
        self.iso_request = iso_request
        #: The plate to be checked.
        self.source_plate = source_plate
        #: Maps floating maps (molecule design pools for placeholders) onto ISO
        #: label - is only used when there are floating positions in the ISO
        #: layout.
        self._iso_map = dict()
        #: The name of the ISO the source rack represents.
        self._used_iso = None
Esempio n. 14
0
 def _are_matching_molecule_designs(self, rack_mds, exp_mds):
     """
     If comparison is disabled (because the current position is ignored)
     we always return *True*.
     In any case, comparison is enabled again.
     """
     if self.__disable_comparison:
         self.__disable_comparison = False
         return True
     return BaseRackVerifier._are_matching_molecule_designs(self, rack_mds,
                                                            exp_mds)
Esempio n. 15
0
 def _check_input(self):
     BaseRackVerifier._check_input(self)
     self._check_input_class('ISO request', self.iso_request, LabIsoRequest)
Esempio n. 16
0
 def reset(self):
     BaseRackVerifier.reset(self)
     self.__ignore_positions = None
     self.__disable_comparison = False
Esempio n. 17
0
 def reset(self):
     BaseRackVerifier.reset(self)
     self._iso_map = None
     self._used_iso = None
Esempio n. 18
0
 def _check_input(self):
     BaseRackVerifier._check_input(self)
     self._check_input_class('ISO request', self.iso_request, LabIsoRequest)
Esempio n. 19
0
 def reset(self):
     BaseRackVerifier.reset(self)
     self.__ignore_positions = None
     self.__disable_comparison = False
Esempio n. 20
0
 def reset(self):
     BaseRackVerifier.reset(self)
     self._iso_map = None
     self._used_iso = None
Esempio n. 21
0
 def _check_input(self):
     BaseRackVerifier._check_input(self)
     self._check_input_class("stock rack", self.stock_rack, StockRack)
Esempio n. 22
0
 def _check_input(self):
     BaseRackVerifier._check_input(self)
     self._check_input_class('stock rack', self.stock_rack, StockRack)