pylipid.plot.plot_residue_data_logo¶
- pylipid.plot.plot_residue_data_logo(residue_index, logos, interactions, gap=1000, letter_map=None, color_scheme='chemistry', ylabel=None, title=None, fn=None, fig_close=False)[source]¶
Plot interactions using logomaker.Logo.
- Parameters
residue_index (list) – Residue indices in an ascending order. If a residue index is smaller than its preceding one, the plotting function will consider it as the start of a new chain and will plot the following data in a new figure. A gap in residue index that is less than
gap
will be marked as gray areas in the figure, but a gap that is larger thangap
will start a new figure.logos (list of str) – Single letter logos in the corresponding order as
residue_index
. The height of logos in the figure will be determined by values given tointeractions
. Three-letter name of the 20 common amino acids are accepted and will be converted to their corresponding single-letter names in this function by the default. Other mappings can be defined vialetter_map
.interactions (list) – Plotting values in the corresponding order as
residue_index
.gap (int, optional, default=1000) – The number of missing residues in
residue_index
that starts a new figure. A gap between two adjacent index inresidue_index
that is smaller than the provided value will be considered as missing residues and will be marked as gray areas in the figure, whereas a gap that is larger than the provided value will start a new figure and plot the following data in that new figure. This can help to make figures more compressed. The gap needs to be greater than 1000. The default is 1000.letter_map (dict, optional, default=None) – A dictionary that maps provided names to single-letter logos in the form of {“provided name”: “single_letter logo”}.
color_scheme (str, optional, default="chemistry") – The color scheme used by logomaker.Logo(). See Color Schemes for accepted values. Default is “chemistry”.
ylabel (str, optional, default=None) – y axis label. Default is “Interactions”.
fn (str, optional, default=None) – Figure name. By default the figure is saved as “Figure_interactions_logo.pdf” as the current working directory.
fig_close (bool, optional, default=False) – Use plt.close() to close the figure. Can be used to save memory if many figures are opened.