perturbation package#
Submodules#
perturbation.perturbation module#
- perturbation.perturbation.plot_UMAP(real: ndarray, fake: ndarray, real_labels: list[str] | ndarray | None = None, fit: bool = False, fake_title: str = 'Fake', case_ctr: str = 'ctr', save_path: str | None = None) None [source]#
Plot UMAP projections and density plots for real and generated (fake) cell data.
- Parameters:
real (np.ndarray) – Real cell expression data (cells x genes).
fake (np.ndarray) – Fake/generated cell expression data (cells x genes).
real_labels (Optional[Union[list[str], np.ndarray]], optional) – List or array of cell type labels for real cells (used for color-coded scatter plots), by default None
fit (bool, optional) – Whether to fit a new UMAP model on the concatenated data (True), or transform using an existing fitted UMAP model (False), by default False
fake_title (str, optional) – Title used for fake cells in the plots (e.g., “Generated”, “Simulated”), by default “Fake”
case_ctr (str, optional) – Identifier used in the saved filenames (before of after pert), by default “ctr”
save_path (Optional[str], optional) – If provided, saves the scatter and density plots as PNGs, by default None