Normalize count or other data.

Normalization(
  counts,
  normalization = c("logTPM", "cosine", "none"),
  normalize_factor = 10000,
  zero_percent = 0.7,
  verbose = FALSE
)

Arguments

counts

Data to normalize. An N x M matrix with N rows of features and M columns of data points.

normalization

Normalization method used. Default is cosine.

  • logTPM, logged Transcript Per Million normalization: feature counts for each data point are divided by the total sum of them. Then the data is multiplied by the scale.factor before taking a log-transformed by log(1+x) (Default).

  • cosine, cosine nomalization: feature counts for each data point are divided by their L2.

  • none, additional normalization is not performed.

normalize_factor

Normalization factor used with lognorm method. Default is 10000.

zero_percent

Zero-entry percentage threshold. If the number of zero entries in the returned matrices is above this number, a sparse matrix will be returned. Default is 0.7 aka 70%.

verbose

Whether to display a process bar for cosine normalization. Default is FALSE.

Value

Returns the normalized data.

Examples

if (FALSE) {
normalized.data <- Normalization(data)
}