infercnvpy.tl.ithgex

Contents

infercnvpy.tl.ithgex#

infercnvpy.tl.ithgex(adata, groupby, *, use_raw=None, layer=None, inplace=True, key_added='ithgex')#

Compute the ITHGEX diversity score based on gene expression cite:Wu2021.

A high score indicates a high diversity of gene expression profiles of cells within a group.

The score is defined as follows:

Intratumoral heterogeneity scores based on CNAs and gene expressions The calculations of intratumoral heterogeneity scores were inspired by a previous study and modified as follows. First, to calculate ITHCNA, we used the relative expression value matrix generated by inferCNV and calculated the pairwise cell–cell distances using Pearson’s correlation coefficients for each patient. ITHCNA was defined as interquartile range (IQR) of the distribution for all malignant cell pairs’ Pearson’s correlation coefficients. Similarly, we also used gene expression profiles of cancer cells of each patient to construct the distribution of the intratumoral distances. ITHGEX was assigned as the IQR of the distribution.

(from [WFH+21])

Parameters:
  • adata (AnnData) – annotated data matrix

  • groupby (str) – calculate diversity for each group defined in this category.

  • use_raw (Optional[bool] (default: None)) – Use gene expression from adata.raw. Defaut: Use .raw if available, .X otherwise.

  • layer (Optional[str] (default: None)) – Use gene expression from adata.layers[layer]

  • inplace (bool (default: True)) – If True, store the result in adata, otherwise return it.

  • key_added (str (default: 'ithgex')) – Key under which the score will be stored in adata.obs.

Return type:

Optional[Mapping[str, float]]

Returns:

Depending of the value of inplace either returns a dictionary with one value per group or None.