dandelion.polars.plotting.spectratype

dandelion.polars.plotting.spectratype(vdj, color, group_by, locus, figsize=(5, 3), width=None, title=None, xtick_fontsize=None, xtick_rotation=None, hide_legend=False, legend_options=('upper left', (1, 1), 1), labels=None, **kwargs)[source]

A spectratype function to plot usage of CDR3 length.

Parameters:
  • vdj (Dandelion) – Dandelion object.

  • color (str) – column name in metadata for plotting in bar plot.

  • group_by (str) – column name in metadata to split by during plotting.

  • locus (str) – either IGH or IGL.

  • figsize (tuple[float, float], optional) – figure size.

  • width (int | float | None, optional) – width of bars.

  • title (str | None, optional) – title of plot.

  • xtick_fontsize (int | None, optional) – size of x tick labels

  • xtick_rotation (int | float | None, optional) – rotation of x tick labels.

  • hide_legend (bool, optional) – whether or not to hide the legend.

  • legend_options (tuple[str, tuple[float, float], int], optional) – a tuple holding 3 options for specify legend options: 1) loc (string), 2) bbox_to_anchor (tuple), 3) ncol (int).

  • labels (list[str] | None, optional) – Names of objects will be used for the legend if list of multiple data frames supplied.

  • **kwargs – other kwargs passed to matplotlib.pyplot.plot

Returns:

spectratype plot.

Return type:

tuple[Figure, Axes]