scirpy.tl.summarize_clonal_expansion
- scirpy.tl.summarize_clonal_expansion(adata, groupby, *, target_col='clone_id', summarize_by='cell', normalize=False, airr_mod='airr', **kwargs)
Summarizes clonal expansion by a grouping variable.
Removes all entries with
NaN
intarget_col
prior to summarization.- Parameters
- adata :
AnnData
|MuData
|DataHandler
Union
[AnnData
,MuData
,DataHandler
] AnnData or MuData object that contains AIRR information.
- 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.- airr_mod :
str
(default:'airr'
) Name of the modality with AIRR information is stored in the
MuData
object. if anAnnData
object is passed to the function, this parameter is ignored.- **kwargs
Additional arguments passed to
clonal_expansion()
.
- adata :
- Return type
- Returns
A DataFrame with one row for each unique value in
groupby
.