<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def GetTransPosition(df,field,dic,refCol="transcript_id"):
 """ Maps a genome position to transcript positon" :param df: a Pandas dataframe :param field: the head of the column containing the genomic position :param dic: a dictionary containing for each transcript the respective bases eg. {ENST23923910:'234,235,236,1021,..'} :param refCol: header of the reference column with IDs, eg. 'transcript_id' :returns: position on transcript """

    try:
        gen=str(int(df[field]))
        transid=df[refCol]
        bases=dic.get(transid).split(",")
        bases=bases.index(str(gen))+1
    except:
        bases=np.nan
    return bases