def get_bgzip_cmd(config, is_retry=False):
    """Retrieve command to use for bgzip, trying to use bgzip parallel threads.

    By default, parallel bgzip is enabled in bcbio. If it causes problems
    please report them. You can turn parallel bgzip off with `tools_off: [pbgzip]`
    """
    num_cores = tz.get_in(["algorithm", "num_cores"], config, 1)
    cmd = config_utils.get_program("bgzip", config)
    if (not is_retry and num_cores > 1 and
          "pbgzip" not in dd.get_tools_off({"config": config})):
        cmd += " --threads %s" % num_cores
    return cmd
Retrieve command to use for bgzip, trying to use bgzip parallel threads.

    By default, parallel bgzip is enabled in bcbio. If it causes problems
    please report them. You can turn parallel bgzip off with `tools_off: [pbgzip]`