This funcitons takes the master.list output from run_TrendCatcher. And apply a time window sliding strategy to capture all the genes increased/decreased compared to its previous break point, and apply enrichR enrichment analysis.

draw_TimeHeatmap_enrichR(
  master.list,
  logFC.thres = 0,
  top.n = 10,
  dyn.gene.p.thres = 0.05,
  dbs = "BioPlanet_2019",
  term.width = 80,
  OrgDb = "org.Mm.eg.db",
  GO.enrich.p = 0.05,
  figure.title = "",
  save.tiff.path = NA,
  tiff.res = 100,
  tiff.width = 1500,
  tiff.height = 1500
)

Arguments

master.list,

a list object. The output from run_TrendCatcher function, contains master.table element.

logFC.thres,

a numeric variable. The logFC threshold compared to each genes previous break point expression level. By default is 0, meaning for each gene, the current time window's expression level is 2-fold compared to previous break point's expression level.

top.n,

an integer variable. The top N GO enrichment term need to be shown in the TimeHeatmap for up and down regulated pathway. By default is 10. Top 20 GO terms, 10 from up-regulated pathway and 10 from down-regulated pathway will shown in TimeHeatmap.

dyn.gene.p.thres,

a numeric variable. The DDEGs dynamic p-value threshold. By default is 0.05.

dbs,

must one of the enrichR supported database name. To check the list, run dbs <- listEnrichrDbs() command. By default is "BioPlanet_2019".

term.width,

an integer variable. The character length for each GO term. If one GO term is super long, we can wrap it into term.width of strings into multiple rows. By default if 80.

OrgDb,

must be either "org.Mm.eg.db" or "org.Hs.eg.db". Currently only support mouse and human GO annotation database.

GO.enrich.p,

an numeric variable. The GO enrichment p-value threshold. By default if 0.05.

figure.title,

a character variable. The main title of TimeHeatmap.

save.tiff.path,

a character variable, the file path to save the TIFF figure. If set to NA, it will plot it out. By default is NA.

tiff.res,

a numeric variable, the resolution of the TIFF figure. By default is 100.

tiff.width,

a numeric variable, the width of the TIFF figure. By default is 1500.

tiff.height,

a numeric variable, the height of the TIFF figure. By default is 1500.

Value

A list object, including elements names time.heatmap, merge.df and GO.df. time.heatmap is the ComplexHeatmap object. merge.df includes all the GO enrichment result and their activation/deactivation time window. GO.df includes GO enrichment used for plot TimeHeatmap and all the individual genes within each time window.

Examples

if (FALSE) {
example.file.path<-system.file("extdata", "BrainMasterList.rda", package = "TrendCatcher")
load(example.file.path)
gene.symbol.df<-get_GeneEnsembl2Symbol(ensemble.arr = master.list$master.table$Gene)
th.obj<-draw_TimeHeatmap_enrichR(master.list = master.list)
print(th.obj$time.heatmap)
head(th.obj$merge.df)
}