def __init__(self, rack_position, molecule_design_pool, stock_tube_barcodes): """ :param rack_position: The source rack position in the source rack. :type rack_position: :class:`thelma.entities.rack.RackPosition` :param molecule_design_pool: A molecule design pool to generate. :type molecule_design_pool: :class:`thelma.entities.moleculedesign.MoleculeDesignPool` :param stock_tube_barcodes: The stock tube barcodes for the single molecule design tubes used to generate this pool. :type stock_tube_barcodes: :class:`list` """ MoleculeDesignPoolPosition.__init__(self, rack_position=rack_position, molecule_design_pool=molecule_design_pool, position_type=FIXED_POSITION_TYPE) if not isinstance(stock_tube_barcodes, list): msg = 'The stock tube barcodes must be a list (obtained: %s).' \ % (stock_tube_barcodes.__class__.__name__) raise TypeError(msg) #: A list of molecules contained in the pool (ordered by ID). self.molecule_designs = [] for md in molecule_design_pool.molecule_designs: self.molecule_designs.append(md) self.molecule_designs.sort() #: The stock tube barcodes for the single molecule design tubes #: used to generate this pool self.stock_tube_barcodes = sorted(stock_tube_barcodes)
def __init__(self, rack_position, molecule_design_pool=None, position_type=None, iso_concentration=None, iso_volume=None): """ Constructor: :param rack_position: The rack position. :type rack_position: :class:`thelma.entities.rack.RackPosition`. :param molecule_design_pool: The molecule design pool for this position or a valid placeholder. :type molecule_design_pool: :class:`thelma.entities.moleculedesign.MoleculeDesignPool` or :class:`basestring` :param position_type: influences valid values for other parameters :type position_type: :class:`str :param iso_concentration: The concentration requested from the stock. :type iso_concentration: positive number :param iso_volume: The volume requested by the stock. :type iso_volume: positive number """ MoleculeDesignPoolPosition.__init__(self, rack_position=rack_position, molecule_design_pool=molecule_design_pool, position_type=position_type) #: The concentration requested by the stock management. self.iso_concentration = get_converted_number(iso_concentration) #: The volume requested by the stock management. self.iso_volume = get_converted_number(iso_volume) self.__check_values_for_position_type()
def __init__(self, rack_position, molecule_design_pool, stock_tube_barcodes): """ :param rack_position: The source rack position in the source rack. :type rack_position: :class:`thelma.entities.rack.RackPosition` :param molecule_design_pool: A molecule design pool to generate. :type molecule_design_pool: :class:`thelma.entities.moleculedesign.MoleculeDesignPool` :param stock_tube_barcodes: The stock tube barcodes for the single molecule design tubes used to generate this pool. :type stock_tube_barcodes: :class:`list` """ MoleculeDesignPoolPosition.__init__( self, rack_position=rack_position, molecule_design_pool=molecule_design_pool, position_type=FIXED_POSITION_TYPE) if not isinstance(stock_tube_barcodes, list): msg = 'The stock tube barcodes must be a list (obtained: %s).' \ % (stock_tube_barcodes.__class__.__name__) raise TypeError(msg) #: A list of molecules contained in the pool (ordered by ID). self.molecule_designs = [] for md in molecule_design_pool.molecule_designs: self.molecule_designs.append(md) self.molecule_designs.sort() #: The stock tube barcodes for the single molecule design tubes #: used to generate this pool self.stock_tube_barcodes = sorted(stock_tube_barcodes)
def __eq__(self, other): if not MoleculeDesignPoolPosition.__eq__(self, other): return False if not self.is_empty and not self.iso_volume == other.iso_volume: return False if not (self.is_empty or self.is_mock) and \ not self.iso_concentration == other.iso_concentration: return False return True
def _get_parameter_values_map(self): """ Returns the :attr:`parameter_values_map` """ parameter_map = MoleculeDesignPoolPosition._get_parameter_values_map( self) parameter_map[self.PARAMETER_SET.ISO_VOLUME] = self.iso_volume parameter_map[self.PARAMETER_SET.ISO_CONCENTRATION] = \ self.iso_concentration return parameter_map
def get_parameter_tag(self, parameter): """ The method needs to be overwritten because the value for the molecule designs tag is a concatenated string. Position types are not important """ if parameter == self.PARAMETER_SET.MOLECULE_DESIGNS: return self.__get_molecule_designs_tag() elif parameter == self.PARAMETER_SET.STOCK_TUBE_BARCODES: return self.__get_stock_barcodes_tag() else: return MoleculeDesignPoolPosition.get_parameter_tag(self, parameter)
def get_parameter_tag(self, parameter): """ The method needs to be overwritten because the value for the molecule designs tag is a concatenated string. Position types are not important """ if parameter == self.PARAMETER_SET.MOLECULE_DESIGNS: return self.__get_molecule_designs_tag() elif parameter == self.PARAMETER_SET.STOCK_TUBE_BARCODES: return self.__get_stock_barcodes_tag() else: return MoleculeDesignPoolPosition.get_parameter_tag( self, parameter)
def __init__(self, rack_position, molecule_design_pool=None, position_type=None, iso_concentration=None, iso_volume=None): """ Constructor: :param rack_position: The rack position. :type rack_position: :class:`thelma.entities.rack.RackPosition`. :param molecule_design_pool: The molecule design pool for this position or a valid placeholder. :type molecule_design_pool: :class:`thelma.entities.moleculedesign.MoleculeDesignPool` or :class:`basestring` :param position_type: influences valid values for other parameters :type position_type: :class:`str :param iso_concentration: The concentration requested from the stock. :type iso_concentration: positive number :param iso_volume: The volume requested by the stock. :type iso_volume: positive number """ MoleculeDesignPoolPosition.__init__( self, rack_position=rack_position, molecule_design_pool=molecule_design_pool, position_type=position_type) #: The concentration requested by the stock management. self.iso_concentration = get_converted_number(iso_concentration) #: The volume requested by the stock management. self.iso_volume = get_converted_number(iso_volume) self.__check_values_for_position_type()
def __eq__(self, other): if not MoleculeDesignPoolPosition.__eq__(self, other): result = False else: result = self.stock_tube_barcodes == other.stock_tube_barcodes return result