plot_dmp_heatmap
- pylluminator.visualizations.plot_dmp_heatmap(dmps: DataFrame, samples: Samples, contrast: str | None = None, nb_probes: int = 100, figsize: tuple[float, float] = (10, 10), var: str | None | list[str] = None, custom_sheet: DataFrame | None = None, drop_na=True, save_path: None | str = None, sort_by='pvalue', pval_threshold: float | None = None, delta_beta_threshold: float | None = None, row_factors: str | list[str] | None = None, row_legends: str | list[str] | None = '') 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:
dmps (pandas.DataFrame) – p-values and statistics for each probe, as returned by get_dmp()
samples (Samples) – samples to use for plotting
contrast (str | None) – name of the contrast to use to sort beta values. Must be one of the output contrasts from get_dmp(). 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: (10, 10)
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, delta_beta, or any dmp column name. Default: pvalue
pval_threshold (float | None) – maximum DMP p-value. If None, no filter is applied on pvalues. Default: None
delta_beta_threshold (float | None) – minimum average delta beta value between 2 groups. If None, no filter is applied on delta beta. 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