View source: R/counts_normalization.R
counts_normalization | R Documentation |
Calulate CPM Normalization for Raw Gene Expression Counts
counts_normalization(
raw_counts,
MARGIN = c("row", "col"),
log2 = TRUE,
plot = TRUE
)
raw_counts |
numeric matrix or data frame of raw gene expression counts. |
MARGIN |
"row" or "col" to identify the place of sample (library size). If the |
log2 |
a logical indicating whether the normalized counts will be transformed in log2. Default is |
plot |
a logical indicating whether a graph will be displayed for the normalization check. Default is |
normalized counts matrix
Mélanie Huchon
#Generate data
sim_Genes <- c(runif(90,0,1), rbinom(60,2,0.4), runif(30,1250,2000), runif(20,100,300))
raw_data <- matrix(sim_Genes, nrow = 10)
colnames(raw_data) <- paste0("G", sample(1:ncol(raw_data), ncol(raw_data), replace = FALSE))
rownames(raw_data) <- paste0("Sample_", 1:nrow(raw_data))
#Use the method
norm_data <- counts_normalization(raw_counts = data.frame(raw_data), MARGIN = "row")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.