示例#1
0
    def validateField(self, field_name, new_field_value):
        '''
        Flows qc value must be a positive integer
        Chip type is required
        '''
        if field_name == KitsFieldNames.FLOWS:
            errors = validate_flows(new_field_value)
            if errors:
                self.validationErrors[field_name] = ' '.join(errors)
            else:
                self.validationErrors.pop(field_name, None)

        if field_name == KitsFieldNames.CHIP_TYPE and self.prepopulatedFields.get(
                'is_chipType_required', True):
            if validation.has_value(new_field_value):
                self.validationErrors.pop(field_name, None)
            else:
                self.validationErrors[field_name] = validation.required_error(
                    "Chip Type")

        if field_name == KitsFieldNames.TEMPLATE_KIT_NAME:
            if validation.has_value(new_field_value):
                self.validationErrors.pop(field_name, None)
            else:
                self.validationErrors[field_name] = validation.required_error(
                    "Template Kit")
示例#2
0
    def validateField(self, field_name, new_field_value):
        """
        Flows qc value must be a positive integer
        Chip type is required
        """

        if field_name == KitsFieldNames.FLOWS:
            errors = validate_flows(
                new_field_value,
                field_label=_("workflow.step.kits.fields.flows.label"))
            if errors:
                self.validationErrors[field_name] = " ".join(errors)
            else:
                self.validationErrors.pop(field_name, None)

        if field_name == KitsFieldNames.CHIP_TYPE and self.prepopulatedFields.get(
                "is_chipType_required", True):
            if validation.has_value(new_field_value):
                self.validationErrors.pop(field_name, None)
            else:
                self.validationErrors[field_name] = validation.required_error(
                    _("workflow.step.kits.fields.chipType.label")
                )  # "Chip Type"

        if field_name == KitsFieldNames.TEMPLATE_KIT_NAME:
            if validation.has_value(new_field_value):
                self.validationErrors.pop(field_name, None)
            else:
                self.validationErrors[field_name] = validation.required_error(
                    _("workflow.step.kits.fields.templatekitname.label")
                )  # "Template Kit"

        if field_name == KitsFieldNames.LIBRARY_READ_LENGTH:
            errors = validate_libraryReadLength(
                new_field_value,
                field_label=_(
                    "workflow.step.kits.fields.libraryReadLength.label"),
            )
            if errors:
                self.validationErrors[field_name] = " ".join(errors)
            else:
                self.validationErrors.pop(field_name, None)

        if field_name == KitsFieldNames.READ_LENGTH:
            if new_field_value:
                errors = validate_libraryReadLength(
                    new_field_value,
                    field_label=_(
                        "workflow.step.kits.fields.readLength.label"),
                )
                if errors:
                    self.validationErrors[field_name] = " ".join(errors)
                else:
                    self.validationErrors.pop(field_name, None)
                    self.savedFields[
                        KitsFieldNames.LIBRARY_READ_LENGTH] = new_field_value
示例#3
0
def _validate_flows(input, selectedTemplate, planObj):
    """
    validate flow value with leading/trailing blanks in the input ignored
    """
    errorMsg = None
    if input:
        value = input.strip()
        errors = validate_flows(value)
        if errors:
            errorMsg = '  '.join(errors)
        else:
            planObj.get_expObj().flows = int(value)
    
    return errorMsg
