def validateOptionExistence(self,options) : assertOptionExists(options.normalBam,"normal sample BAM file") assertOptionExists(options.alignerMode,"aligner mode") assertOptionExists(options.referenceFasta,"reference fasta file") MantaWorkflowOptionsBase.validateOptionExistence(self,options) # check that the reference and the two bams are using the same set of chromosomes: bamList=[] bamLabels=[] if options.normalBam is not None : bamList.append(options.normalBam) bamLabels.append("Normal") if options.tumorBam is not None : bamList.append(options.tumorBam) bamLabels.append("Tumor") checkChromSet(options.samtoolsBin, options.referenceFasta, bamList, bamLabels, isReferenceLocked=True)
def validateOptionExistence(self,options) : if (((options.normalBamList is None) or (len(options.normalBamList) == 0)) and ((options.tumorBamList is None) or (len(options.tumorBamList) == 0))) : raise OptParseException("No normal & tumor sample BAM files specified") bcheck = BamSetChecker() bcheck.appendBams(options.normalBamList,"Normal") bcheck.appendBams(options.tumorBamList,"Tumor") bcheck.check(options.samtoolsBin, options.referenceFasta) MantaWorkflowOptionsBase.validateOptionExistence(self,options)
def validateOptionExistence(self, options): if (options.normalBamList is None) or (len(options.normalBamList) == 0): raise OptParseException("No normal sample BAM files specified") assertOptionExists(options.alignerMode, "aligner mode") assertOptionExists(options.referenceFasta, "reference fasta file") MantaWorkflowOptionsBase.validateOptionExistence(self, options) # check that the reference and all bams are using the same # set of chromosomes: bamList = [] bamLabels = [] def appendBams(inputBamList, inputLabel): if inputBamList is None: return for inputBamFile in inputBamList: bamList.append(inputBamFile) bamLabels.append(inputLabel) appendBams(options.normalBamList, "Normal") appendBams(options.tumorBamList, "Tumor") checkChromSet(options.samtoolsBin, options.referenceFasta, bamList, bamLabels, isReferenceLocked=True) # check for repeated bam entries: # bamSet = set() for bamFile in bamList: if bamFile in bamSet: raise OptParseException("Repeated input BAM file: %s" % (bamFile)) bamSet.add(bamFile)
def validateOptionExistence(self,options) : def safeLen(x) : if x is None : return 0 return len(x) if ((safeLen(options.normalBamList) == 0) and (safeLen(options.tumorBamList) == 0)) : raise OptParseException("No normal or tumor sample alignment files specified") if (safeLen(options.tumorBamList) > 1) : raise OptParseException("Can't accept more then one tumor sample") if ((safeLen(options.tumorBamList) > 0) and (safeLen(options.normalBamList) > 1)) : raise OptParseException("Can't accept multiple normal samples for tumor subtraction") bcheck = BamSetChecker() bcheck.appendBams(options.normalBamList,"Normal") bcheck.appendBams(options.tumorBamList,"Tumor") bcheck.check(options.htsfileBin, options.referenceFasta) MantaWorkflowOptionsBase.validateOptionExistence(self,options)
def validateOptionExistence(self,options) : if (options.normalBamList is None) or (len(options.normalBamList) == 0) : raise OptParseException("No normal sample BAM files specified") assertOptionExists(options.alignerMode,"aligner mode") assertOptionExists(options.referenceFasta,"reference fasta file") MantaWorkflowOptionsBase.validateOptionExistence(self,options) # check that the reference and all bams are using the same # set of chromosomes: bamList=[] bamLabels=[] def appendBams(inputBamList,inputLabel) : if inputBamList is None : return for inputBamFile in inputBamList : bamList.append(inputBamFile) bamLabels.append(inputLabel) appendBams(options.normalBamList,"Normal") appendBams(options.tumorBamList,"Tumor") checkChromSet(options.samtoolsBin, options.referenceFasta, bamList, bamLabels, isReferenceLocked=True) # check for repeated bam entries: # bamSet=set() for bamFile in bamList : if bamFile in bamSet : raise OptParseException("Repeated input BAM file: %s" % (bamFile)) bamSet.add(bamFile)
def validateOptionExistence(self, options): def safeLen(x): if x is None: return 0 return len(x) if ((safeLen(options.normalBamList) == 0) and (safeLen(options.tumorBamList) == 0)): raise OptParseException( "No normal or tumor sample alignment files specified") if (safeLen(options.tumorBamList) > 1): raise OptParseException("Can't accept more then one tumor sample") if ((safeLen(options.tumorBamList) > 0) and (safeLen(options.normalBamList) > 1)): raise OptParseException( "Can't accept multiple normal samples for tumor subtraction") bcheck = BamSetChecker() bcheck.appendBams(options.normalBamList, "Normal") bcheck.appendBams(options.tumorBamList, "Tumor") bcheck.check(options.htsfileBin, options.referenceFasta) MantaWorkflowOptionsBase.validateOptionExistence(self, options)