def get_probe_hit(tree, gene_info, r, is_gtf=False):
    """
    Given a dict tree (from read_probe_bed) and a GMAP SAM record
    Go through each exon and find probes that hit it

    Return: (number of probes hit), (total number of bases overlapping with probes), (genes seen)
    """
    probes_seen = set()
    genes_seen = set()
    base_hit = 0
    if is_gtf: r.sID, r.segments = r.chr, r.ref_exons
    if r.sID not in tree: return 0, 0, set()
    for e in r.segments:
        hits = tree[r.sID].find(e.start, e.end)
        if len(hits) == 0: continue
        for i,strand,intl in hits:
            if (strand is None) or (strand==r.strand):
                probes_seen.add(i)
                genes_seen.add(gene_info[i])
                base_hit += min(e.end,intl.end)-max(e.start,intl.start)
    return len(probes_seen), base_hit, genes_seen