Updated Practical 3 Processing 16S rRNA amplicon data (markdown) authored by Ben Francis's avatar Ben Francis
...@@ -159,11 +159,13 @@ then do the plotting :) ...@@ -159,11 +159,13 @@ then do the plotting :)
theme(axis.text.x=element_text(angle=45, hjust=1)) theme(axis.text.x=element_text(angle=45, hjust=1))
} }
plotTaxon(seqtab.nochim, taxa, "Bacteroidetes", 0.01, "Genus")
# Ignore this bit about making pdfs # 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")
> plotTaxon(seqtab.nochim, taxa, "Bacteroidetes", 0.01, "Genus") >
> dev.off() > dev.off()
Once you have your plot, you can open a new terminal (don't quit R because we will want to create different plots for different taxa - just change the file name for the pdf) and run: Once you have your plot, you can open a new terminal (don't quit R because we will want to create different plots for different taxa - just change the file name for the pdf) and run:
... ...
......