def dna2prot(gx, loc=[]):
    """
    Computes the protein coordinate based on a genomic coordinate and potentially overlapping locations.
    gx: zero based genomic coordinate
    loc: a list of (start, end) pairs
    """
    nt = 0
    ns = ''
    px = []
    for start, end in loc:
        if start <= gx < end:
            nt = nt + (gx - start)
            div, mod = divmod(nt, 3)
            px.append((gx, nt, div, mod))
        else:
            nt += end - start
    return px
