def read_distance_file(dist_file, threshold):
    """
    Read a previously created distance file and store it as a hash
    :param threshold: The threshold for the distances
    :type threshold: float
    :param dist_file: The file to read
    :type dist_file: str
    :return: A hash of rxn1 rxn2 -> distance
    :rtype: dict
    """
    distances = {}
    with open(dist_file, 'r') as f:
        for l in f:
            p = l.strip().split("\t")
            if float(p[2]) > threshold:
                continue
            if p[0] not in distances:
                distances[p[0]] = {}
            if p[1] not in distances:
                distances[p[1]] = {}
            distances[p[0]][p[1]] = float(p[2])
            distances[p[1]][p[0]] = float(p[2])
    return distances