INNER CODE UNIT · Python
check_dependency
Gabaldonlab/redundans · redundans.py:928
def check_dependency(dependency):
for cmd, version in list(dependency.items()):
try:
out = subprocess.check_output(["which", cmd])
path = out.decode("utf-8").strip()
# If required for locating paths
# if path:
# print(f"{cmd} found at {path}")
# else:
# print(f"{cmd} not found in PATH")
if version:
if cmd == "miniasm":
p = subprocess.Popen(
[cmd, "-V"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
out = "".join(p.stdout.readlines()[0].decode("utf-8"))