def _gpos_to_tpos(transcript, start, end=None):
    """Compute the equivalent transcript position for a gene position.
    
    Args:
        transcript: `pyensembl.Transcript` instance
        start (int): genomic coordinate
        end (int): optional, second genomic coordinate

    Returns:
        tuple of int: position relative to the transcript
    """
    convert = lambda x: transcript.spliced_offset(x) + 1
    tstart = convert(start)
    if end:
        tend = convert(end)
    else:
        tend = tstart
    return tstart, tend
