omicverse.pp.pca

omicverse.pp.pca(adata, n_pcs=50, layer='scaled', inplace=True, **kwargs)[source]

Performs Principal Component Analysis (PCA) on the data stored in a scanpy AnnData object.

Parameters:
  • adata – Annotated data matrix with rows representing cells

  • features. (and columns representing)

  • n_pcs (default: 50) – Number of principal components to calculate.

  • layer (Defaults to the 'scaled') – The name of the layer in adata where the data to be analyzed is stored.

  • layer – and falls back to ‘lognorm’ if that layer does not exist.

:param : and falls back to ‘lognorm’ if that layer does not exist. :param Raises a KeyError if the specified layer is not present.:

Returns:

The original AnnData object with the calculated PCA embeddings and other information stored in its obsm, varm,

and uns fields.

Return type:

adata