tracts.population.preprocess_color_dict#
- preprocess_color_dict(colordict, dat)#
Preprocesses the color dictionary to ensure that all ancestry labels present in the data have an entry in the color dictionary. If an ancestry label is missing from the color dictionary, it is added with a default color of ‘black’.
- Parameters:
colordict (
dict[str,str]) – A dictionary mapping ancestry labels to color strings.dat (
tuple[dict[str,float],list[dict[str,float]]]) – A tuple where the first element is a dictionary of ancestry proportions at different positions, and the second element is a list of dictionaries of ancestry proportions at different positions. Each dictionary in the list corresponds to a position and has ancestry labels as keys and their corresponding proportions as values.
- Return type:
None