malariagen_data.ag3.Ag3.plot_aim_heatmap#

Ag3.plot_aim_heatmap(aims: str, sample_sets: Sequence[str] | str | None = None, sample_query: str | None = None, sample_query_options: dict | None = None, sort: bool = True, row_height: int = 4, xgap: float = 0, ygap: float = 0.5, palette: Tuple[str, str, str, str] | None = None, show: bool = True, renderer: str | None = None) Figure | None#

Plot a heatmap of ancestry-informative marker (AIM) genotypes.

Parameters#

aimsstr

Identifier for a set of ancestry informative markers to use. For possible values see the aim_ids property.

sample_setssequence of str or str or None, optional

List of sample sets and/or releases. Can also be a single sample set or release.

sample_querystr or None, optional

A pandas query string to be evaluated against the sample metadata, to select samples to be included in the returned data.

sample_query_optionsdict or None, optional

A dictionary of arguments that will be passed through to pandas query() or eval(), e.g. parser, engine, local_dict, global_dict, resolvers.

sortbool, optional, default: True

If true (default), sort the samples by the total fraction of AIM alleles for the second species in the comparison.

row_heightint, optional, default: 4

Height per sample in px.

xgapfloat, optional, default: 0

Creates lines between columns (variants).

ygapfloat, optional, default: 0.5

Creates lines between rows (samples).

palettetuple[str, str, str, str] or None, optional

4-tuple of colors for AIM genotypes, in the order: missing, hom taxon 1, het, hom taxon 2.

showbool, optional, default: True

If true, show the plot. If False, do not show the plot, but return the figure.

rendererstr or None, optional

The name of the renderer to use.

Returns#

Figure or None

A plotly figure (only returned if show=False).