tracts.driver_utils.plot_admixture#

plot_admixture(ancestry_per_individual, labels, colors, ax=None, title=None, title_fontsize=14, label_fontsize=10, tick_fontsize=6, legend_fontsize=10)#

Stacked bar chart of ancestry proportions in ADMIXTURE style. AI-generated with review.

Parameters:
  • ancestry_per_individual (dict[str, list[float]]) – {individual: [prop_1, …, prop_n]}, where each individual is either an Indiv-like object (with a .name attribute) or a plain string (e.g. when re-plotting from a saved ancestry_per_individual output file, see tracts.plot).

  • labels (list[str]) – Population name for each proportion column.

  • colors (list[str]) – Hex colour for each population.

  • ax (matplotlib.axes.Axes, optional) – Axes to draw on; a new figure is created if None.

  • title (str | None) – An optional title for the plot. Defaults to None (no title).

  • title_fontsize (float) – The font size of the title, if given. Defaults to 14.

  • label_fontsize (float) – The font size of the y-axis label. Defaults to 10.

  • tick_fontsize (float) – The font size of the per-individual x-axis tick labels. Defaults to 6.

  • legend_fontsize (float) – The font size of the legend. Defaults to 10.

Return type:

fig, ax