---
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.2 - Schematic plots"}
  %\VignetteEngine{knitr::rmarkdown}
  \usepackage[utf8]{inputenc}
---

<br>

# Loading required data for plot
```{r,eval=TRUE, message=FALSE, warning = FALSE, results = "hide"}
# Load results from previous sections
mae <- get(load("mae.rda"))
pair <- read.csv("result/getPair.hypo.pairs.significant.csv")
```

# Schematic plot
Schematic plot shows a brief view of linkages between genes and probes.

## Nearby Genes
Generate schematic plot for one probe with 20 nearby genes and label  the gene significantly linked with the probe in red. 

```{r results='hide', eval=TRUE,fig.height=5,  fig.cap="The schematic plot shows probe colored in blue and the location of nearby 20 genes. The genes significantly linked to the probe  were shown in red.", message=FALSE, warning=FALSE}
schematic.plot(pair = pair, 
               data = mae,
               group.col = "definition",
               byProbe = "cg25312122",
               save = FALSE)
```

## Nearby Probes
Generate schematic plot for one gene with the probes which the gene is significantly 
linked to.

```{r results='hide', eval=TRUE, fig.width=6, fig.height=10, fig.cap="The schematic plot shows the gene colored in red and all blue colored probes, which are significantly linked to the  expression of this gene."}
schematic.plot(pair = pair, 
               data = mae,   
               group.col = "definition", 
               byGene = "ENSG00000143469", 
               save = FALSE)
```
