INNER CODE UNIT · Python
revert
hillerlab/TOGA · CESAR_wrapper.py:346
def revert(line):
"""Revert string and change with complement bases."""
line = line[::-1].upper()
new_str = "".join([COMPLEMENT_BASE.get(c) for c in line if COMPLEMENT_BASE.get(c)])
return new_str
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