layout: true background-image: url(img/logo-course-microbe.jpg), url(img/logo_SBR.png), url(img//NTU-Logo-full-colour.png) background-position: right 10px top 20px, right 50px bottom 50px,left 50px bottom 50px, top 350px left 500px background-size: 35%, 25%, 20% # Microbes on Earth --- <br> <br> <br> <br> ## R - installation and reading .font120[**Daniel Vaulot**] 2021-10-12 --- layout: false # Outline .font150[ * [Session 01 - Introduction to R](https://daniel-vaulot.fr/html/course-microbes-2021/R-session-01-intro.html) * [Session 02 - Data wrangling](https://daniel-vaulot.fr/html/course-microbes-2021/R-session-02-data_wrangling.html) * [Session 03 - Data viz](https://daniel-vaulot.fr/html/course-microbes-2021/R-session-03-data_visualization.html) * [Session 04 - R markdown](https://daniel-vaulot.fr/html/course-microbes-2021/R-session-04-markdown.html) * [Session 05 - Metabarcode analyses with Phyloseq](https://daniel-vaulot.fr/html/course-microbes-2021/R-session-05-phyloseq.html) ] --- # Installation ## R and R packages * Install [R](https://cran.r-project.org/index.html) * Install [R studio](https://www.rstudio.com/products/rstudio/download/#download) * Install the following packages * Data manipulation * **readxl** : Reading Excel files * **readr** : Reading and writing Text files * **dplyr** : Filter and reformat data frames * **tidyr** : Make data "tidy" * **tibble** : Manipulate data frames * **stringr** : Manipulating strings * Graphics * **ggplot2**: Graphics * Markdown * **knitr** * **tinytex** * Metabarcode analysis * **[phyloseq](https://bioconductor.org/packages/release/bioc/html/phyloseq.html)** --- background-image: url(img/R_for_datascience.png) background-position: right 20px top 20px background-size: 25% # Reading material ## Session 01-03 - Data analysis Choose of the two text below. Make sure you make the exercises. * [Statistical Inference via Data Science](https://moderndive.netlify.app/index.html) * Chapters 1 to 3 * [R for Data Science](https://r4ds.had.co.nz/) * Chapters 1 to 5 * [Solutions to exercises](https://jrnold.github.io/r4ds-exercise-solutions) ## Session 04 - Rmarkdown * [Intro to R markdown](https://ourcodingclub.github.io/tutorials/rmarkdown/) ## Session 05 - Phyloseq * [Phyloseq paper](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0061217) * [Phyloseq help](https://joey711.github.io/phyloseq/index.html) - see Tutorials --- layout: true # Installation - MetaPR2 package --- ## Step 1 - Download the R package [https://daniel-vaulot.fr/html/course-microbes-2021/metapr2-shiny-main.zip](https://daniel-vaulot.fr/html/course-microbes-2021/metapr2-shiny-main.zip) ## Step 2 - Install package on your computer * Unpack Zip file * Launch shiny_metapr2.Rproj --- ## Step 3 - Install the following libraries ```r ### Shiny install.packages("shiny" ) install.packages("shinyvalidate" ) # For validation of input (easier to use than shinyFeedback) install.packages("shinycssloaders" ) # For the spinning wheel install.packages("shinyWidgets" ) # for Extra widgets - https://dreamrs.github.io/shinyWidgets/index.html install.packages("markdown" ) # To display text boxes in md install.packages("DT" ) # For table display ### Tidyverse install.packages("dplyr" ) install.packages("tidyr" ) install.packages("stringr" ) install.packages("forcats" ) ``` --- ## Step 3 - Install the following libraries ```r ### graphics install.packages("ggplot2" ) install.packages("viridis" ) install.packages("patchwork" ) install.packages("treemapify" ) ### maps install.packages("leaflet" ) install.packages("leaflet.minicharts" ) # To do nice pie charts ### Misc install.packages("rio" ) ### Bioinformatics if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("Biobase") BiocManager::install("Biostrings") BiocManager::install("phyloseq") ``` --- ## Step 4 - Launch the metaPR2 shiny server Run the following line from R studio ```r install.packages("pkgload") pkgload::load_all(".") metapr2App() ``` --- ## Stop the Shiny application * Close the browser window OR * Hit the stop button at the top right of the bottom left window ## In case Shiny application crashes * Hit the stop button at the top right of the bottom left window * Relaunch `metapr2App()`