def f2dict(f_p, k_position, v_position):
    """
    convert a file with a key-value to a dict
    """
    dict = {}
    f = open(f_p, 'r')
    h_s = f.readline().rstrip().split('\t')
    for l in f:
        try:
            l_s = l.rstrip().split('\t')
            key, value = l_s[k_position], l_s[v_position]
            dict[key] = value
        except:
            continue
    f.close()
    return dict
