... | @@ -107,6 +107,24 @@ Now that we have these outputs, we need to make them useful! One way to do that |
... | @@ -107,6 +107,24 @@ Now that we have these outputs, we need to make them useful! One way to do that |
|
For now though, we're just going to use a (relatively) simple plotting function to inspect the sequence diversity in our samples. If you get bored you can try and puzzle through what the plot function is doing and start changing things. But if you're not bothered, you still get some nice plots :)
|
|
For now though, we're just going to use a (relatively) simple plotting function to inspect the sequence diversity in our samples. If you get bored you can try and puzzle through what the plot function is doing and start changing things. But if you're not bothered, you still get some nice plots :)
|
|
Like I said at the beginning, installation of DADA2 wasn't easy, and so in this R installation we don't get plots appearing on screen, we have to write them to file and look at them separately. I know.
|
|
Like I said at the beginning, installation of DADA2 wasn't easy, and so in this R installation we don't get plots appearing on screen, we have to write them to file and look at them separately. I know.
|
|
|
|
|
|
|
|
# Change of plans
|
|
|
|
We're all going to start today by making some plots. Sorry that the full dada processing took longer than I anticipated.
|
|
|
|
Start by getting the full processed dada data:
|
|
|
|
|
|
|
|
$ cp /bioinf/home/tfrancis/marmic_NGS2020/16S_amplicons/demultiplexed/seqtab_final.rds .
|
|
|
|
$ cp /bioinf/home/tfrancis/marmic_NGS2020/16S_amplicons/demultiplexed/taxa_final.rds .
|
|
|
|
|
|
|
|
Then start R (any R, doesn't matter this time)
|
|
|
|
|
|
|
|
$ R
|
|
|
|
|
|
|
|
load the data:
|
|
|
|
|
|
|
|
> seqtab.nochim <- readRDS("seqtab_final.rds")
|
|
|
|
> taxa <- readRDS("taxa_final.rds")
|
|
|
|
|
|
|
|
then do the plotting :)
|
|
|
|
|
|
library(ggplot2)
|
|
library(ggplot2)
|
|
library(reshape2)
|
|
library(reshape2)
|
|
library(RColorBrewer)
|
|
library(RColorBrewer)
|
... | @@ -141,6 +159,7 @@ Like I said at the beginning, installation of DADA2 wasn't easy, and so in this |
... | @@ -141,6 +159,7 @@ Like I said at the beginning, installation of DADA2 wasn't easy, and so in this |
|
theme(axis.text.x=element_text(angle=45, hjust=1))
|
|
theme(axis.text.x=element_text(angle=45, hjust=1))
|
|
}
|
|
}
|
|
|
|
|
|
|
|
# Ignore this bit about making pdfs
|
|
So the bit above creates the function called `plotTaxon()`, which we can then use to generate the plots. We're going to create a pdf of the plot by first opening a pdf file with the `pdf()` command, then run the `plotTaxon()` function, then switch off the plotting device.
|
|
So the bit above creates the function called `plotTaxon()`, which we can then use to generate the plots. We're going to create a pdf of the plot by first opening a pdf file with the `pdf()` command, then run the `plotTaxon()` function, then switch off the plotting device.
|
|
|
|
|
|
> pdf("Marmic-amplicon-plot.pdf")
|
|
> pdf("Marmic-amplicon-plot.pdf")
|
... | | ... | |