Learn R Programming

bulkAnalyseR (version 1.1.0)

make_heatmap_matrix: Create a matrix of the average expression of each gene in each condition

Description

This function reshapes the tibble output of calculate_condition_mean_sd_per_gene into a matrix of average expression by condition. Its output can be used by expression_heatmap.

Usage

make_heatmap_matrix(tbl, genes = NULL)

Value

A matrix of averaged expression per gene in each condition.

Arguments

tbl

the output of calculate_condition_mean_sd_per_gene

genes

gene names to use for the output; if NULL (the default), all genes will be used

Examples

Run this code
expression.matrix.preproc <- as.matrix(read.csv(
  system.file("extdata", "expression_matrix_preprocessed.csv", package = "bulkAnalyseR"), 
  row.names = 1
))[1:500,]

condition <- factor(rep(c("0h", "12h", "36h"), each = 2))
tbl <- calculate_condition_mean_sd_per_gene(expression.matrix.preproc[1:10, ], condition)
heatmat <- make_heatmap_matrix(tbl)
heatmat

Run the code above in your browser using DataLab