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

draw_TimeHeatmap_GO(
  master.list,
  logFC.thres = 0,
  top.n = 10,
  dyn.gene.p.thres = 0.05,
  keyType = "SYMBOL",
  OrgDb = "org.Mm.eg.db",
  ont = "BP",
  term.width = 80,
  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 gene's 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 (based on the change of first time interval). 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 adjusted dynamic p-value threshold. By default is 0.05.

keyType,

must be either ENSEMBL or SYMBOL. The row names of your master.list$master.table.

OrgDb,

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

ont,

one of "BP", "MF", and "CC" sub ontologies, or "ALL" for all three. By default is "BP".

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 is 80.

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_GO(master.list = master.list)
print(th.obj$time.heatmap)
head(th.obj$merge.df)
}