spapros.ut.transfered_expression_thresholds

spapros.ut.transfered_expression_thresholds(adata, lower=2, upper=6, tolerance=0.05, target_sum=10000, output_path='./results/', plot=True)

Transfer expression thresholds between different normalisations.

Note

If expression thresholds are known for normalisation with a given target_sum these limits are transfered to the normalisation given in adata.obs[‘size_factors’].

Parameters:
  • adata (AnnData) – AnnData Anndata with raw counts in adata.X and size factors for the normalisation in adata.obs['size_factors'].

  • lower (float) – Lower expression threshold for target_sum normalisation.

  • upper (float) – Upper expression threshold for target_sum normalisation.

  • tolerance (float) – To estimate the thresholds in the target normalisation we sample expression values around the thresholds. Eventually increase this parameter for small datasets.

  • target_sum (float) – float target_sum parameter of the reference normalisation (sc.pp.normalize_total()).

  • output_path (str) – Path where to save the figure.

  • plot (bool) – bool Plot histograms of mapped expressions around reference and target thresholds.

Returns:

Lower and upper expression thresholds in the target normalisation.

Return type:

Tuple[ndarray, ndarray]