def validateAndSanitizeOptions(self, options): MantaWorkflowOptionsBase.validateAndSanitizeOptions(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") if options.isRNA: if ((safeLen(options.normalBamList) != 1) or (safeLen(options.tumorBamList) != 0)): raise OptParseException( "RNA mode currently requires exactly one normal sample") else: if options.isUnstrandedRNA: raise OptParseException( "Unstranded only applied for RNA inputs") if options.existingAlignStatsFile is not None: options.existingAlignStatsFile = validateFixExistingFileArg( options.existingAlignStatsFile, "existing align stats") groomBamList(options.normalBamList, "normal sample") groomBamList(options.tumorBamList, "tumor sample") bamSetChecker = BamSetChecker() if safeLen(options.normalBamList) > 0: bamSetChecker.appendBams(options.normalBamList, "Normal") if safeLen(options.tumorBamList) > 0: bamSetChecker.appendBams(options.tumorBamList, "Tumor") bamSetChecker.check(options.htsfileBin, options.referenceFasta)
def validateAndSanitizeOptions(self,options) : MantaWorkflowOptionsBase.validateAndSanitizeOptions(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") if options.isRNA : if ((safeLen(options.normalBamList) != 1) or (safeLen(options.tumorBamList) != 0)) : raise OptParseException("RNA mode currently requires exactly one normal sample") else : if options.isUnstrandedRNA : raise OptParseException("Unstranded only applied for RNA inputs") if options.existingAlignStatsFile is not None : options.existingAlignStatsFile=validateFixExistingFileArg(options.existingAlignStatsFile,"existing align stats") groomBamList(options.normalBamList,"normal sample") groomBamList(options.tumorBamList, "tumor sample") bamSetChecker = BamSetChecker() if safeLen(options.normalBamList) > 0 : bamSetChecker.appendBams(options.normalBamList,"Normal") if safeLen(options.tumorBamList) > 0 : bamSetChecker.appendBams(options.tumorBamList,"Tumor") bamSetChecker.check(options.htsfileBin, options.referenceFasta)