def _record_errors(self): MoleculeDesignPoolLayoutConverter._record_errors(self) if len(self.__invalid_iso_volume) > 0: msg = 'Some position have invalid ISO volumes. The volume must ' \ 'be a positive number. Details: %s.' \ % (self._get_joined_str(self.__invalid_iso_volume)) self.add_error(msg) if len(self.__invalid_iso_concentration) > 0: msg = 'Some position have invalid ISO concentrations. The ' \ 'concentration must a positive number. Details: %s.' \ % (self._get_joined_str(self.__invalid_iso_concentration)) self.add_error(msg) if len(self.__missing_iso_volume) > 0: msg = 'Some position do not have an ISO volume specifications: %s.' \ % (self._get_joined_str(self.__missing_iso_volume)) self.add_error(msg) if len(self.__missing_iso_concentration) > 0: msg = 'Some positions do not have an ISO concentration ' \ 'specification: %s.' \ % (self._get_joined_str(self.__missing_iso_concentration)) self.add_error(msg)
def _record_errors(self): MoleculeDesignPoolLayoutConverter._record_errors(self) if len(self.__invalid_iso_volume) > 0: msg = 'Some position have invalid ISO volumes. The volume must ' \ 'be a positive number. Details: %s.' \ % (self._get_joined_str(self.__invalid_iso_volume)) self.add_error(msg) if len(self.__invalid_iso_concentration) > 0: msg = 'Some position have invalid ISO concentrations. The ' \ 'concentration must a positive number. Details: %s.' \ % (self._get_joined_str(self.__invalid_iso_concentration)) self.add_error(msg) if len(self.__missing_iso_volume) > 0: msg = 'Some position do not have an ISO volume specifications: %s.' \ % (self._get_joined_str(self.__missing_iso_volume)) self.add_error(msg) if len(self.__missing_iso_concentration) > 0: msg = 'Some positions do not have an ISO concentration ' \ 'specification: %s.' \ % (self._get_joined_str(self.__missing_iso_concentration)) self.add_error(msg)
def __init__(self, rack_layout, parent=None): MoleculeDesignPoolLayoutConverter.__init__(self, rack_layout, parent=parent) # intermediate storage of invalid rack positions self.__mismatching_mds = None self.__missing_tubes = None self.__mismatching_tube_num = None
def __init__(self, rack_layout, parent=None): MoleculeDesignPoolLayoutConverter.__init__(self, rack_layout, parent=parent) # intermediate storage of invalid rack positions self.__mismatching_mds = None self.__missing_tubes = None self.__mismatching_tube_num = None
def reset(self): """ Resets all attributes except for the :attr:`rack_layout`. """ MoleculeDesignPoolLayoutConverter.reset(self) self.__invalid_iso_volume = [] self.__invalid_iso_concentration = [] self.__missing_iso_volume = [] self.__missing_iso_concentration = []
def reset(self): """ Resets all attributes except for the :attr:`rack_layout`. """ MoleculeDesignPoolLayoutConverter.reset(self) self.__invalid_iso_volume = [] self.__invalid_iso_concentration = [] self.__missing_iso_volume = [] self.__missing_iso_concentration = []
def __init__(self, rack_layout, parent=None): MoleculeDesignPoolLayoutConverter.__init__(self, rack_layout=rack_layout, parent=parent) #: Do we expect ISO volumes and concentrations? If *False* these #: values are allowed to miss. self._expect_iso_values = True # intermediate storage of invalid rack positions self.__invalid_iso_volume = None self.__invalid_iso_concentration = None self.__missing_iso_volume = None self.__missing_iso_concentration = None
def __init__(self, rack_layout, parent=None): MoleculeDesignPoolLayoutConverter.__init__(self, rack_layout=rack_layout, parent=parent) #: Do we expect ISO volumes and concentrations? If *False* these #: values are allowed to miss. self._expect_iso_values = True # intermediate storage of invalid rack positions self.__invalid_iso_volume = None self.__invalid_iso_concentration = None self.__missing_iso_volume = None self.__missing_iso_concentration = None
def _record_errors(self): MoleculeDesignPoolLayoutConverter._record_errors(self) if len(self.__mismatching_mds) > 0: msg = 'The molecule designs IDs for some pools do not match: %s.' \ % (self._get_joined_str(self.__mismatching_mds)) self.add_error(msg) if len(self.__missing_tubes) > 0: msg = 'The following rack positions do not contain stock tube ' \ 'barcodes: %s.' % (self._get_joined_str(self.__missing_tubes)) self.add_error(msg) if len(self.__mismatching_tube_num) > 0: msg = 'For some positions the number of tubes does not match ' \ 'the number of molecule designs: %s.' \ % (self._get_joined_str(self.__mismatching_tube_num)) self.add_error(msg)
def _record_errors(self): MoleculeDesignPoolLayoutConverter._record_errors(self) if len(self.__mismatching_mds) > 0: msg = 'The molecule designs IDs for some pools do not match: %s.' \ % (self._get_joined_str(self.__mismatching_mds)) self.add_error(msg) if len(self.__missing_tubes) > 0: msg = 'The following rack positions do not contain stock tube ' \ 'barcodes: %s.' % (self._get_joined_str(self.__missing_tubes)) self.add_error(msg) if len(self.__mismatching_tube_num) > 0: msg = 'For some positions the number of tubes does not match ' \ 'the number of molecule designs: %s.' \ % (self._get_joined_str(self.__mismatching_tube_num)) self.add_error(msg)
def _get_position_init_values(self, parameter_map, rack_pos): kw = MoleculeDesignPoolLayoutConverter._get_position_init_values( self, parameter_map, rack_pos) if kw is None: return None # includes empty and untreated type pos pos_type = kw['position_type'] iso_concentration = parameter_map[self.PARAMETER_SET.ISO_CONCENTRATION] iso_volume = parameter_map[self.PARAMETER_SET.ISO_VOLUME] invalid = False is_mock = (pos_type == MOCK_POSITION_TYPE) if self._expect_iso_values and \ not self.__check_volume_and_concentration(iso_volume, iso_concentration, rack_pos.label, is_mock): invalid = True if invalid: return None kw['iso_volume'] = iso_volume kw['iso_concentration'] = iso_concentration return kw
def _get_position_init_values(self, parameter_map, rack_pos): kw = MoleculeDesignPoolLayoutConverter._get_position_init_values(self, parameter_map, rack_pos) if kw is None: return None # includes empty and untreated type pos pos_type = kw['position_type'] iso_concentration = parameter_map[self.PARAMETER_SET.ISO_CONCENTRATION] iso_volume = parameter_map[self.PARAMETER_SET.ISO_VOLUME] invalid = False is_mock = (pos_type == MOCK_POSITION_TYPE) if self._expect_iso_values and \ not self.__check_volume_and_concentration(iso_volume, iso_concentration, rack_pos.label, is_mock): invalid = True if invalid: return None kw['iso_volume'] = iso_volume kw['iso_concentration'] = iso_concentration return kw
def _get_position_init_values(self, parameter_map, rack_pos): kw = MoleculeDesignPoolLayoutConverter._get_position_init_values( self, parameter_map, rack_pos) result = None if not kw is None: invalid = False pos_label = rack_pos.label pool = kw['molecule_design_pool'] md_str = parameter_map[self.PARAMETER_SET.MOLECULE_DESIGNS] if not self.POSITION_CLS.validate_molecule_designs(pool, md_str): exp_mds = [md.id for md in pool] info = '%s (pool %s, found: %s, expected: %s)' \ % (pos_label, pool.id, md_str, self._get_joined_str( exp_mds, is_strs=False, separator='-')) self.__mismatching_mds.append(info) invalid = True tube_str = parameter_map[self.PARAMETER_SET.STOCK_TUBE_BARCODES] if tube_str is None: self.__missing_tubes.append(pos_label) result = None else: tubes = self.POSITION_CLS.get_tube_barcodes_from_tag_value( tube_str) if not len(tubes) == len(pool): info = '%s (%s, number mds: %i)' \ % (pos_label, tube_str, len(pool)) self.__mismatching_tube_num.append(info) invalid = True if invalid: result = None else: kw['stock_tube_barcodes'] = tubes # Success! result = kw return result
def _get_position_init_values(self, parameter_map, rack_pos): kw = MoleculeDesignPoolLayoutConverter._get_position_init_values( self, parameter_map, rack_pos) result = None if not kw is None: invalid = False pos_label = rack_pos.label pool = kw['molecule_design_pool'] md_str = parameter_map[self.PARAMETER_SET.MOLECULE_DESIGNS] if not self.POSITION_CLS.validate_molecule_designs(pool, md_str): exp_mds = [md.id for md in pool] info = '%s (pool %s, found: %s, expected: %s)' \ % (pos_label, pool.id, md_str, self._get_joined_str( exp_mds, is_strs=False, separator='-')) self.__mismatching_mds.append(info) invalid = True tube_str = parameter_map[self.PARAMETER_SET.STOCK_TUBE_BARCODES] if tube_str is None: self.__missing_tubes.append(pos_label) result = None else: tubes = self.POSITION_CLS.get_tube_barcodes_from_tag_value( tube_str) if not len(tubes) == len(pool): info = '%s (%s, number mds: %i)' \ % (pos_label, tube_str, len(pool)) self.__mismatching_tube_num.append(info) invalid = True if invalid: result = None else: kw['stock_tube_barcodes'] = tubes # Success! result = kw return result
def reset(self): MoleculeDesignPoolLayoutConverter.reset(self) self.__mismatching_mds = [] self.__missing_tubes = [] self.__mismatching_tube_num = []
def reset(self): MoleculeDesignPoolLayoutConverter.reset(self) self.__mismatching_mds = [] self.__missing_tubes = [] self.__mismatching_tube_num = []