def configure(options, alnFile): if alnFile.readType != "standard": raise U.IncompatibleDataException( "The Arrow algorithm requires a BAM file containing standard (non-CCS) reads." ) if options.diploid: logging.warn("Diploid analysis not yet supported under Arrow model.") # load parameters from file if options.parametersFile: logging.info("Loading model parameters from: ({0})".format( options.parametersFile)) if not cc.LoadModels(options.parametersFile): die("Arrow: unable to load parameters from: ({0})".format( options.parametersFile)) # test available chemistries supp = set(cc.SupportedChemistries()) logging.info("Found consensus models for: ({0})".format(", ".join( sorted(supp)))) used = set([]) if options.parametersSpec != "auto": logging.info("Overriding model selection with: ({0})".format( options.parametersSpec)) if not cc.OverrideModel(options.parametersSpec): die("Arrow: unable to override model with: ({0})".format( options.parametersSpec)) used.add(options.parametersSpec) else: used.update(alnFile.sequencingChemistry) unsupp = used - supp if used - supp: die("Arrow: unsupported chemistries found: ({0})".format(", ".join( sorted(unsupp)))) # All arrow models require PW except P6 and the first S/P1-C1 for readGroup in alnFile.readGroupTable: if set([readGroup["SequencingChemistry"]]) - set( ["P6-C4", "S/P1-C1/beta"]): if ("Ipd" not in readGroup["BaseFeatures"] or "PulseWidth" not in readGroup["BaseFeatures"]): die("Arrow model requires missing base feature: IPD or PulseWidth" ) logging.info("Using consensus models for: ({0})".format(", ".join( sorted(used)))) return M.ArrowConfig(minMapQV=options.minMapQV, noEvidenceConsensus=options.noEvidenceConsensusCall, computeConfidence=(not options.fastMode), minReadScore=options.minReadScore, minHqRegionSnr=options.minHqRegionSnr, minZScore=options.minZScore, minAccuracy=options.minAccuracy)
def configure(options, alnFile): if alnFile.readType != "standard": raise U.IncompatibleDataException( "The Arrow algorithm requires a BAM file containing standard (non-CCS) reads." ) if options.diploid: logging.warn("Diploid analysis not yet supported under Arrow model.") return M.ArrowConfig(minMapQV=options.minMapQV, noEvidenceConsensus=options.noEvidenceConsensusCall, computeConfidence=(not options.fastMode))