normSca: Normalise and scale counts matrix

View source: R/normSca.R

normScaR Documentation

Normalise and scale counts matrix

Description

This function is called by the preprocess function and performs log-normalisation and scaling of a counts matrix.

Usage

normSca(x, lib.size = lib.size, log = TRUE, prior.count = 0.5)

Arguments

x

a matrix of counts

lib.size

the library size

log

logical, indicates whether the output should be on the log2 scale or counts scale. Default is TRUE.

prior.count

The prior count to add if the data is log2 normalised. Default is a small count of 0.5.

Value

a dataframe of log-normalised and scaled counts

Examples


y <- matrix(rnbinom(1000, size=2, mu= 20),ncol=10)
colnames(y)<- paste("Cell",1:10, sep="")
row.names(y)<-paste("Gene",1:100,sep="")
norm.data <- normSca(y,lib.size=colSums(y))

#Visualise the counts vs scaled data
boxplot(y)
boxplot(norm.data)


Oshlack/speckle documentation built on Oct. 16, 2022, 9:39 a.m.