itpseq.DataSet.itp_len_plot#
- DataSet.itp_len_plot(ax=None, col=None, row=None, min_codon=0, max_codon=10, limit=100, norm=True, hue='auto', plt_kwargs={'aspect': 3, 'height': 2, 'kind': 'line'})[source]#
Generates a line plot of inverse-toeprint (ITP) counts per length.
This method uses the output of itp_len to create a line plot showing the counts of inverse-toeprints across lengths for each replicate. Optionally, counts can be normalized (per million reads), and the plotted lengths can be limited.
- Parameters:
ax (matplotlib.axes.Axes, optional) – Pre-existing axes to draw the plot on. A new figure and axes are created if not provided.
col (string, optional) – attribute to use as columns in the FacetGrid
row (string, optional) – attribute to use as rows in the FacetGrid
min_codon (int, optional) – The minimum codon position to annotate on the plot. Defaults to 0.
max_codon (int, optional) – The maximum codon position to annotate on the plot. Defaults to 10.
limit (int, optional) – The maximum length to include in the plot. Defaults to 100.
norm (bool, optional) – Whether to normalize counts to reads per million. Defaults to False.
hue (str, optional) – Parameter to use a hue in the FacetGrid (by default ‘replicate’).
plt_kwargs (dict, optional) – parameters used in the FacetGrid if col/row is used.
- Return type:
matplotlib.axes.Axes or seaborn.axisgrid.FacetGrid
Notes
The x-axis represents the distance from the 3’ end of the inverse-toeprint in nucleotides.
The y-axis shows the counts of inverse-toeprints, either absolute or normalized per million reads.
Each replicate is plotted independently and distinguished by the hue attribute in the plot.
Examples
Plot a line with error band for each sample:
>>> dataset.itp_len_plot()
Create a figure with a subplot per sample and a line per replicate:
>>> dataset.itp_len_plot(row='sample')