def read_ref(ref_file):
    """Reads the reference file and converts it to a dictionary.

    Args:
        ref_file: This is the path to the file that contains the reference data.
    Returns:
        ref_dic: This is an dictionary where the key is the UID and the value the taxonomy.

    """
    try:
        ref_dic = {}
        with open(ref_file, 'r') as file:
            for line in file:
                # Results from split(): index 0 is the first value that we take (UID), the 3 is the last indice,
                # and the 2 is the steps of what location we pick, so when use this we get the 0 and 2 indices that
                # stand for the UID and taxonomy.
                accession_code, taxonomic_name = line.replace('\n', '').split(',')[0:3:2]
                ref_dic[accession_code] = taxonomic_name
        return ref_dic
    except FileNotFoundError:
        raise FileNotFoundError