def get_region(args, gq):
    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]

    if args.columns is not None:
        query = "SELECT " + str(args.columns) + \
                    " FROM variants "
    else:
        query = "SELECT * FROM variants "

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

    if args.filter:
        query += " AND " + args.filter

    query += " ORDER BY chrom, start"

    _report_results(args, query, gq)
dataset/ETHPy150Open arq5x/gemini/gemini/gemini_region.py/get_region