def __eq__(self, other): if not IsoRequestPosition.__eq__(self, other): return False if not self.is_empty: if not self.reagent_name == other.reagent_name: return False if not self.reagent_dil_factor == other.reagent_dil_factor: return False if not (self.is_mock or self.is_empty): if not self.final_concentration == other.final_concentration: return False return True
def __init__(self, rack_position, molecule_design_pool=None, position_type=None, reagent_name=None, reagent_dil_factor=None, iso_volume=None, iso_concentration=None, final_concentration=None, optimem_dil_factor=None): """ :param rack_position: The rack position. :type rack_position: :class:`thelma.entities.rack.RackPosition`. :param molecule_design_pool: The molecule design pool or placeholder for the RNAi reagent. :type molecule_design_pool: :class`int` (ID), :class:`str` (placeholder) or :class:`thelma.entities.moleculedesign.StockSampleMoleculeDesign` :param position_type: influences valid values for other parameters :type position_type: :class:`str :param reagent_name: The name of the transfection reagent. :type reagent_name: :class:`str` :param reagent_dil_factor: The final dilution factor of the transfection reagent in the cell plate. :type reagent_dil_factor: positive number, no unit :param iso_volume: The volume requested by the stock management. :type iso_volume: positive number, unit ul :param iso_concentration: The concentration requested by the stock management. :type iso_concentration: positive number, unit nM :param final_concentration: The final concentration of the RNAi reagent in the cell plate. :type final_concentration: positive number, unit nM :param optimem_dil_factor: The dilution factor for the OptiMem dilution (use only if you do not want to use the default factor). :type optimem_dil_factor: positive number """ IsoRequestPosition.__init__(self, rack_position=rack_position, molecule_design_pool=molecule_design_pool, position_type=position_type, iso_volume=iso_volume, iso_concentration=iso_concentration) #: Stores the position in the cell plate that are filled by this #: source positions (:class:`set` of #: :class:`thelma.entities.rack.RackPosition` objects). self.cell_plate_positions = set() #: The name of the RNAi reagent. self.reagent_name = reagent_name #: The final dilution factor RNAi reagent in the cell plate. self.reagent_dil_factor = get_converted_number(reagent_dil_factor) #: The final concentration in the cell plate (experiment plate). self.final_concentration = get_converted_number(final_concentration) #: The optimem dilution factor set in library screenings (because #: in this case it is depending on the final concentration instead #: of depending on the molecule type). self._optimem_dil_factor = optimem_dil_factor tf_attrs = [('reagent name', self.reagent_name), ('reagent dilution factor', self.reagent_dil_factor), ('final concentration', self.final_concentration), ('optimem dilution factor', self._optimem_dil_factor)] if self.is_untreated_type: self._check_untreated_values(tf_attrs) elif self.is_empty: self._check_none_value(tf_attrs) else: if self.reagent_name is not None and \ (not isinstance(self.reagent_name, basestring) or \ len(self.reagent_name) < 2): msg = 'The reagent name must be at least 2 characters long ' \ 'if there is one (obtained: "%s")!' % (self.reagent_name) raise ValueError(msg) numericals = [tf_attrs[1], tf_attrs[3]] if self.is_mock: self._check_mock_values([tf_attrs[2]]) else: numericals.append(tf_attrs[2]) self._check_numbers(numericals, allow_none=True)