def read_ac(path, cut_off, rnalen):
    """Read the RNA accessibility file and output its positions and values

    The file should be a simple table with two columns:
    The first column is the position and the second one is the value
    '#' will be skipped

    """
    access = []
    with open(path) as f:
        i = 0
        while i < rnalen:
            for line in f:
                line = line.split()
                if not line:
                    continue
                elif line[0][0] == '#':
                    continue
                elif len(line) < 2:
                    continue
                else:
                    v = line[1]
                    if v == 'NA':
                        access.append(0)
                    else:
                        try:
                            v = 2 ** -float(v)
                        except:
                            continue
                        if v >= cut_off:
                            access.append(1)
                        else:
                            access.append(0)
                    i += 1
    return access
