This repository has been archived by the owner on Dec 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
report.Rmd
107 lines (86 loc) · 4.9 KB
/
report.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
title: "Hydra report"
author:
- "Mattias de Hollander ([email protected])"
date: "`r format(Sys.time(), '%d %B, %Y')`"
params:
rmd: "report.Rmd"
output:
html_document:
highlight: tango
number_sections: no
theme: default
toc: yes
toc_depth: 3
toc_float:
collapsed: no
smooth_scroll: yes
bibliography: ../../hydra.bib
link-citations: true
---
# Hydra report for `r snakemake@config$project`
## Workflow details
- Hydra pipeline version 1.3.3 [@hollander_nioo-knaw/hydra:_2017] implemented in Snakemake [@koster_snakemakescalable_2012].
- Quality control: BBDuk2 from the BBMap tool suite [@bushnell_bbmap_2015].
- Read merging:`r if (snakemake@params[["mergemethod"]] == "vsearch") "Fastq_mergeparis option of vsearch [@rognes_vsearch:_2016]" else if (snakemake@params[["mergemethod"]] == "pandaseq") "Pandaseq [@masella_pandaseq:_2012]"`
- `r if (snakemake@config$its) "The ITS2 region is extracted using ITSx version 1.011 [@bengtsson-palme_improved_2013]."`
- Clustering: `r if (snakemake@config$clustering == "usearch_smallmem") "smallmem algorithm [@edgar_search_2010] as implented in vsearch."`
- Chimera's: UCHIME algorithm in de-novo mode [@edgar_uchime_2011] implemented in VSEARCH.
- Mapping: usearch_global method implemented in VSEARCH to create an otutable and converted to BIOM-Format [@mcdonald_biological_2012].
- Taxonomy: `r if (snakemake@config$classification == "sina") "aligning the sequences to the SILVA database (release 132) [@quast_silva_2013] using SINA [@pruesse_sina:_2012]" else if (snakemake@config$classification == "stampa") paste("aligning the sequences to the SILVA database (release 128) [@quast_silva_2013]. First the references sequences are trimmed with the forward (", snakemake@config$forward_primer, ") and reverse(", snakemake@config$reverse_primer, ") primer using cutadapt [@martin_cutadapt_2011]. Next, sequences are aligned using the usearch_global method implemented in vsearch. At last, the last common ancestor taxonomy is determined for the top hits using a python script provided by STAMPA [@mahe_stampa:_2017]") else if (snakemake@config$classification == "rdp") "running the RDP Classifier re-trained on the UNITE database release 7.2[@koljalg_towards_2013]" else if (snakemake@config$classification == "blast") paste("running BLASTN against the", snakemake@config$blast_db, "database and taking the least common ancestor of the top", snakemake@config$blast_max_hits, "hits.")`.
## Workflow overview
![](`r paste(snakemake@scriptdir, snakemake@input$workflow, sep="/")`)
### Input files
```{r kable, message=FALSE, warning=FALSE}
library(knitr)
kable(snakemake@config$data)
```
### Read counts
```{r readstats, message=FALSE, warning=FALSE}
library(knitr)
kable(read.delim(snakemake@input$readstat))
```
## Downloads
<!--<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>-->
<script>
function download(text, id, name, type) {
var file = new Blob([text], {type: type})
var a = $(id)
a[0].href = URL.createObjectURL(file)
a[0].download = name
}
function dataURItoBlob(dataURI, callback) {
// convert base64 to raw binary data held in a string
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
var byteString = atob(dataURI.split(',')[1]);
// separate out the mime component
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]
// write the bytes of the string to an ArrayBuffer
var ab = new ArrayBuffer(byteString.length);
var ia = new Uint8Array(ab);
for (var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
}
// write the ArrayBuffer to a blob, and you're done
var bb = new Blob([ab]);
return bb;
}
</script>
<p><a id="biom" href="link">Download BIOM file</a></p>
<script>
dataURL = "`r base64enc::dataURI(file = snakemake@input$biom, mime = 'text/csv', encoding = 'base64')`"
download(dataURItoBlob(dataURL), "#biom", "`r basename(snakemake@input$biom)`", 'text/plain')
</script>
<p><a id="otutable" href="link">Download otutable in txt format</a></p>
<script>
dataURL = "`r base64enc::dataURI(file = snakemake@input$otutable, mime = 'text/csv', encoding = 'base64')`"
download(dataURItoBlob(dataURL), "#otutable", "`r basename(snakemake@input$otutable)`", 'text/plain')
</script>
<p><a id="otus" href="link">Download OTUs in FASTA format</a></p>
<script>
dataURL = "`r base64enc::dataURI(file = snakemake@input$otus, mime = 'text/csv', encoding = 'base64')`"
download(dataURItoBlob(dataURL), "#otus", "`r basename(snakemake@input$otus)`", 'text/plain')
</script>
<a download="readstat.csv" href="`r base64enc::dataURI(file = snakemake@input$readstat, mime = 'text/csv', encoding = 'base64')`">Readstat csv file</a>
<a download="report.Rmd" href="`r base64enc::dataURI(file = params$rmd, mime = 'text/rmd', encoding = 'base64')`">R Markdown source file (to produce this document)</a>
## References