---
title: "4.4 - Regulatory TF plots"
output: 
  html_document:
    self_contained: true
    number_sections: no
    theme: flatly
    highlight: tango
    mathjax: null
    toc: true
    toc_float: true
    toc_depth: 2
    css: style.css
  
bibliography: bibliography.bib    
vignette: >
  %\VignetteIndexEntry{"4.4 - Regulatory TF plots"}
  %\VignetteEngine{knitr::rmarkdown}
  \usepackage[utf8]{inputenc}
---

```{r, echo = FALSE,hide=TRUE, message=FALSE, warning=FALSE}
library(ELMER.data)
library(ELMER)
library(DT)
library(dplyr)
library(BiocStyle)
```
<br>

# TF ranking plot

For a given enriched motif, all human TF are ranked by the statistical $-log_{10}(P-value)$ assessing the anti-correlation level of candidate Master Regulator TF expression with average DNA methylation level for sites with the given motif. As a result, the most anti-correlated TFs will be ranked in the first positions. By default, the top 3 most anti-correlated TFs and all TF classified by TFClass database in the same (sub)family  are highlighted with colors blue, red and orange, respectively.


## TF ranking plot: family classification

Shown are TF ranking plots based on the score ($-log_{10}(P value))$ of association between TF expression and DNA methylation of an enriched motif in the LUSC cancer type. The dashed line indicates the boundary of the top 5% association score. The top 3 associated TFs and the TF family members=(dots in red) that are associated with that specific motif are labeled in the plot

```{r,eval=TRUE,fig.cap=" TF ranking plot: For a given enriched motif, all human TF are ranked by the statistical $-log_{10}(P-value)$ assessing the anti-correlation level of candidate Master Regulator TF expression with average DNA methylation level for sites with the given motif. As a result, the most anti-correlated TFs will be ranked in the first positions. By default, the top 3 most anti-correlated TFs, and all TF classified by TFClass database in the same family and subfamily are highlighted with colors blue, red and orange, respectively."}
load("result/getTF.hypo.TFs.with.motif.pvalue.rda")
motif <- colnames(TF.meth.cor)[1]
TF.rank.plot(
  motif.pvalue = TF.meth.cor, 
  motif = motif,
  save = FALSE
) 
```