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 matrixgroupby (
str
(default:'cnv_leiden'
)) – Key under which the clustering is stored in adata.obs. Usually the result ofinfercnvpy.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 ofinfercnvpy.tl.infercnv()
is stored in adata.key_added (
str
(default:'cnv_score'
)) – Key under which the score will be stored inadata.obs
.inplace (
bool
(default:True
)) – If True, store the result in adata, otherwise return it.obs_key (default:
None
) – Deprecated alias forgroupby
.
- Return type:
- Returns:
Depending on the value of
inplace
, either returnsNone
or dictionary with the score per group.