Exemplo n.º 1
0
def run_subtool(parser, args):
    logger.debug(f"command: {args.command}")
    logger.debug(f"args: {args}")
    if args.command == "variants":
        if args.sub_command == "add":
            from mykrobe.cmds.variants.add import run
        elif args.sub_command == "dump-probes":
            from mykrobe.cmds.dump import run
        elif args.sub_command == "make-probes":
            from mykrobe.cmds.makeprobes import run
    elif args.command == "predict":
        from mykrobe.cmds.amr import run
    elif args.command == "panels":
        if args.sub_command == "describe":
            from mykrobe.cmds.panels import describe as run
        elif args.sub_command == "update_metadata":
            from mykrobe.cmds.panels import update_metadata as run
        elif args.sub_command == "update_species":
            from mykrobe.cmds.panels import update_species as run
    elif args.command == "genotype":
        raise NotImplementedError(
            "The 'genotype' option is no longer available - please use 'predict' with "
            "the species as 'custom' and the option --custom_probe_set_path "
            "probes.fasta (and also see the options --custom_variant_to_resistance_json, "
            "--custom_lineage_json) "
        )
    else:
        raise NotImplementedError(f"{args.command} is not a recognised mykrobe command")

    # run the chosen submodule.
    logger.debug(f"Start run {run.__module__}")
    run(parser, args)
    logger.debug(f"End run {run.__module__}")
Exemplo n.º 2
0
def run_subtool(parser, args):
    if args.command == "variants":
        if args.sub_command == 'add':
            from mykrobe.cmds.variants.add import run
    # elif args.command == "add-gt":
    #     from mykrobe.cmds.atlasadd import run
        elif args.sub_command == "dump-probes":
            from mykrobe.cmds.dump import run
        elif args.sub_command == "make-probes":
            from mykrobe.cmds.makeprobes import run
    elif args.command == "predict":
        from mykrobe.cmds.amr import run
    elif args.command == "genotype":
        from mykrobe.cmds.genotype import run

    elif args.command == "place":
        from mykrobe.cmds.place import run
    elif args.command == "diff":
        from mykrobe.cmds.diff import run
    # run the chosen submodule.
    run(parser, args)