scirpy.tl.summarize_clonal_expansion
- scirpy.tl.summarize_clonal_expansion(adata, groupby, *, target_col='clone_id', summarize_by='cell', normalize=False, **kwargs)
Summarizes clonal expansion by a grouping variable.
Removes all entries with
NaN
intarget_col
prior to summarization.- Parameters
- 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. IfTrue
, scale each group to 1.- **kwargs
Additional arguments passed to
clonal_expansion()
.
- adata :
- Return type
- Returns
A DataFrame with one row for each unique value in
groupby
.