-
Notifications
You must be signed in to change notification settings - Fork 10
/
Data.Rmd
executable file
·95 lines (69 loc) · 3.24 KB
/
Data.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
---
title: "Data"
author: "Leo Lahti, Sudarshan Shetty et al."
bibliography:
- bibliography.bib
output:
BiocStyle::html_document:
number_sections: no
toc: yes
toc_depth: 4
toc_float: true
self_contained: true
thumbnails: true
lightbox: true
gallery: true
use_bookdown: false
highlight: haddock
---
<!--
%\VignetteEngine{knitr::rmarkdown}
%\VignetteIndexEntry{microbiome tutorial - data}
%\usepackage[utf8]{inputenc}
%\VignetteEncoding{UTF-8}
-->
## Importing microbiome data in R
### Importing standard formats (CSV, Mothur, BIOM)
The microbiome package has import functions for certain standard data formats for 16S profiling (Simple CSV, Mothur, biom). For details, see the function help. To import these, use:
```{r read_phyloseq, eval=FALSE}
# Import output CSV files generated by write_phyloseq
pseq1 <- read_phyloseq(otu.file, taxonomy.file, metadata.file, type = "simple")
# Import mother .shared and .taxonomy and metadata files
pseq2 <- read_phyloseq(otu.file, taxonomy.file, metadata.file, type = "mothur")
# Import BIOM files
pseq3 <- read_phyloseq(otu.file, taxonomy.file, metadata.file, type = "biom")
```
You can also use additional [import functions](http://joey711.github.io/phyloseq/import-data) from the independent phyloseq R package.
### Converting you own data to phyloseq format in R
Alternatively, you can read your data in R (read.table, read.csv or other standard functions) and convert into phyloseq format. The procedure is well explained in the [phyloseq tutorial](http://joey711.github.io/phyloseq/import-data) from the independent phyloseq R package. See also examples on [manipulating](Preprocessing.html) for phyloseq objects.
## Microbiome example data sets
### Intestinal microbiota profiling of 1006 Western adults
[The HITChip Atlas](Atlas.html) data set is available via the microbiome R package in phyloseq format, and via [Data Dryad](http://doi.org/10.5061/dryad.pk75d) in tabular format. This data set from [Lahti et al. Nat. Comm. 5:4344, 2014](http://www.nature.com/ncomms/2014/140708/ncomms5344/full/ncomms5344.html) comes with 130 genus-like taxonomic groups across 1006 western adults with no reported health complications. Some subjects have also short time series. Load the data in R with:
```{r atlasdata, warning=FALSE, message=FALSE}
# Data citation doi: 10.1038/ncomms5344
library(microbiome)
data(atlas1006)
print(atlas1006)
```
### Diet swap between Rural and Western populations
A two-week diet swap study between western (USA) and traditional
(rural Africa) diets, reported in [O'Keefe et al. Nat. Comm. 6:6342,
2015](http://dx.doi.org/10.1038/ncomms7342). The data is also
available for download from [Data
Dryad](http://dx.doi.org/10.5061/dryad.1mn1n). Load in R with:
```{r dietswap2}
# Data citation doi: 10.1038/ncomms7342
data(dietswap)
print(dietswap)
```
### Intestinal microbiota versus blood metabolites
Data set from [Lahti et al. PeerJ 1:e32,
2013](https://doi.org/10.7717/peerj.32) characterizes associations
between human intestinal microbiota and blood serum lipids. Note that
this data set contains an additional data matrix of lipid
species. Load the data in R with:
```{r peerj2}
# Data citation doi: 10.7717/peerj.32
data(peerj32)
print(names(peerj32))
```