def validateAndSanitizeExistingOptions(self, options): groomBamList(options.normalBamList, "normal sample") groomBamList(options.tumorBamList, "tumor sample") MantaWorkflowOptionsBase.validateAndSanitizeExistingOptions( self, options)
def validateAndSanitizeExistingOptions(self,options) : options.normalBam=validateFixExistingFileArg(options.normalBam,"normal sample BAM file") options.tumorBam=validateFixExistingFileArg(options.tumorBam,"tumor sample BAM file") # check for bam index files: for bam in (options.tumorBam,options.normalBam) : if bam is None : continue baiFile=bam+".bai" if not os.path.isfile(baiFile) : raise OptParseException("Can't find expected BAM index file: '%s'" % (baiFile)) # check alignerMode: if options.alignerMode is not None : options.alignerMode = options.alignerMode.lower() if options.alignerMode not in self.validAlignerModes : raise OptParseException("Invalid aligner mode: '%s'" % options.alignerMode) options.referenceFasta=validateFixExistingFileArg(options.referenceFasta,"reference") # check for reference fasta index file: if options.referenceFasta is not None : faiFile=options.referenceFasta + ".fai" if not os.path.isfile(faiFile) : raise OptParseException("Can't find expected fasta index file: '%s'" % (faiFile)) MantaWorkflowOptionsBase.validateAndSanitizeExistingOptions(self,options)
def validateAndSanitizeExistingOptions(self, options): def checkForBamIndex(bamFile): baiFile = bamFile + ".bai" if not os.path.isfile(baiFile): raise OptParseException( "Can't find expected BAM index file: '%s'" % (baiFile)) def groomBamList(bamList, sampleLabel): if bamList is None: return for (index, bamFile) in enumerate(bamList): bamList[index] = validateFixExistingFileArg( bamFile, "%s BAM file" % (sampleLabel)) checkForBamIndex(bamList[index]) groomBamList(options.normalBamList, "normal sample") groomBamList(options.tumorBamList, "tumor sample") # check alignerMode: if options.alignerMode is not None: options.alignerMode = options.alignerMode.lower() if options.alignerMode not in self.validAlignerModes: raise OptParseException("Invalid aligner mode: '%s'" % options.alignerMode) options.referenceFasta = validateFixExistingFileArg( options.referenceFasta, "reference") # check for reference fasta index file: if options.referenceFasta is not None: faiFile = options.referenceFasta + ".fai" if not os.path.isfile(faiFile): raise OptParseException( "Can't find expected fasta index file: '%s'" % (faiFile)) if (options.regionStrList is None) or (len(options.regionStrList) == 0): options.genomeRegionList = None else: options.genomeRegionList = [ parseGenomeRegion(r) for r in options.regionStrList ] MantaWorkflowOptionsBase.validateAndSanitizeExistingOptions( self, options)
def validateAndSanitizeExistingOptions(self,options) : def checkForBamIndex(bamFile): baiFile=bamFile + ".bai" if not os.path.isfile(baiFile) : raise OptParseException("Can't find expected BAM index file: '%s'" % (baiFile)) def groomBamList(bamList, sampleLabel): if bamList is None : return for (index,bamFile) in enumerate(bamList) : bamList[index]=validateFixExistingFileArg(bamFile,"%s BAM file" % (sampleLabel)) checkForBamIndex(bamList[index]) groomBamList(options.normalBamList,"normal sample") groomBamList(options.tumorBamList, "tumor sample") # check alignerMode: if options.alignerMode is not None : options.alignerMode = options.alignerMode.lower() if options.alignerMode not in self.validAlignerModes : raise OptParseException("Invalid aligner mode: '%s'" % options.alignerMode) options.referenceFasta=validateFixExistingFileArg(options.referenceFasta,"reference") # check for reference fasta index file: if options.referenceFasta is not None : faiFile=options.referenceFasta + ".fai" if not os.path.isfile(faiFile) : raise OptParseException("Can't find expected fasta index file: '%s'" % (faiFile)) if (options.regionStrList is None) or (len(options.regionStrList) == 0) : options.genomeRegionList = None else : options.genomeRegionList = [parseGenomeRegion(r) for r in options.regionStrList] MantaWorkflowOptionsBase.validateAndSanitizeExistingOptions(self,options)
def validateAndSanitizeExistingOptions(self,options) : groomBamList(options.normalBamList,"normal sample") groomBamList(options.tumorBamList, "tumor sample") MantaWorkflowOptionsBase.validateAndSanitizeExistingOptions(self,options)