示例#4
0
    def validateField(self, field_name, new_field_value):
        '''
        Flows qc value must be a positive integer
        Chip type is required
        '''
        if field_name == KitsFieldNames.FLOWS:
            errors = validate_flows(new_field_value)
            if errors:
                self.validationErrors[field_name] = ' '.join(errors)
            else:
                self.validationErrors.pop(field_name, None)

        if field_name == KitsFieldNames.CHIP_TYPE and self.prepopulatedFields.get(
                'is_chipType_required', True):
            if validation.has_value(new_field_value):
                self.validationErrors.pop(field_name, None)
            else:
                self.validationErrors[field_name] = validation.required_error(
                    "Chip Type")

        if field_name == KitsFieldNames.TEMPLATE_KIT_NAME:
            if validation.has_value(new_field_value):
                self.validationErrors.pop(field_name, None)
            else:
                self.validationErrors[field_name] = validation.required_error(
                    "Template Kit")

        if field_name == KitsFieldNames.LIBRARY_READ_LENGTH:
            errors = validate_libraryReadLength(new_field_value)
            if errors:
                self.validationErrors[field_name] = ' '.join(errors)
            else:
                self.validationErrors.pop(field_name, None)

        if field_name == KitsFieldNames.READ_LENGTH:
            if new_field_value:
                errors = validate_libraryReadLength(new_field_value)
                if errors:
                    self.validationErrors[field_name] = ' '.join(errors)
                else:
                    self.validationErrors.pop(field_name, None)
                    self.savedFields[
                        KitsFieldNames.LIBRARY_READ_LENGTH] = new_field_value

        if field_name == KitsFieldNames.TEMPLATING_SIZE:
            errors = validate_templatingSize(new_field_value)
            if errors:
                self.validationErrors[field_name] = ' '.join(errors)
            else:
                self.validationErrors.pop(field_name, None)
示例#5
0
def _validate_flows(input, selectedTemplate, planObj):
    """
    validate flow value with leading/trailing blanks in the input ignored
    """
    errorMsg = None
    if input:
        value = input.strip()
        errors = validate_flows(value)
        if errors:
            errorMsg = '  '.join(errors)
        else:
            planObj.get_expObj().flows = int(value)
    
    return errorMsg
示例#6
0
    def validateField(self, field_name, new_field_value):
        '''
        Flows qc value must be a positive integer
        Chip type is required
        '''
        if field_name == KitsFieldNames.FLOWS:
            errors = validate_flows(new_field_value)
            if errors:
                self.validationErrors[field_name] = ' '.join(errors)
            else:
                self.validationErrors.pop(field_name, None)

        if field_name == KitsFieldNames.CHIP_TYPE and self.prepopulatedFields.get('is_chipType_required',True):
            if validation.has_value(new_field_value):
                self.validationErrors.pop(field_name, None)
            else:
                self.validationErrors[field_name] = validation.required_error("Chip Type")
        
        if field_name == KitsFieldNames.TEMPLATE_KIT_NAME:
            if validation.has_value(new_field_value):
                self.validationErrors.pop(field_name, None)
            else:
                self.validationErrors[field_name] = validation.required_error("Template Kit")

        if field_name == KitsFieldNames.LIBRARY_READ_LENGTH:
            errors = validate_libraryReadLength(new_field_value)
            if errors:
                self.validationErrors[field_name] = ' '.join(errors)
            else:
                self.validationErrors.pop(field_name, None)

        if field_name == KitsFieldNames.READ_LENGTH:
            if new_field_value:
                errors = validate_libraryReadLength(new_field_value)
                if errors:
                    self.validationErrors[field_name] = ' '.join(errors)
                else:
                    self.validationErrors.pop(field_name, None)
                    self.savedFields[KitsFieldNames.LIBRARY_READ_LENGTH] = new_field_value 

        if field_name == KitsFieldNames.TEMPLATING_SIZE:
            errors = validate_templatingSize(new_field_value)
            if errors:
                self.validationErrors[field_name] = ' '.join(errors)
            else:
                self.validationErrors.pop(field_name, None)
示例#7
0
    def validateField(self, field_name, new_field_value):
        '''
        Flows qc value must be a positive integer
        Chip type is required
        '''
        if field_name == KitsFieldNames.FLOWS:
            errors = validate_flows(new_field_value)
            if errors:
                self.validationErrors[field_name] = ' '.join(errors)
            else:
                self.validationErrors.pop(field_name, None)

        if field_name == KitsFieldNames.CHIP_TYPE and self.prepopulatedFields.get('is_chipType_required',True):
            if validation.has_value(new_field_value):
                self.validationErrors.pop(field_name, None)
            else:
                self.validationErrors[field_name] = validation.required_error("Chip Type")
        
        if field_name == KitsFieldNames.TEMPLATE_KIT_NAME:
            if validation.has_value(new_field_value):
                self.validationErrors.pop(field_name, None)
            else:
                self.validationErrors[field_name] = validation.required_error("Template Kit")