Beispiel #1
0
def full(args, dockerconf):
    """Full installaction of docker image and data.
    """
    updates = []
    args = add_install_defaults(args)
    if args.wrapper:
        updates.append("wrapper scripts")
        upgrade_bcbio_vm()
    dmounts = mounts.prepare_system(args.datadir, dockerconf["biodata_dir"])
    if args.install_tools:
        updates.append("bcbio-nextgen code and third party tools")
        pull(args, dockerconf)
        _check_docker_image(args)
        # Ensure external galaxy configuration in sync when doing tool upgrade
        manage.run_bcbio_cmd(args.image, dmounts, ["upgrade"])
    if args.install_data:
        if len(args.genomes) == 0:
            print(
                "Data not installed, no genomes provided with `--genomes` flag"
            )
            sys.exit(1)
        elif len(args.aligners) == 0:
            print(
                "Data not installed, no aligners provided with `--aligners` flag"
            )
            sys.exit(1)
        else:
            updates.append("biological data")
        if _check_docker_image(args, raise_error=False):
            manage.run_bcbio_cmd(args.image, dmounts, _get_cl(args))
        else:
            args.upgrade = False
            args.tools = False
            args.tooldir = False
            args.toolplus = False
            args.isolate = True
            args.distribution = None
            args.cwl = True
            print(args)
            from bcbio import install
            install.upgrade_bcbio(args)
    _save_install_defaults(args)
    if updates:
        print("\nbcbio-nextgen-vm updated with latest %s" %
              " and ".join(updates))
    else:
        print(
            "\nNo update targets specified, need '--wrapper', '--tools' or '--data'\n"
            "See 'bcbio_vm.py upgrade -h' for more details.")
Beispiel #2
0
def full(args, dockerconf):
    """Full installaction of docker image and data.
    """
    updates = []
    args = add_install_defaults(args)
    if args.wrapper:
        updates.append("wrapper scripts")
        upgrade_bcbio_vm()
    dmounts = mounts.prepare_system(args.datadir, dockerconf["biodata_dir"])
    if args.install_tools:
        updates.append("bcbio-nextgen code and third party tools")
        pull(args, dockerconf)
        _check_docker_image(args)
        # Ensure external galaxy configuration in sync when doing tool upgrade
        manage.run_bcbio_cmd(args.image, dmounts, ["upgrade"])
    if args.install_data:
        if len(args.genomes) == 0:
            print("Data not installed, no genomes provided with `--genomes` flag")
            sys.exit(1)
        elif len(args.aligners) == 0:
            print("Data not installed, no aligners provided with `--aligners` flag")
            sys.exit(1)
        else:
            updates.append("biological data")
        if _check_docker_image(args, raise_error=False):
            manage.run_bcbio_cmd(args.image, dmounts, _get_cl(args))
        else:
            args.upgrade = False
            args.tools = False
            args.tooldir = False
            args.toolplus = False
            args.isolate = True
            args.distribution = None
            args.cwl = True
            print(args)
            from bcbio import install
            install.upgrade_bcbio(args)
    _save_install_defaults(args)
    if updates:
        print("\nbcbio-nextgen-vm updated with latest %s" % " and ".join(updates))
    else:
        print("\nNo update targets specified, need '--wrapper', '--tools' or '--data'\n"
              "See 'bcbio_vm.py upgrade -h' for more details.")
        sys.exit()
    if fc_dir:
        fc_dir = os.path.abspath(fc_dir)
    if run_info_yaml:
        run_info_yaml = os.path.abspath(run_info_yaml)
    if kwargs.get("workflow"):
        kwargs["inputs"] = inputs
    kwargs["config_file"] = global_config
    kwargs["fc_dir"] = fc_dir
    kwargs["run_info_yaml"] = run_info_yaml
    return kwargs

if __name__ == "__main__":
    kwargs = parse_cl_args(sys.argv[1:])
    if "upgrade" in kwargs and kwargs["upgrade"]:
        install.upgrade_bcbio(kwargs["args"])
    elif "server" in kwargs and kwargs["server"]:
        server_main.start(kwargs["args"])
    elif "runfn" in kwargs and kwargs["runfn"]:
        runfn.process(kwargs["args"])
    elif "graph" in kwargs and kwargs["graph"]:
        graph.bootstrap(kwargs["args"])
    elif "version" in kwargs and kwargs["version"]:
        programs.write_versions({"work": kwargs["args"].workdir})
    elif "sequencer" in kwargs and kwargs["sequencer"]:
        machine.check_and_postprocess(kwargs["args"])
    else:
        if kwargs.get("workflow"):
            setup_info = workflow.setup(kwargs["workflow"], kwargs.pop("inputs"))
            if setup_info is None:  # no automated run after setup
                sys.exit(0)
Beispiel #4
0
    if fc_dir:
        fc_dir = os.path.abspath(fc_dir)
    if run_info_yaml:
        run_info_yaml = os.path.abspath(run_info_yaml)
    if kwargs.get("workflow"):
        kwargs["inputs"] = inputs
    kwargs["config_file"] = global_config
    kwargs["fc_dir"] = fc_dir
    kwargs["run_info_yaml"] = run_info_yaml
    return kwargs


if __name__ == "__main__":
    kwargs = parse_cl_args(sys.argv[1:])
    if "upgrade" in kwargs and kwargs["upgrade"]:
        install.upgrade_bcbio(kwargs["args"])
    elif "server" in kwargs and kwargs["server"]:
        server_main.start(kwargs["args"])
    elif "runfn" in kwargs and kwargs["runfn"]:
        runfn.process(kwargs["args"])
    elif "graph" in kwargs and kwargs["graph"]:
        graph.bootstrap(kwargs["args"])
    elif "version" in kwargs and kwargs["version"]:
        programs.write_versions({"work": kwargs["args"].workdir})
    elif "sequencer" in kwargs and kwargs["sequencer"]:
        machine.check_and_postprocess(kwargs["args"])
    else:
        if kwargs.get("workflow"):
            setup_info = workflow.setup(kwargs["workflow"],
                                        kwargs.pop("inputs"))
            if setup_info is None:  # no automated run after setup
Beispiel #5
0
    """
    if "scheduler" in args and "queue" in args:
        if args.scheduler and not args.queue:
            if args.scheduler != "sge":
                return "IPython parallel scheduler (-s) specified. This also requires a queue (-q)."
        elif args.queue and not args.scheduler:
            return "IPython parallel queue (-q) supplied. This also requires a scheduler (-s)."
        elif args.paralleltype == "ipython" and (not args.queue
                                                 or not args.scheduler):
            return "IPython parallel requires queue (-q) and scheduler (-s) arguments."


if __name__ == '__main__':
    # sys.argv.extend(['upgrade' ,  '--tooldir', '/usr/local', '--genomes', 'GRCh37', '--aligners', 'bwa', '--aligners', 'bowtie2', '--data'])

    sys.argv.extend([
        '-w', 'template',
        r'D:\python-projects\my_bcbio\config\gatk-variant.yaml', 'project1',
        'sample1.bam', 'sample2_1.fq', 'sample2_2.fq'
    ])
    # sys.argv.extend([ '-h'])

    kwargs = parse_cl_args(sys.argv[1:])
    if "upgrade" in kwargs and kwargs['upgrade']:
        install.upgrade_bcbio(kwargs['args'])
    else:
        if kwargs.get("workflow"):
            setup_info = workflow.setup(kwargs['workflow'],
                                        kwargs.pop("inputs"))
    print(kwargs)