... | @@ -7,23 +7,21 @@ Before we begin using DADA2, we need to tell our bash profile which version of R |
... | @@ -7,23 +7,21 @@ Before we begin using DADA2, we need to tell our bash profile which version of R |
|
|
|
|
|
### 3.1 Processing our data with DADA2
|
|
### 3.1 Processing our data with DADA2
|
|
Now to get going with DADA2. DADA2 is a very large software with an entire integrated pipeline that takes raw reads (minus primers and barcodes) as input.
|
|
Now to get going with DADA2. DADA2 is a very large software with an entire integrated pipeline that takes raw reads (minus primers and barcodes) as input.
|
|
In order for us to get started, we need to set our working directory to the location of our 16S rRNA gene sequence data.
|
|
In order for us to get started, we need to set our working directory to the location of our 16S rRNA gene sequence data:
|
|
|
|
|
|
> setwd("/bioinf/home/your_username/marmic_NGS2021/day_1/demultiplexed")
|
|
> setwd("/bioinf/home/your_username/marmic_NGS2021/day_1/demultiplexed")
|
|
|
|
|
|
Then start dada2 and some necessary dependencies for producing plots
|
|
Then start dada2:
|
|
|
|
|
|
> library(dada2)
|
|
> library(dada2)
|
|
> library(ggplot2)
|
|
|
|
|
|
|
|
|
|
The first part of the process involves preparing the files and file names. Look at the commands and the objects that are produced, and figure out what each one is doing.
|
|
The first parts of the process are now just preparing the files and file names. Look at the commands and the objects that are produced, and figure out what each one is doing.
|
|
|
|
|
|
|
|
> path <- "."
|
|
> path <- "."
|
|
> fnFs <- sort(list.files(path, pattern="R1.fastq.gz", full.names = TRUE))
|
|
> fnFs <- sort(list.files(path, pattern="R1.fastq.gz", full.names = TRUE))
|
|
> fnRs <- sort(list.files(path, pattern="R2.fastq.gz", full.names = TRUE))
|
|
> fnRs <- sort(list.files(path, pattern="R2.fastq.gz", full.names = TRUE))
|
|
|
|
|
|
What are fnFs and fnRs? Think about why we might want to make lists of files. (Remember how we used loops earlier to cycle through lists of files. Maybe in R we won't need to use a loop if we have a vector of items)
|
|
What are fnFs and fnRs? Think about why we might want to make lists of files. (Remember how we used loops earlier to cycle through lists of files. Maybe in R we won't need to use a loop if we have a vector of items.
|
|
|
|
|
|
> sample.names <- sapply(strsplit(basename(fnFs), ".R"), `[`, 1)
|
|
> sample.names <- sapply(strsplit(basename(fnFs), ".R"), `[`, 1)
|
|
|
|
|
... | @@ -42,7 +40,6 @@ Next we want to make file paths for the filtering and trimming step that will be |
... | @@ -42,7 +40,6 @@ Next we want to make file paths for the filtering and trimming step that will be |
|
> names(filtFs) <- sample.names
|
|
> names(filtFs) <- sample.names
|
|
> names(filtRs) <- sample.names
|
|
> names(filtRs) <- sample.names
|
|
|
|
|
|
|
|
|
|
Now we move on to actually filtering and quality trimming our reads. Again use `?` to see what filterAndTrim does, and what the various options are here.
|
|
Now we move on to actually filtering and quality trimming our reads. Again use `?` to see what filterAndTrim does, and what the various options are here.
|
|
|
|
|
|
> out <- filterAndTrim(fnFs, filtFs, fnRs, filtRs, maxN=0, maxEE=c(5,5), compress=TRUE, multithread=8)
|
|
> out <- filterAndTrim(fnFs, filtFs, fnRs, filtRs, maxN=0, maxEE=c(5,5), compress=TRUE, multithread=8)
|
... | | ... | |