pylipid.api.LipidInteraction.plot

LipidInteraction.plot(item, save_dir=None, gap=200, fig_close=False, fig_format='pdf')[source]

Assisting function for plotting interaction data.

This assiting function can make a couple of plots:
  • Residence Time: plot residue residence times as a function of residue index.

  • Duration: plot residue lipid durations as a function of residue index.

  • Occupancy: plot residue lipid occupancies as a function of residue index.

  • Lipid Count: plot residue lipid count as a function of residue index.

  • CorrCoef: plot the Pearson correlation matrix of the lipid interactions for residues.

By default, the figures are saved in the directory of Figure_{lipid} under the root directory defined when the class LipidInteraction was initiated. It can be changed by providing to path to save_dir.

The figures are named as {item}.{fig_format}. The formats supported by matplotlib.savefig() are allowed.

For proteins with large gaps in their residue index, this method provides the parameter gap to plot data in multiple figures when the gap of residue index for two adjacent residues is larger than the specified value.

For multichain proteins, this method will plot data in separate figure for each chain.

Parameters
  • item ({"Residence Time", "Duration", "Occupancy", "Lipid Count", "CorrCoef"}) – The interaction data to be plotted.

  • save_dir (str, default=None) – The directory for saving the figures. By default, figures are saved in the directory of Figures_{lipid} under the root directory defined at the initialization of LipidInteraction.

  • gap (int, default=200) – The gap in residue index to initiate a new figure.

  • fig_close (bool, default=False) – This parameter control whether to close the plotted figures using plt.close(). It can save memory if many figures are generated.

  • fig_format (str, default="pdf") – Figure format. Support formats included in matplotlib.pyplot.

See also

pylipid.plot.plot_residue_data

Plot interactions as a function of residue index