def validateAndSanitizeOptions(self, options):

        StrelkaSharedWorkflowOptionsBase.validateAndSanitizeOptions(
            self, options)

        def checkFixTabixIndexedFileOption(tabixFile, label):
            checkOptionalTabixIndexedFile(tabixFile, label)
            if tabixFile is None: return None
            return os.path.abspath(tabixFile)

        if options.excludedRegions is not None:
            for excludeIndex in range(len(options.excludedRegions)):
                options.excludedRegions[excludeIndex] = \
                    checkFixTabixIndexedFileOption(options.excludedRegions[excludeIndex],"excluded-regions bed")

        if options.knownVariants is not None:
            options.knownVariants = \
                checkFixTabixIndexedFileOption(options.knownVariants,"known-variants vcf")

        groomBamList(options.bamList, "input")

        bamSetChecker = BamSetChecker()

        def singleAppender(bamList, label):
            if len(bamList) > 1:
                raise OptParseException(
                    "More than one %s sample BAM/CRAM files specified" %
                    (label))
            bamSetChecker.appendBams(bamList, label)

        singleAppender(options.bamList, "Input")
        bamSetChecker.check(options.htsfileBin, options.referenceFasta)
    def validateAndSanitizeOptions(self,options) :

        StrelkaSharedWorkflowOptionsBase.validateAndSanitizeOptions(self,options)

        checkFixTabixListOption(options.noiseVcfList,"noise vcf")

        groomBamList(options.normalBamList,"normal sample")
        groomBamList(options.tumorBamList, "tumor sample")

        def checkRequired(bamList,label):
            if (bamList is None) or (len(bamList) == 0) :
                raise OptParseException("No %s sample BAM/CRAM files specified" % (label))

        checkRequired(options.tumorBamList,"tumor")

        bamSetChecker = BamSetChecker()

        def singleAppender(bamList,label):
            if bamList is None : return
            if len(bamList) > 1 :
                raise OptParseException("More than one %s sample BAM/CRAM files specified" % (label))
            bamSetChecker.appendBams(bamList,label)

        singleAppender(options.normalBamList,"normal")
        singleAppender(options.tumorBamList,"tumor")
        bamSetChecker.check(options.htsfileBin,
                     options.referenceFasta)
    def validateOptionExistence(self, options):

        StrelkaSharedWorkflowOptionsBase.validateOptionExistence(self, options)

        bcheck = BamSetChecker()

        def singleAppender(bamList, label):
            if len(bamList) > 1:
                raise OptParseException(
                    "More than one %s sample BAM/CRAM files specified" %
                    (label))
            bcheck.appendBams(bamList, label)

        singleAppender(options.bamList, "Input")
        bcheck.check(options.htsfileBin, options.referenceFasta)
    def validateOptionExistence(self, options):

        StrelkaSharedWorkflowOptionsBase.validateOptionExistence(self, options)

        if len(options.probandBamList) != 1:
            raise OptParseException(
                "Must specify one proband sample BAM/CRAM file")

        if len(options.parentBamList) != 2:
            raise OptParseException(
                "Must specify two parent sample BAM/CRAM files")

        bcheck = BamSetChecker()
        bcheck.appendBams(options.probandBamList, "proband")
        bcheck.appendBams(options.parentBamList, "parent")
        bcheck.appendBams(options.siblingBamList, "sibling", isAllowEmpty=True)
        bcheck.check(options.htsfileBin, options.referenceFasta)
Ejemplo n.º 5
0
    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):

        StrelkaSharedWorkflowOptionsBase.validateOptionExistence(self, options)

        def checkRequired(bamList, label):
            if (bamList is None) or (len(bamList) == 0):
                raise OptParseException(
                    "No %s sample BAM/CRAM files specified" % (label))

        checkRequired(options.tumorBamList, "tumor")

        bcheck = BamSetChecker()

        def singleAppender(bamList, label):
            if bamList is None: return
            if len(bamList) > 1:
                raise OptParseException(
                    "More than one %s sample BAM/CRAM files specified" %
                    (label))
            bcheck.appendBams(bamList, label)

        singleAppender(options.normalBamList, "normal")
        singleAppender(options.tumorBamList, "tumor")
        bcheck.check(options.htsfileBin, options.referenceFasta)
Ejemplo n.º 7
0
    def validateAndSanitizeOptions(self, options):

        StrelkaSharedWorkflowOptionsBase.validateAndSanitizeOptions(
            self, options)

        groomBamList(options.bamList, "input")

        bamSetChecker = BamSetChecker()
        bamSetChecker.appendBams(options.bamList, "Input")
        bamSetChecker.check(options.samtoolsBin, options.referenceFasta)
Ejemplo n.º 8
0
    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)
Ejemplo n.º 9
0
    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)
Ejemplo n.º 10
0
    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)
Ejemplo n.º 11
0
    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)
Ejemplo n.º 12
0
    def validateAndSanitizeOptions(self, options):

        StrelkaSharedWorkflowOptionsBase.validateAndSanitizeOptions(
            self, options)

        options.ploidyFilename = checkFixTabixIndexedFileOption(
            options.ploidyFilename, "ploidy file")
        options.noCompressBed = checkFixTabixIndexedFileOption(
            options.noCompressBed, "no-compress bed")
        if options.snvScoringModelFile is None:
            if options.isRNA:
                options.snvScoringModelFile = options.rnaSnvScoringModelFile
            else:
                options.snvScoringModelFile = options.germlineSnvScoringModelFile

        if options.indelScoringModelFile is None:
            if options.isRNA:
                options.indelScoringModelFile = options.rnaIndelScoringModelFile
            else:
                options.indelScoringModelFile = options.germlineIndelScoringModelFile

        # Disable dynamic error estimation for Exome
        if options.isExome:
            options.isEstimateSequenceError = False

        # Disable dynamic error estimation for RNA
        if options.isRNA:
            options.isEstimateSequenceError = False

        groomBamList(options.bamList, "input")

        def safeLen(x):
            if x is None: return 0
            return len(x)

        if safeLen(options.bamList) == 0:
            raise OptParseException(
                "No input sample alignment files specified")

        bamSetChecker = BamSetChecker()
        bamSetChecker.appendBams(options.bamList, "Input")
        bamSetChecker.check(options.htsfileBin, options.referenceFasta)
Ejemplo n.º 13
0
    def validateOptionExistence(self, options):

        StrelkaSharedWorkflowOptionsBase.validateOptionExistence(self, options)
        bcheck = BamSetChecker()
        bcheck.appendBams(options.bamList, "Input")
        bcheck.check(options.samtoolsBin, options.referenceFasta)