eugene.plot.seq_track

eugene.plot.seq_track(sdata, seq_id, attrs_var, id_var='id', vocab='DNA', highlights=[], highlight_colors=['lavenderblush', 'lightcyan', 'honeydew'], title='', ylab='Saliency', xlab='Position', return_ax=False, save=None, **kwargs)

Plot a track of the importance scores for a sequence using the logomaker package

This function is a wrapper around the logomaker Logo function. See the logomaker documentation for more details on the kwargs that can be passed to this function.

Currently does no allow for features to be plotted (users must do them themselves on returned axes) or for sequence only plotting (i.e. importance scores must be passed in through the uns key)

Parameters:
  • sdata (SeqData) – The SeqData object to plot the logo for

  • seq_id (str) – The ID of the sequence to plot

  • attrs_var (str) – The var in the xarray dataset to use to get the importance scores

  • id_var (str) – The var in the xarray dataset to use to get the sequence ids

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

  • highlights (list) – A list of positions to highlight in the sequence

  • highlight_colors (list) – A list of colors to use for the highlights

  • title (str) – The title to use for the plot

  • ylab (str) – The y-axis label to use for the plot

  • xlab (str) – The x-axis label to use for the plot

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

Returns:

ax – The matplotlib axes object

Return type:

matplotlib.axes._subplots.AxesSubplot