1. Set up the environment
Set up the R environment used in the tutorial, either via the workshop cloud environment or locally on your laptop.
Option A (recommended): Workshop RStudio environment
Note: This option was only available during the workshop. Otherwise, use Option B.
A virtual machine running RStudio Server is available in PDC Cloud. Log in using the credentials provided during the workshop:
RStudio Server (available during workshop only)
Follow the tutorial steps and avoid creating additional large objects, as resources are shared. Save your work regularly as an R script. The virtual machine will be shut down after the workshop, so download any code or output you want to keep via the Files pane (More → Export).
Check required packages
All required packages are pre-installed in the workshop environment. Load them and confirm that they are available:
library(asvoccur)
library(ranger)
library(vegan)
library(ape)
library(rworldmap)
library(data.table)Check access to example data
For this tutorial, ASV portal data is pre-downloaded and available on the virtual machine. Check access:
data_path <- "/srv/course-data/16S"
list.files(data_path)If two (16S) zip files are listed, you are ready to proceed.
Option B (fallback): Run RStudio locally on your laptop
Our cloud environment is being tested for the first time. If needed, you can run the tutorial locally.
You will need to install:
To install and load the required R packages:
# Install from CRAN
install.packages(c(
"remotes",
"ranger",
"vegan",
"ape",
"rworldmap",
"data.table"
))
# Install from GitHub
remotes::install_github("biodiversitydata-se/asvoccur")
# Load
library(asvoccur)
library(ranger)
library(vegan)
library(ape)
library(rworldmap)
library(data.table)
# Confirm version
packageVersion("asvoccur") # Should say 1.1.1Download example data from the ASV portal
In this option, example data is downloaded directly from the ASV portal.
Go to the ASV portal start page.
Click DOWNLOAD. If you are not already logged in, you will be redirected to the login page.
If you do not already have an account, either:
- sign in with a Google or GitHub account, or
- create a new SBDI account.
On the Download page, under Download link, download the following datasets (note the underlined project IDs to distinguish similar titles):
- PRJEB55296-16S
- KTH-2013-Baltic-16S
- PRJEB55296-18S
- KTH-2013-Baltic-18S
After downloading, organise the data locally into two sub-folders:
course-data/ ├── 16S/ │ ├── PRJEB55296-16S.zip │ └── KTH-2013-Baltic-16S.zip └── 18S/ ├── PRJEB55296-18S.zip └── KTH-2013-Baltic-18S.zipSet the path to the 16S data folder in R and confirm access:
data_path <- "local/path/to/course-data/16S"
list.files(data_path)If “KTH-2013-Baltic-16S.zip” and “PRJEB55296-16S.zip” are listed, you are ready to proceed.