dynamo.pl.variance_explained

dynamo.pl.variance_explained(adata, threshold=0.002, n_pcs=None, figsize=4, 3, save_show_or_return='show', save_kwargs={})[source]

Plot the accumulative variance explained by the principal components.

Parameters
  • adata (AnnData) –

  • threshold (float (default: 0.002)) – The threshold for the second derivative of the cumulative sum of the variance for each principal component. This threshold is used to determine the number of principal component used for downstream non-linear dimension reduction.

  • n_pcs (int (default: None)) – Number of principal components.

  • figsize (string (default: (4, 3))) – Figure size of each facet.

  • save_show_or_return ({‘show’, ‘save’, ‘return’} (default: show)) – Whether to save, show or return the figure.

  • save_kwargs (dict (default: {})) – A dictionary that will passed to the save_fig function. By default it is an empty dictionary and the save_fig function will use the {“path”: None, “prefix”: ‘variance_explained’, “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.

Returns

Return type

Nothing but make a matplotlib based plot for showing the cumulative variance explained by each PC.