spac.transformations.phenograph_clustering(adata, features, layer=None, k=50, seed=None, output_annotation='phenograph', associated_table=None, **kwargs)[source]

Calculate automatic phenotypes using phenograph.

The function will add these two attributes to adata: .obs[“phenograph”]

The assigned int64 class by phenograph

.uns[“phenograph_features”]

The features used to calculate the phenograph clusters

Parameters:
  • adata (anndata.AnnData) – The AnnData object.

  • features (list of str) – The variables that would be included in creating the phenograph clusters.

  • layer (str, optional) – The layer to be used in calculating the phengraph clusters.

  • k (int, optional) – The number of nearest neighbor to be used in creating the graph.

  • seed (int, optional) – Random seed for reproducibility.

  • output_annotation (str, optional) – The name of the output layer where the clusters are stored.

  • associated_table (str, optional) – If set, use the corresponding key adata.obsm to calcuate the Phenograph. Takes priority over the layer argument.

Returns:

adata – Updated AnnData object with the phenograph clusters stored in adata.obs[output_annotation]

Return type:

anndata.AnnData