def add_region_to_query(args):
    region_regex = re.compile("(\S+):(\d+)-(\d+)")


    try:
        region = region_regex.findall(args.region)[0]
    except __HOLE__:
        sys.exit("Malformed region (--reg) string")

    if len(region) != 3:
        sys.exit("Malformed region (--reg) string")

    chrom = region[0]
    start = region[1]
    end = region[2]

    where_clause = " chrom = " + "'" + chrom + "'" + \
        " AND ((start BETWEEN " + start + " AND " + end + ")" +\
        " OR (end BETWEEN " + start + " AND " + end + "))"

    args.query = _add_to_where_clause(args.query, where_clause)
dataset/ETHPy150Open arq5x/gemini/gemini/gemini_region.py/add_region_to_query