tacco.utils.get_average_profiles

get_average_profiles(type_key, reference, rX=None, pca_offset=None, pca_trafo=None, normalize=True, cell_weights=False, buffer=True)[source]

Get average profiles for a certain annotation from a reference Anndata. If these profiles are not available as a varm entry already, they are created.

Parameters:
  • type_key – The annotation key for which average profiles should be returned. This can be a .obs or .varm key. Can also be a Series contining a categorical annotation which is not available in .obs.

  • reference – The Anndata from which the average profiles should be retrieved.

  • rX – An expression matrix to use instead of the one provided in .X.

  • pca_offset – An offset to subtract from the mean_profiles; mostly interesting for working in pca space

  • pca_trafo – A linear transformation to apply to the mean profiles; mostly interesting for working in pca space

  • normalize – Whether to normalize profiles to sum to 1 over genes for every profile

  • cell_weights – Whether to weight every cell equally instead of every read

  • buffer – Whether to save the average profiles in .varm

Returns:

The mean profiles in a DataFrame.