Normalize expression matrix by accounting for library size. Uses sctransform.

sct_normalize(exp, as_sparse = TRUE, verbose = TRUE)

Arguments

exp

Gene x cell expression matrix.

as_sparse

Convert exp to sparse matrix.

verbose

Print messages.

Value

Normalised expression matrix.

Examples

cortex_mrna <- ewceData::cortex_mrna()
#> see ?ewceData and browseVignettes('ewceData') for documentation
#> loading from cache
exp_sct_normed <- EWCE::sct_normalize(exp = cortex_mrna$exp[1:300, ])
#> Loading required namespace: sctransform
#> Converting to sparse matrix.
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 300 by 3005
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 300 genes, 3005 cells
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |======================================================================| 100%
#> Found 2 outliers - those will be ignored in fitting/regularization step
#> Second step: Get residuals using fitted parameters for 300 genes
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |======================================================================| 100%
#> Calculating gene attributes
#> Wall clock passed: Time difference of 3.82128 secs
#> Computing corrected UMI count matrix
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |======================================================================| 100%