dynamo.pp.calc_Gini

dynamo.pp.calc_Gini(adata, layers='all')[source]

Calculate the Gini coefficient of a numpy array. https://github.com/thomasmaxwellnorman/perturbseq_demo/blob/master/perturbseq/util.py

Parameters:
  • adata (AnnData) – an AnnData object

  • layers (Union[Literal['all'], List[str]]) – the layer(s) to be normalized. Defaults to “all”.

Return type:

AnnData

Returns:

An updated anndata object with gini score for the layers (include .X) in the corresponding var columns (layer + ‘_gini’).