LeadEdgeSampleHeatmap make a heatmap of average expression for top or leading edge genes returned by LeadEdgeTidySampleExprs
Source:R/enrichment_analysis.r
LeadEdgeSampleHeatmap.Rd
LeadEdgeSampleHeatmap make a heatmap of average expression for top or leading edge genes returned by LeadEdgeTidySampleExprs
Usage
LeadEdgeSampleHeatmap(
tidy.exprs.list,
modulename,
celltype_plot,
metadata,
metadata_annotate,
sample_column,
returnmat = FALSE,
plotwidth = 5,
plotheight = 8,
savepath,
savename
)
Arguments
- tidy.exprs.list
the object returned by returned by TidySampleData or LeadEdgeTidySampleExprs which is created from metadata and the object returned by PseudobulkList (average expression prefered for visualization; else recommend e.g. first lapply(x, edgeR::cpm) to standardize the bulk data.
- modulename
The name of the module to plot
- celltype_plot
the name of the celltype to plot
- metadata
cells x metadata dataframe
- metadata_annotate
a vector of variables (columns) of sample level metadata to annotate on the heatmap. Must be categorical for each sample e.g. "age" but not "nUMI"
- sample_column
the column in the metadata object corresponding to the sample labels, usually 'smaple'
- returnmat
instead of making an annotated heatmap just return the matrix of averge values per sample of the module subset
Examples
if (FALSE) {
scglmmr::LeadEdgeSampleHeatmap(tidy.exprs.list = le_expr,
modulename = "MODULENAME",
celltype_plot = "TCELL",
metadata = meta,
metadata_annotate = c('group', 'timepoint', 'age', 'gender'),
sample_column = 'sample',
returnmat = F,
savepath = figpath,
savename = "filename")
}