INNER CODE UNIT · Python

get_2bit_path

hillerlab/TOGA · CESAR_wrapper.py:353

def get_2bit_path(db_arg):
    """Check if alias and return a path to 2bit file."""
    if os.path.isfile(db_arg):  # not an alias
        return db_arg  # there is nothing to do
    elif os.path.islink(db_arg):
        return os.readlink(db_arg)
    aliased = two_bit_templ.format(db_arg)
    # check that it's a file
    die(f"Error! Cannot find {aliased} file", 1) if not os.path.isfile(
        aliased
    ) else None
    return aliased


def find_chain_file(ref_name, chain_arg):
    """Return chain file path."""
    if os.path.isfile(chain_arg):
        # not an alias -> just return it

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…