dmp_heatmap

pylluminator.visualizations.dmp_heatmap(dm: DM, contrast: str | None = None, nb_probes: int = 100, figsize: tuple[float, float] | None = None, var: str | None | list[str] = None, custom_sheet: DataFrame | None = None, drop_na=True, save_path: None | str = None, sort_by='effect_size', ascending=False, pval_threshold: float | None = 0.05, effect_size_threshold: float | None = None, row_factors: str | list[str] | None = None, row_legends: str | list[str] | None = '', xticklabels=True) None

Plot a heatmap of the probes that are the most differentially methylated, showing hierarchical clustering of the probes with dendrograms on the sides.

Parameters:
  • contrast (str | None) – name of the contrast to use to sort beta values. Must be one of the contrasts of the DM object. If None is given, will use the F-statistics p-value. Default: None

  • nb_probes (int) – number of probes to plot. Default: 100

  • figsize (tuple) – size of the plot. Default: None (automatic)

  • var (str | list[str] | None) – name of the variable to use for the columns of the heatmap. If None, will use the sample names. Default: None

  • custom_sheet (pandas.DataFrame | None) – a sample sheet to use. By default, use the samples’ sheet. Useful if you want to filter the samples to display. Default: None

  • drop_na (bool) – set to True to drop probes with any NA beta values. Note that if set to False, the rendered plot won’t show the hierarchical clusters. Default: True

  • save_path (str | None) – if set, save the graph to save_path. Default: None

  • sort_by (str) – column to order dmps by. Can be pvalue, effect_size, or any dmp column name. Default: effect_size

  • ascending (bool) – sorting order. Default: False

  • pval_threshold (float | None) – maximum DMPs p-value, float between 0 and 1. If None, no filter is applied on pvalues. Default: 0.05

  • effect_size_threshold (float | None) – minimum DMPs effect size, float between 0 and 1. If None, no filter is applied on effect size. Default: None

  • row_factors (str | list[str] | None) – list of columns to show as color categories on the side of the heatmap. Must correspond to columns of the sample sheet. Default: None

  • row_legends (str | list[str] | None) – list of columns to generate a legend for. Set to None for no legends. Only work for columns also specified in row_factors. Default: ‘’ (generate all legends)

Returns:

None