dynamo.pl.loading

dynamo.pl.loading(adata, n_pcs=10, loading_key='PCs', n_top_genes=10, ncol=5, figsize=(6, 4), save_show_or_return='show', save_kwargs={})[source]

Plot the top absolute pca loading genes.

Red text are positive loading genes while black negative loading genes.

Parameters:
  • adata (AnnData) – an AnnData object that has pca and loading information prepared.

  • n_pcs (int) – the number of pca components. Defaults to 10.

  • loading_key (str) – the key to the pca loading matrix. Defaults to “PCs”.

  • n_top_genes (int) – the number of top genes with the highest absolute loading score. Defaults to 10.

  • ncol (int) – the number of columns of the subplots. Defaults to 5.

  • figsize (Tuple[float]) – the size of each panel of the figure. Defaults to (6, 4).

  • save_show_or_return (Literal['save', 'show', 'return']) – whether to save, show, or return the generated figure. Can be one of ‘save’, ‘show’, or ‘return’. Defaults to “show”.

  • save_kwargs (Dict[str, Any]) – a dictionary that will be passed to the save_show_ret function. By default, it is an empty dictionary and the save_show_ret function will use the function will use the {“path”: None, “prefix”: ‘biplot’, “dpi”: None, “ext”: ‘pdf’, “transparent”: True, “close”: True, “verbose”: True} as its parameters. Otherwise, you can provide a dictionary that properly modify those keys according to your needs. Defaults to {}.

Raises:

ValueError – invalid loading_key

Return type:

List[List[Axes]]

Returns:

None would be returned by default. If save_show_or_return is set to be ‘return’, the matplotlib Axes of the figure would be returned.