import os


def check_cmd(x):
    return any(
        os.access(os.path.join(path, x), os.X_OK)
        for path in os.environ["PATH"].split(os.pathsep)
    )


def print_head(SAMPLES, MODE):
    print("----------\nSAMPLES:")
    [print("\t" + i) for i in SAMPLES]
    print("----------\nMODE:")
    print("\t" + MODE)
    print("----------\n\n")


def check_read(x):
    if x == "PE":
        read = ["R1", "R2"]
    elif x == "SE":
        read = ["SE"]
    else:
        raise ValueError()
    return read
