How to use the refgenie.exceptions.MissingFolderError function in refgenie

To help you get started, we’ve selected a few refgenie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github databio / refgenie / refgenie / refgenie.py View on Github external
raise NotImplementedError("Can only add 1 asset at a time")
        else:
            refgenie_add(rgc, asset_list[0], args.path, args.force)

    elif args.command == PULL_CMD:
        rgc = RefGenConf(filepath=gencfg, writable=False)
        if args.force:
            force = True
        elif args.no_overwrite:
            force = False
        else:
            force = None

        outdir = rgc[CFG_FOLDER_KEY]
        if not os.path.exists(outdir):
            raise MissingFolderError(outdir)
        target = _key_to_name(CFG_FOLDER_KEY)
        if not perm_check_x(outdir, target):
            return
        if not _single_folder_writeable(outdir):
            _LOGGER.error("Insufficient permissions to write to {}: {}".
                          format(target, outdir))
            return

        for a in asset_list:
            rgc.pull(a["genome"], a["asset"], a["tag"],
                     unpack=not args.no_untar, force=force)

    elif args.command in [LIST_LOCAL_CMD, LIST_REMOTE_CMD]:
        rgc = RefGenConf(filepath=gencfg, writable=False)
        if args.command == LIST_REMOTE_CMD:
            num_servers = 0
github databio / refgenie / refgenie / exceptions.py View on Github external
def __init__(self, folder):
        """
        Create the error message.

        :param str folder: path attempted to be used as folder to save a file to
        """
        super(MissingFolderError, self).__init__(folder)
github databio / refgenie / refgenie / refgenie.py View on Github external
def _writeable(outdir, strict_exists=False):
    outdir = outdir or "."
    if os.path.exists(outdir):
        return _single_folder_writeable(outdir)
    elif strict_exists:
        raise MissingFolderError(outdir)
    return _writeable(os.path.dirname(outdir), strict_exists)

refgenie

Refgenie creates a standardized folder structure for reference genome files and indexes. You can download pre-built genomes or build your own for any fasta file

BSD-2-Clause
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis

Similar packages