Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Code Block |
---|
head(asv_table) |
The taxonomy data from ampliseq is prefaced by D_0_
D_1_
etc but ampvis2 expects taxonomy assignments to be k_
p_
, etc (kingdom, phylum, etc). So we need to convert these using gsub()
Code Block |
---|
asv_table$Kingdom <- gsub("D_0", "k", asv_table$Kingdom) asv_table$Phylum <- gsub("D_1", "p", asv_table$Phylum) asv_table$Class <- gsub("D_2", "c", asv_table$Class) asv_table$Order <- gsub("D_3", "o", asv_table$Order) asv_table$Family <- gsub("D_4", "f", asv_table$Family) asv_table$Genus <- gsub("D_5", "g", asv_table$Genus) asv_table$Species <- gsub("D_6", "s", asv_table$Species) |
...
There are a multitude of other modifications you can make to a ggplot, too many to describe in this notebookworkshop. But there are plenty of online guides on how to modify ggplot plots. Here's an example: http://www.sthda.com/english/wiki/be-awesome-in-ggplot2-a-practical-guide-to-be-highly-effective-r-software-and-data-visualization
The above changes and more can be applied to any ampvis2 or ggplot plot in this notebookworkshop.
Once you have your rarefecation plot looking how you like, you can export it as a 300dpi (i.e. publication quality) tiff or pdf file:
...