calc_scaling_vector: Calculate scaling factor for a dataset

View source: R/simulator.R

calc_scaling_vectorR Documentation

Calculate scaling factor for a dataset

Description

Each scaling factor has a default matrix it will try to use (counts or TPM). If the required matrix is not available, the other one is used and a warning is given.

Usage

calc_scaling_vector(
  data,
  scaling_factor,
  custom_scaling_vector,
  scaling_factor_single_cell,
  BPPARAM,
  run_parallel
)

Arguments

data

dataset object

scaling_factor

name of scaling factor; possible are: census, spike_in, read_number, custom or NONE for no scaling factor

custom_scaling_vector

named vector with custom scaling values for cell-types. Cell-types that do not occur in this vector but are present in the dataset will be set to 1

scaling_factor_single_cell

boolean: decide if a scaling value for each single cell is calculated (default) or the median of all scaling values for each cell type is calculated

BPPARAM

BiocParallel::bpparam() by default; if specific number of threads x want to be used, insert: BiocParallel::MulticoreParam(workers = x)

run_parallel

boolean, decide if multi-threaded calculation will be run. FALSE by default

Value

a named vector with a scaling value for each cell in the dataset


omnideconv/SimBu documentation built on May 5, 2024, 12:33 p.m.