methylation_distribution
- pylluminator.visualizations.methylation_distribution(samples: Samples, group_column: str, figsize=(5, 3), annotation_column: str = 'cgi', custom_sheet: DataFrame | None = None, delta_beta_threshold: float = 0.2, save_path: None | str = None) None
Plot the distribution of hyper- and hypo- methylated probes in the samples. Compute the average beta values within each group of samples, and calculates the proportion of probes that have a significant methylation difference.
- Parameters:
samples (Samples) – samples with beta values already calculated. NA beta values are dropped (i.e. masks are applied)
group_column (str) – column name of the sample metadata from the sample sheet used to categorize the data, e.g. Phenotype. It only work with metadata that has 2 possibles values (e.g. Control vs Patients)
annotation_column (str) – column name of the probe_infos dataframe to use to annotation probes (cgi, promoter_or_body..). Default: ‘cgi’
delta_beta_threshold (float) – minimum difference of average beta value between the two groups to consider that a probe is hyper- or -hypo methylated. A float between 0 and 1. Default: 0.2
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
save_path (str | None) – if set, save the graph to save_path. Default: None
- Returns:
None