def dict_hp(mer_hp_links_file):
    """Creates a dictionary of type {hp_name:hp_id, }

    :param mer_hp_links_file: .tsv file with one hp name and respective hp ID per line
    :return: dict of type {hp_name:hp_id, }
    """

    hp_links_file = open(mer_hp_links_file, 'r', encoding = 'utf-8')
    hp_links = hp_links_file.readlines()
    hp_links_file.close()

    dict_hp_name_id = {}

    for line in hp_links:

        line = line.split('\t')

        hp_name = line[0]
        hp_id = line[-1].split('/obo/')[-1][:-1]

        dict_hp_name_id[hp_name] = hp_id

    return dict_hp_name_id