infercnvpy.tl.cnv_score

infercnvpy.tl.cnv_score(adata, groupby='cnv_leiden', *, use_rep='cnv', key_added='cnv_score', inplace=True, obs_key=None)

Assign each cnv cluster a CNV score.

Clusters with a high score are likely affected by copy number abberations. Based on this score, cells can be divided into tumor/normal cells.

Ths score is currently simply defined as the mean of the absolute values of the CNV scores in each cluster.

Parameters
adata : AnnData

annotated data matrix

groupby : str (default: 'cnv_leiden')

Key under which the clustering is stored in adata.obs. Usually the result of infercnvpy.tl.leiden(), but could also be other grouping information, e.g. sample or patient information.

use_rep : str (default: 'cnv')

Key under which the result of infercnvpy.tl.infercnv() is stored in adata.

key_added : str (default: 'cnv_score')

Key under which the score will be stored in adata.obs.

inplace : bool (default: True)

If True, store the result in adata, otherwise return it.

obs_key

Deprecated alias for groupby.

Return type

Mapping | NoneOptional[Mapping[Any, number]]

Returns

Depending on the value of inplace, either returns None or dictionary with the score per group.