genomepy.utils

Utility functions

Functions

check_ucsc_tools([tools])

Check if UCSC tools for gene annotation conversion are installed.

cleanpath(path)

Expand any path input to a literal path output

cmd_ok(cmd)

Returns True if cmd can be run.

get_genomename(name)

return the name of the genome without path or extensions

get_genomes_dir([genomes_dir, check_exist])

import genomes_dir if none is given, and check validity

get_localname(name[, localname])

Returns the safe version of the given localname.

get_remotename(name)

try to get the name from the url

mkdir_p(path)

'mkdir -p' in Python

rm_rf(path)

'rm -rf' in Python

run_index_cmd(name, cmd)

Run command, show errors if the returncode is non-zero.

safe(name)

Replace spaces with underscores.

try_except_pass(errors, func, *args, **kwargs)

try to return FUNC with ARGS, pass on ERRORS