normCounts | R Documentation |

This function takes a `DGEList`

object or matrix of counts and
normalises the counts to the median library size. This puts the normalised
counts on a similar scale to the original counts.

normCounts(x, log = FALSE, prior.count = 0.5, lib.size = NULL)

`x` |
a |

`log` |
logical, indicates whether the output should be on the log2 scale or counts scale. Default is FALSE. |

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

`lib.size` |
a vector of library sizes to be used during the normalisation step. Default is NULL and will be computed from the counts matrix. |

If the input is a DGEList object, the normalisation factors in
`norm.factors`

are taken into account in the normalisation. The prior
counts are added proportionally to the library size

a matrix of normalised counts

Belinda Phipson

# Simulate some data from a negative binomial distribution with mean equal # to 100 and dispersion set to 1. Simulate 1000 genes and 6 samples. y <- matrix(rnbinom(6000, mu = 100, size = 1), ncol = 6) # Normalise the counts norm.y <- normCounts(y) # Return log2 normalised counts lnorm.y <- normCounts(y, log=TRUE) # Return log2 normalised counts with prior.count = 2 lnorm.y2 <- normCounts(y, log=TRUE, prior.count=2) par(mfrow=c(1,2)) boxplot(norm.y, main="Normalised counts") boxplot(lnorm.y, main="Log2-normalised counts")

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.