, groupby, *, target_col='clone_id', summarize_by='cell', normalize=False, **kwargs)

Summarizes clonal expansion by a grouping variable.

Removes all entries with NaN in target_col prior to summarization.

adata : AnnData

annotated data matrix

groupby : str

summarize by this column in adata.obs.

target_col : str (default: 'clone_id')

column in obs which holds the clonotype information

summarize_by : {‘cell’, ‘clone_id’}Literal[‘cell’, ‘clone_id’] (default: 'cell')

Can be either cell to count cells belonging to a clonotype (the default), or “clone_id” to count clonotypes. The former leads to a over-representation of expanded clonotypes but better represents the fraction of expanded cells.

normalize : bool (default: False)

If False, plot absolute cell counts. If True, scale each group to 1.


Additional arguments passed to clonal_expansion().

Return type



A DataFrame with one row for each unique value in groupby.