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 (
Union
[AnnData
,MuData
,DataHandler
]) – AnnData or MuData object that contains AIRR information.groupby (
str
) – summarize by this column inadata.obs
.target_col (
str
(default:'clone_id'
)) – column in obs which holds the clonotype informationsummarize_by (
Literal
['cell'
,'clone_id'
] (default:'cell'
)) – Can be eithercell
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
)) – IfFalse
, 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 theMuData
object. if anAnnData
object is passed to the function, this parameter is ignored.**kwargs – Additional arguments passed to
clonal_expansion()
.
- Return type:
- Returns:
A DataFrame with one row for each unique value in
groupby
.