eugene.plot.filter_viz

eugene.plot.filter_viz(sdata, filter_num, pfms_var, vocab='DNA', title=None, return_ax=False, save=None, **kwargs)

Plot the PFM for a single filter in a SeqData object’s uns dictionary as a PWM logo

This function also uses logomaker to generate the PWM and plot it. Check out the logomaker documentation for more information on how to style the plot.

Parameters:
  • sdata (SeqData) – The SeqData object with sequences and pfms to plot a logo for

  • filter_num (str or int) – The filter id to plot

  • pfms_var (str) – The var in the xarray dataset to use to get the pfms

  • vocab (str) – The vocabulary to use for the logo

  • title (str) – The title to use for the plot, defaults to the filter id if None

  • return_ax (bool) – Whether to return the matplotlib axes object

  • save (str) – The path to save the figure to

  • **kwargs (dict) – Additional keyword arguments to pass to the logomaker Logo function

Returns:

ax – The axes object if return_ax is True

Return type:

matplotlib.axes.Axes