def _validateGenome(cls, choices, validateBinaryTracksIfPresent=True): from quick.multitrack.MultiTrackCommon import getGSuiteFromGalaxyTN from quick.application.ProcTrackOptions import ProcTrackOptions allGSuiteGalaxyTNs = [ getattr(choices, key) for key in cls.GSUITE_FILE_OPTIONS_BOX_KEYS ] if all(allGSuiteGalaxyTNs): if (not cls._allowGenomeOverride(choices) ) and cls._getNumUniquelySpecifiedGenomes(choices) > 1: return cls.ERROR_GENOME_BUILD_MISMATCH + ', '.join( cls._getGsuiteGenomes(choices)) errorStr = GeneralGuiTool._checkGenome(choices.genome) if errorStr: return errorStr if not cls._allowMultipleGenomes( choices) and choices.genome == GSuiteConstants.MULTIPLE: return cls.ERROR_MULTIPLE_GENOMES_NOT_ALLOWED if validateBinaryTracksIfPresent: for galaxyTN in allGSuiteGalaxyTNs: gSuite = getGSuiteFromGalaxyTN(galaxyTN) if gSuite.fileFormat == GSuiteConstants.PREPROCESSED and gSuite.location == GSuiteConstants.LOCAL: for gSuiteTrack in gSuite.allTracks(): if not ProcTrackOptions.isValidTrack( choices.genome, gSuiteTrack.trackName, True): return cls.ERROR_PREPROCESSED_TRACK_INVALID % gSuiteTrack.title
def validateAndReturnErrors(choices): errorStr = GeneralGuiTool._checkGenome(choices.genome) if errorStr: return errorStr if not choices.seqs: return 'Please enter at least one sequence'
def validateAndReturnErrors(choices): ''' Should validate the selected input parameters. If the parameters are not valid, an error text explaining the problem should be returned. The GUI then shows this text to the user (if not empty) and greys out the execute button (even if the text is empty). If all parameters are valid, the method should return None, which enables the execute button. ''' if choices.selectGenome == 'Yes': errorStr = GeneralGuiTool._checkGenome(choices.genome) if errorStr: return errorStr if not any(val is not None for val in choices.history.values()): return 'Please select at least one history element'
def validateAndReturnErrors(cls, choices): #if choices[0] == 'Text' and choices[1].strip() == '': # return 'You have to enter a search text' if cls.exception: return cls.exception if choices.search in [None, '--Select--' ] or choices.subCategory in [None, '--Select--']: return '' #if choices.outputType == 'Categorized Search for Tracks': if not choices.filetype in [None, '', []] and len([ x for x, selected in choices.filetype.iteritems() if selected ]) == 0: return 'You have to select at least one file type' if choices.downloadAndPreprocess == 'Yes': errorStr = cls._checkGenome(choices.genome) if errorStr: return errorStr return GeneralGuiTool._checkGenome(choices.genome)