For a tibble dataset with a cell and value columns, it sums up all values per cell (total library size), and scales the value for 10^x where x is the median nuimber of digits in each total value size.

For instance for numbers of the order of ~1000 it will rescale the library size by a factor 1000, taking all values around ~1.

auto_normalisation_factor(x)

Arguments

x

A tibble with a cell and value columns.

Value

A tibble, aggregated by cell with total values (sum), rescaled by the estimated constant.

Examples

data('example_input')
example_input$x_rna %>% auto_normalisation_factor
#> NULL