-
Notifications
You must be signed in to change notification settings - Fork 16
/
00--required_software.Rmd
93 lines (67 loc) · 4.98 KB
/
00--required_software.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
---
output: html_document
bibliography: "bibtexlib.bib"
---
```{r setup, include=FALSE}
source("style.R")
```
# Installing required software and data
## Installing R
R is a computer language that focuses on statistics, data science, and visualization.
It can be installed on all common operating systems.
R can be downloaded here:
https://cran.r-project.org/
## Installing RStudio
`r gloss$add('RStudio')` is an "Integrated Development Environment" (IDE) which is a fancy way of saying "text editor with extra programming-related tools".
RStudio makes it easier to use R, but is not needed to use R.
Most R users seem to use RStudio, so we are recommending it for this workshop.
The main version of RStudio, which is free and open source, can be downloaded here:
https://www.rstudio.com/products/rstudio/download/#download
## Installing the required R packages
In addition to tools included with every R installation, it is common to install `r gloss$add('R package', shown = 'R packages')`, which are sets of tools bundled together in a standardize way, making them easy to install.
In fact, most functionality used in R is from R packages, not `r gloss$add('base R')`.
The following packages are used in this primer.
Clicking of their name will lead to documentation (perhaps unofficial) for the package.
1. [vegan](http://cc.oulu.fi/~jarioksa/opetus/metodi/vegantutor.pdf): Implements many standard statistical techniques used in ecological research. Is used extensively by packages like `phyloseq` and `metacoder`. [@dixon2003vegan]
1. [metacoder](https://github.com/grunwaldlab/metacoder#an-r-package-for-metabarcoding-research-planning-and-analysis): Manipulation and visualization of taxonomic data, particularly those from amplicon metagenomics research. [@foster2017metacoder]
1. [taxa](https://github.com/ropensci/taxa#taxa): defines taxonomic `r gloss$add('class', shown = 'classes')` and functions to manipulate them. The goal is to use these classes as low level fundamental taxonomic classes that other R packages can build on and use. This is used by `metacoder`. [@foster2018taxa]
1. [phyloseq](https://joey711.github.io/phyloseq/index.html): Popular package with tools for analysis and visualization of microbiome data [@mcmurdie2013phyloseq].
1. [ggplot2](http://r-statistics.co/Complete-Ggplot2-Tutorial-Part1-With-R-Code.html): Awesome graphing package. [@wickham2009ggplot2]
1. [dplyr](http://stat545.com/block009_dplyr-intro.html): A package for manipulating tabular data with a cohesive and intuitive set of commands. A popular alternative to base R methods. [@wickham2015dplyr]
1. [readr](https://cran.r-project.org/web/packages/readr/vignettes/readr.html): Makes reading tabular data from files easier.
1. [stringr](https://cran.r-project.org/web/packages/stringr/vignettes/stringr.html): Functions for text manipulation.
1. [agricolae](https://cran.r-project.org/web/packages/agricolae/vignettes/tutorial.pdf): Used for the design and analysis of experiments, especially plant-related experiments.
1. [ape](http://ape-package.ird.fr/): A popular package for DNA sequence analysis and phylogenetics.
We wrote and actively maintain `metacoder` [@foster2017metacoder] and `taxa` [@foster2018taxa] so they
are heavily relied upon in this primer.
More R resources useful for microbiome data analysis can be found here:
https://microsud.github.io/Tools-Microbiome-Analysis/
You can enter the following script in the R console to install these packages:
```{r, eval = FALSE}
# Install phyloseq from Bioconductor
source('http://bioconductor.org/biocLite.R')
biocLite("phyloseq")
# Install the rest of the packages from CRAN
install.packages(c("vegan", "metacoder", "taxa", "ggplot2", "dplyr", "readr", "stringr", "agricolae", "ape"),
repos = "http://cran.rstudio.com",
dependencies = TRUE)
```
If the installation does not work, try installing the packages one at a time (e.g., `install.packages("taxa")`) and look for error messages.
Usually the problem is that there is a non-R dependency that needs to be installed and how you install it will depend on your operating system.
Copying the error messages into Google will usually help you figure it out.
If a package has installed correctly, you should be able to load it with `library` (e.g., `library(phyloseq)`).
You can test if the software is installed correctly by opening RStudio and running the following code.
Look at the appendices if you need help using R or RStudio.
```{r warning=FALSE}
library(metacoder)
x = parse_tax_data(hmp_otus, class_cols = "lineage", class_sep = ";",
class_key = c(tax_rank = "info", tax_name = "taxon_name"),
class_regex = "^(.+)__(.+)$")
heat_tree(x, node_label = taxon_names, node_size = n_obs, node_color = n_obs)
```
If you see the above graph, then congratulations! You should now be all set for using R in this workshop.
If you do not see the graph, then email us the result of the following code to help us troubleshoot the problem.
```{r eval=FALSE}
sessionInfo()
```
## References