---
title: "RattleSNP 1.1.0 report"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
  rmdformats::readthedown:
    fig_caption: TRUE
    lightbox: TRUE
    gallery: TRUE
    highlight: pygments
    toc_depth: 5
    toc_float:
      collapsed: false
      smooth_scroll: false

---
<style>
#sidebar h2 {
    background-color: #2980B9;
}
h1,h2,h3,h4,h5,h6,legend{
color: #2980B9;
}
#main :not(.leaflet-control) > a {
    background-image: linear-gradient(180deg,#A9EAFE,#A9EAFE);
    color: #2980B9;
}
#content{max-width: 80%;}
.pagination > .active > a, .pagination > .active > a:focus, .pagination > .active > a:hover, .pagination > .active > span, .pagination > .active > span:focus, .pagination > .active > span:hover {
    background-color: #A9EAFE;
    border-color: #A9EAFE;
}
.footer{
    position:absolute; top:0; right:20px; padding:30px; height:180px
    }
</style>

```{r load package, include=FALSE, echo= FALSE, message = FALSE, warning = FALSE}
knitr::opts_chunk$set(echo = FALSE, warning=FALSE)

suppressMessages(library('knitr', warn.conflict = FALSE, quietly = TRUE))
suppressMessages(library('plotly', warn.conflict = FALSE, quietly = TRUE))
suppressMessages(library('rmdformats', warn.conflict = FALSE, quietly = TRUE))
suppressMessages(library('DT', warn.conflict = FALSE, quietly = TRUE))
suppressMessages(library('ggplot2', warn.conflict = FALSE, quietly = TRUE))
suppressMessages(library('rmarkdown', warn.conflict = FALSE, quietly = TRUE))
suppressMessages(library('readr', warn.conflict = FALSE, quietly = TRUE))
```
```{r load data, echo=FALSE, message=FALSE, warning=FALSE, include=TRUE}
file.quality.depth <- snakemake@input$depth_resume
datatableDepth <- read.table(file=file.quality.depth, sep="\t", header=TRUE)

file.quality.flagstat <- snakemake@input$flagstat_resume
datatablFlagstat <- read.table(file=file.quality.flagstat, sep="\t", header=TRUE)
```


# Samtools flagstat

```{r Visualisation of samtools, echo=FALSE, message=FALSE, warning=FALSE, include=TRUE}
datatable(datatablFlagstat, caption =" Tableau n°2: Samtools flagstat statistics",
          rownames = FALSE,
          colnames = colnames(datatablFlagstat),
          escape = FALSE,
          class = 'table table-striped table-bordered table-hover',
          extensions = 'Buttons',
          filter = list(position = 'top', clear = FALSE, plain = TRUE),
          option= list(
            paging=TRUE,searching = TRUE,ordering=TRUE,scrollCollapse=FALSE,server = TRUE, autoWidth = TRUE,
            dom = 'BRSPQlfrtip',
            buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
                         )
              )

```


# Depth and coverage

```{r Visualisation of Depth, echo=FALSE, message=FALSE, warning=FALSE, include=TRUE}
datatable(datatableDepth, caption =" Tableau n°1: Genome coverage statistics",
          rownames = NULL,
          colnames = colnames(datatableDepth),
          escape = FALSE,
          class = 'table table-striped table-bordered table-hover',
          extensions = 'Buttons',
          filter = list(position = 'top', clear = FALSE, plain = TRUE),
          option= list(
                        paging=TRUE,searching = TRUE,ordering=TRUE,scrollCollapse=FALSE,server = TRUE, autoWidth = TRUE,
                        dom = 'BRSPQlfrtip',
                        buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
                    )
        )
```

<footer>
        <p style="text-align: center;">Snakemake report of workflow <a target="_blank" href="https://github.com/sravel/RattleSNP">RattleSNP</a> created by <a target="_blank" href="https://github.com/sravel">Sébastien RAVEL</a></p>
        <p style="text-align: center;"><a target="_blank" href = "mailto:sebastien.ravel@cirad.fr"><span style="color: #808080;"><em>sebastien.ravel@cirad.fr</em></span></a></p>
</footer>
