patpy.pp.calculate_n_cells_per_sample

patpy.pp.calculate_n_cells_per_sample#

patpy.pp.calculate_n_cells_per_sample(adata, sample_key)#

Calculate the number of cells per sample in the given AnnData object.

Parameters:
  • adata (AnnData) – Annotated data object.

  • sample_key (str) – Key for the sample information in adata.obs

Return type:

DataFrame

Returns:

-cell_counts (DataFrame) DataFrame containing the number of cells per sample in the columns “n_cells”