-
Notifications
You must be signed in to change notification settings - Fork 0
/
chem16S.Rmd
82 lines (70 loc) · 3.21 KB
/
chem16S.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
---
title: "Community-level chemical metrics for exploring genomic adaptation to environments (2023)"
output:
rmarkdown::html_vignette:
mathjax: null
vignette: >
%\VignetteIndexEntry{Community-level chemical metrics for exploring genomic adaptation to environments (2023)}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
bibliography: JMDplots.bib
csl: elementa.csl
link-citations: true
---
<style>
/* https://gomakethings.com/how-to-break-an-image-out-of-its-parent-container-with-css/ */
@media (min-width: 700px) {
.full-width {
left: 50%;
margin-left: -50vw;
margin-right: -50vw;
max-width: 100vw;
position: relative;
right: 50%;
width: 100vw;
}
}
@media (min-width: 1000px) {
.full-width {
left: 50vw; /* fallback if needed */
left: calc(50vw - 150px);
width: 1000px;
position: relative;
}
}
</style>
```{r setup, include=FALSE}
library(knitr)
## use pngquant to reduce size of PNG images
knit_hooks$set(pngquant = hook_pngquant)
pngquant <- "--speed=1 --quality=0-25"
# in case pngquant isn't available
if (!nzchar(Sys.which("pngquant"))) pngquant <- NULL
```
```{r options, include=FALSE}
options(width = 80)
```
```{r HTML, include=FALSE}
nH2O <- "<i>n</i><sub>H<sub>2</sub>O</sub>"
nO2 <- "<i>n</i><sub>O<sub>2</sub></sub>"
```
This vignette runs the code to make the plots from the following paper:
> Dick JM, Kang X. 2023. *chem16S*: community-level chemical metrics for exploring genomic adaptation to environments. *Bioinformatics* **39**(9): btad564. doi: [10.1093/bioinformatics/btad564](https://doi.org/10.1093/bioinformatics/btad564)
Update: The published version of this figure used GTDB version 207 for taxonomic classifications and the reference database.
As of 2024-07-06, the GTDB reference database in chem16S is at version 220 (GTDB r220), but the taxonomic classfications in the mouse.GTDB dataset were made with GTDB r214.
Consequently, Figure 1A shows mapping rate between two versions of the GTDB (r214 and r220) of less than 100%.
The small numerical differences from the published version of the figure do not affect the overall trends in chemical metrics.
This vignette was compiled on `r Sys.Date()` with
**[JMDplots](https://github.com/jedick/JMDplots)** `r packageDescription("JMDplots")$Version` and
**[chem16S](https://github.com/jedick/chem16S)** `r packageDescription("chem16S")$Version`.
```{r library, message = FALSE, results = "hide"}
library(JMDplots)
```
## Code example and plots (Figure 1)
```{r chem16S_1, message = FALSE, out.width='100%', fig.width = 9, fig.height = 7, out.extra = 'class="full-width"', pngquant = pngquant, dpi = 100}
chem16S_1()
```
**Data sources:**
The `GlobalPatterns` dataset is from the [**phyloseq**](https://doi.org/10.18129/B9.bioc.phyloseq) package [@MH13] and is adapted from @CLW+11.
The mouse gut dataset was created by analyzing sequence data from @SSZ+12 (downloaded [here](https://mothur.s3.us-east-2.amazonaws.com/wiki/miseqsopdata.zip) and used in the [mothur MiSeq SOP](https://mothur.org/wiki/miseq_sop/) and [DADA2 Pipeline Tutorial](https://benjjneb.github.io/dada2/tutorial.html)) with the DADA2 pipeline modified to use 16S rRNA sequences from GTDB [@Ali23] for taxonomic classifications.
## References