Exemplo n.º 1
0
def configure(options, cmpH5):
    if cmpH5.readType != "standard":
        raise U.IncompatibleDataException(
            "The Quiver algorithm requires a cmp.h5 file containing standard (non-CCS) reads." )

    if options.parametersSpec == "auto":
        if options.diploid:
            logging.info("Diploid analysis--resorting to unknown.NoQVsModel until other " +
                         "parameter sets can be recalibrated.")
            params = M.loadParameterSets(options.parametersFile, spec="unknown.NoQVsModel")
        else:
            params = M.loadParameterSets(options.parametersFile, cmpH5=cmpH5)
            if not M.allQVsLoaded(cmpH5):
                logging.warn(
                    "This .cmp.h5 file lacks some of the QV data tracks that are required " +
                    "for optimal performance of the Quiver algorithm.  For optimal results" +
                    " use the ResequencingQVs workflow in SMRTPortal with bas.h5 files "    +
                    "from an instrument using software version 1.3.1 or later.")
    else:
        params = M.loadParameterSets(options.parametersFile,
                                    spec=options.parametersSpec,
                                    cmpH5=cmpH5)
        if not all(ps.model.isCompatibleWithCmpH5(cmpH5) for ps in params.values()):
            raise U.IncompatibleDataException(
                "Selected Quiver parameter set is incompatible with this cmp.h5 file " +
                "due to missing data tracks.")

    logging.info("Using Quiver parameter set(s): %s" % (", ".join(ps.name for ps in params.values())))
    return M.QuiverConfig(minMapQV=options.minMapQV,
                          noEvidenceConsensus=options.noEvidenceConsensusCall,
                          refineDinucleotideRepeats=(not options.fastMode) and options.refineDinucleotideRepeats,
                          computeConfidence=(not options.fastMode),
                          parameterSets=params)
Exemplo n.º 2
0
def configure(options, cmpH5):
    if options.verbosity > 1:
        cc.Logging.EnableDiagnosticLogging()

    if cmpH5.readType != "standard":
        raise U.IncompatibleDataException(
            "The Quiver algorithm requires an alignment file containing standard (non-CCS) reads."
        )

    if options.parametersSpec == "auto":
        # Reject Sequel chemistries explicitly---there are no Quiver
        # trainings for Sequel.  Arrow should be used.
        # (Not that power-users can bypass this requirement using an explicit parameter set)
        for chem in cmpH5.sequencingChemistry:
            if chem.startswith("S/"):
                raise U.IncompatibleDataException(
                    "The Quiver algorithm is not trained for Sequel data. " +
                    "Please use the Arrow algorithm instead.")

        if options.diploid:
            logging.info(
                "Diploid analysis--resorting to unknown.NoQVsModel until other "
                + "parameter sets can be recalibrated.")
            params = M.loadParameterSets(options.parametersFile,
                                         spec="unknown.NoQVsModel")
        else:
            params = M.loadParameterSets(options.parametersFile, cmpH5=cmpH5)
            qvMsg = "This alignment file file lacks some of the QV data tracks that are required " + \
                    "for optimal performance of the Quiver algorithm.  For optimal results" + \
                    " use the ResequencingQVs workflow in SMRTPortal with bas.h5 files "    + \
                    "from an instrument using software version 1.3.1 or later, or the "     + \
                    "--forQuiver option to pbalign."
            if not M.enoughQVsLoaded(cmpH5):
                raise U.IncompatibleDataException(qvMsg)
            elif not M.allQVsLoaded(cmpH5):
                logging.warn(qvMsg)
    else:
        params = M.loadParameterSets(options.parametersFile,
                                     spec=options.parametersSpec,
                                     cmpH5=cmpH5)
        if not all(
                ps.model.isCompatibleWithCmpH5(cmpH5)
                for ps in params.values()):
            raise U.IncompatibleDataException(
                "Selected Quiver parameter set is incompatible with this alignment file "
                + "due to missing data tracks.")

    logging.info("Using Quiver parameter set(s): %s" %
                 (", ".join(ps.name for ps in params.values())))
    return M.QuiverConfig(minMapQV=options.minMapQV,
                          noEvidenceConsensus=options.noEvidenceConsensusCall,
                          refineDinucleotideRepeats=(not options.fastMode)
                          and options.refineDinucleotideRepeats,
                          computeConfidence=(not options.fastMode),
                          parameterSets=params)
Exemplo n.º 3
0
def configure(options, cmpH5):
    if options.verbosity > 1:
        cc.Logging.EnableDiagnosticLogging()

    if cmpH5.readType != "standard":
        raise U.IncompatibleDataException(
            "The Quiver algorithm requires an alignment file containing standard (non-CCS) reads." )

    if options.parametersSpec == "auto":
        # Reject Sequel chemistries explicitly---there are no Quiver
        # trainings for Sequel.  Arrow should be used.
        # (Not that power-users can bypass this requirement using an explicit parameter set)
        for chem in cmpH5.sequencingChemistry:
            if chem.startswith("S/"):
                raise U.IncompatibleDataException(
                    "The Quiver algorithm is not trained for Sequel data. " +
                    "Please use the Arrow algorithm instead.")

        if options.diploid:
            logging.info("Diploid analysis--resorting to unknown.NoQVsModel until other " +
                         "parameter sets can be recalibrated.")
            params = M.loadParameterSets(options.parametersFile, spec="unknown.NoQVsModel")
        else:
            params = M.loadParameterSets(options.parametersFile, cmpH5=cmpH5)
            qvMsg = "This alignment file file lacks some of the QV data tracks that are required " + \
                    "for optimal performance of the Quiver algorithm.  For optimal results" + \
                    " use the ResequencingQVs workflow in SMRTPortal with bas.h5 files "    + \
                    "from an instrument using software version 1.3.1 or later, or the "     + \
                    "--forQuiver option to pbalign."
            if not M.enoughQVsLoaded(cmpH5):
                raise U.IncompatibleDataException(qvMsg)
            elif not M.allQVsLoaded(cmpH5):
                logging.warn(qvMsg)
    else:
        params = M.loadParameterSets(options.parametersFile,
                                    spec=options.parametersSpec,
                                    cmpH5=cmpH5)
        if not all(ps.model.isCompatibleWithCmpH5(cmpH5) for ps in params.values()):
            raise U.IncompatibleDataException(
                "Selected Quiver parameter set is incompatible with this alignment file " +
                "due to missing data tracks.")

    logging.info("Using Quiver parameter set(s): %s" % (", ".join(ps.name for ps in params.values())))
    return M.QuiverConfig(minMapQV=options.minMapQV,
                          noEvidenceConsensus=options.noEvidenceConsensusCall,
                          refineDinucleotideRepeats=(not options.fastMode) and options.refineDinucleotideRepeats,
                          computeConfidence=(not options.fastMode),
                          parameterSets=params)