def get_tstv_noncoding(conn, metadata, args):
    ts_cmd = "SELECT count(1) \
           FROM variants v \
           WHERE v.type = \'snp\' \
           AND v.sub_type = \'ts\' \
           AND v.is_coding = 0"
    tv_cmd = "SELECT count(1) \
          FROM variants v \
          WHERE v.type = \'snp\' \
          AND v.sub_type = \'tv\' \
          AND v.is_coding = 0"
    # get the number of transitions
    res = conn.execute(ts_cmd)
    ts = res.fetchone()[0]

    # get the number of transversions
    res = conn.execute(tv_cmd)
    tv = res.fetchone()[0]

    # report the transitions, transversions, and the ts/tv ratio
    print "ts" + '\t' + \
          "tv" + '\t' + "ts/tv"
    print str(ts) + '\t' + \
        str(tv) + '\t' + \
        str(tstv(ts, tv))
Report the transition / transversion ratio in non-coding regions.
dataset/ETHPy150Open arq5x/gemini/gemini/gemini_stats.py/get_tstv_noncoding