---
title: "PathoStat Report"
author: "Solaiappan Manimaran"
date: "`r Sys.Date()`"
output: 
  html_vignette:
    toc: true
    toc_depth: 2
    template: PathoStat.html
    self_contained: no
    lib_dir: libs
---

```{r, echo=FALSE}
shinyInput <- getShinyInput()
eval_cell_1 = (report_option_vector[1]=="1")
```
`r if (eval_cell_1) 'Data Summary'`
`r if (eval_cell_1) '============'`
`r if (eval_cell_1) 'This is a summary with the Relative Abundance of genomes for each samples.'`
```{r eval=eval_cell_1, echo=FALSE, message=FALSE, fig.width=12, fig.height=8}
#datasummary <- summary(t(dat))
#panderOptions("table.split.table", 120)  
## table split at 100 (default 80) characters in a line
#pander(datasummary[,1:10])
#pander(dat)
#Add an id variable for the filled regions
pstat <- shinyInput$pstat
taxdata <- findRAfromCount(pstat@otu_table)
taxdata <- data.frame(taxdata)
dat <- melt(cbind(taxdata, ind = rownames(taxdata)), 
    id.vars = c('ind'))
ggplot(dat,aes(x = variable, y = value,fill = ind)) + 
    geom_bar(position = "fill",stat = "identity") + 
    scale_y_continuous(labels = percent_format())

```
