---
title: "Genomes to report"
author: "Oliver Hansen"
date: "`r Sys.Date()`"
output:
  prettydoc::html_pretty:
    theme: cayman
    highlight: github
editor_options: 
  chunk_output_type: console
---

```{r Dependencies, message=TRUE, warning=TRUE, include=FALSE}
#Dependencies
library(tidyverse)
library(prettydoc)
#library(broom)
#library(magrittr)
#library(knitr)
#library(kableExtra)
library(DT)
```

```{r fig.height=100, fig.width=100}
#MLST overview

#The mlst software incorporates components of the PubMLST database which must be cited in any publications that use mlst:

#"This publication made use of the PubMLST website (https://pubmlst.org/) developed by Keith Jolley (Jolley & Maiden 2010, BMC Bioinformatics, 11:595) and sited at the University of Oxford. The development of that website was funded by the Wellcome Trust".

#You should also cite this software (currently unpublished) as:
#Seemann T, mlst Github https://github.com/tseemann/mlst
```

```{r mlst, echo=FALSE, message=TRUE, warning=TRUE}
#få mlst til at spytte header ud.
mlst <- read.table(file = 'mlst.tsv', sep = '\t', header = FALSE)
allelnum <- length(mlst) - 3

mlst %>% datatable(
#  options = list(
#   autoWidth = TRUE, 
#   columnDefs = list(list(width = '300px'))),
  class = 'cell-border stripe',
  rownames = FALSE,
  colnames = c('Isolate','Scheme', 'SequenceType', rep('Allel',allelnum) )
  )

  #kable() %>% 
  #kable_paper('hover', full_width = F)
```

```{r}
##Abricate
#It only supports contigs, not FASTQ reads
#It only detects acquired resistance genes, NOT point mutations
#It uses a DNA sequence database, not protein
#It needs BLAST+ >= 2.7

#uses the 3 databases:
#plasmidfinder
#Ncbi
#card

```


##Stats for the plasmidfinder database

```{r echo=FALSE, message=TRUE, warning=TRUE}
plasmidfinder_detail <- read.table(file = 'plasmidfinder_detail.tsv', sep = '\t', header = TRUE)

plasmidfinder_sum <- read.table(file = 'plasmidfinder_summary.tsv', sep = '\t', header = TRUE)

plasmidfinder_sum %>% datatable(
  options = list(
   autoWidth = TRUE, 
   columnDefs = list(list(width = '50px'))),
  class = 'cell-border stripe',
  rownames = FALSE
    )

plasmidfinder_detail  %>% datatable(
  options = list(
   autoWidth = TRUE, 
   columnDefs = list(list(width = '50px'))),
  class = 'cell-border stripe',
  rownames = FALSE 
 )
```

##Stats for the card database
