dynamo.pp.top_pca_genes

dynamo.pp.top_pca_genes(adata, pc_key='PCs', n_top_genes=100, pc_components=None, adata_store_key='top_pca_genes')[source]

Define top genes as any gene that is n_top_genes in some principle component.

Parameters:
  • adata (AnnData) – an AnnData object.

  • pc_key (str) – component key stored in adata.uns. Defaults to “PCs”.

  • n_top_genes (int) – number of top genes as valid top genes in each component. Defaults to 100.

  • pc_components (Optional[int]) – number of top principle components to use. Defaults to None.

  • adata_store_key (str) – the key for storing pca genes. Defaults to “top_pca_genes”.

Raises:

Exception – invalid pc_key.

Return type:

AnnData

Returns:

The AnnData object with top genes stored as values of adata.var[adata_store_key].