tacco.preprocessing.apply_random_platform_effect

apply_random_platform_effect(adata, platform_log10_mean=0, platform_log10_std=0.6, seed=42, round=True, counts_location=None, gene_keys=None)[source]

Applies a random log-laplace distributed rescaling per gene inplace.

Parameters:
  • adata – An AnnData containing the expression and/or profiles to rescale inplace.

  • platform_log10_mean – log10 mean of the Laplace distribution

  • platform_log10_std – log10 of the standard deviation of the Laplace distribution

  • seed – The random seed to use

  • round – Whether to round the resulting expression matrix to integer counts after rescaling

  • counts_location – A string or tuple specifying where the count matrix is stored, e.g. ‘X’, (‘raw’,’X’), (‘raw’,’obsm’,’my_counts_key’), (‘layer’,’my_counts_key’), … For details see counts().

  • gene_keys – String or list of strings specifying additional count-like .var and .varm annotations to scale along with the platform effect. If True, take all .var and .varm keys.

Returns:

Returns a Series with the random recaling factors.