betas_2D

pylluminator.visualizations.betas_2D(samples: Samples, label_column: str | None = None, color_column: str | list[str] | None = None, dims_to_plot: list[int] = [1, 2], nb_probes: int | None = None, title: None | str = None, apply_mask=True, figsize: tuple[float, float] | None = (10, 7), cmap_name: str = 'Spectral_r', na_color: str | None = 'darkgrey', custom_sheet: None | DataFrame = None, save_path: None | str = None, model='PCA', show_labels=True, plot_kwargs: dict | None = None, **kwargs) None

Plot samples in 2D space according to their beta distances.

:param samples : samples to plot :type samples: Samples

Parameters:
  • label_column (str | None) – name of the column containing the labels. Default: None

  • color_column (str | list[str]| None) – name of a Sample Sheet column used to give samples from the same group the same color. Default: None

  • nb_probes (int | None) – number of probes to use for the model, selected from the probes with the most beta variance. If None, use all the probes. Default: None

  • title (str | None) – custom title for the plot. Default: None

  • apply_mask (bool) – True removes masked probes from betas, False keeps them. Default: True

  • figsize (tuple) – size of the plot. Default: (10, 7)

  • 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

  • model (str) – identifier of the model to use. Available models are ‘PCA’: PCA, ‘MDS’: MDS, ‘DL’: DictionaryLearning, ‘FA’: FactorAnalysis, ‘FICA’: FastICA, ‘IPCA’: IncrementalPCA, ‘KPCA’: KernelPCA, ‘LDA’: LatentDirichletAllocation, ‘MBDL’: MiniBatchDictionaryLearning, ‘MBNMF’: MiniBatchNMF, ‘MBSPCA’: MiniBatchSparsePCA, ‘NMF’: NMF, ‘SPCA’: SparsePCA, ‘TSVD’: TruncatedSVD. Default: ‘PCA’

  • cmap_name (str) – name of the matplotlib color map to use. Default: Spectral_r

  • na_color (str) – color for NaN values

  • show_labels (bool) – if True, show the sample names on the plot. Default: True

  • kwargs – parameters passed to the model

Returns:

None