Updated Practical 3 Processing 16S rRNA amplicon data (markdown) authored by Ben Francis's avatar Ben Francis
...@@ -129,6 +129,7 @@ load the data: ...@@ -129,6 +129,7 @@ load the data:
then do the plotting :) then do the plotting :)
```
library(ggplot2) library(ggplot2)
library(reshape2) library(reshape2)
library(RColorBrewer) library(RColorBrewer)
...@@ -150,7 +151,7 @@ then do the plotting :) ...@@ -150,7 +151,7 @@ then do the plotting :)
seqtab.m <- seqtab.m[grep(taxon, seqtab.m$variable),] seqtab.m <- seqtab.m[grep(taxon, seqtab.m$variable),]
seqtab.m$variable <- gsub("NA", "uncultured", seqtab.m$variable) seqtab.m$variable <- gsub("NA", "uncultured", seqtab.m$variable)
seqtab.m$variable <- gsub(".*Others", "Below_Min_Abund-Below_Min_Abund-Below_Min_Abund-Below_Min_Abund-Below_Min_Abund-Below_Min_Abund-Below_Min_Abund", seqtab.m$variable) seqtab.m$variable <- gsub(".*Others", "Below_Min_Abund-Below_Min_Abund-Below_Min_Abund-Below_Min_Abund-Below_Min_Abund-Below_Min_Abund-Below_Min_Abund", seqtab.m$variable)
seqtab.m$variable <- as.character(seqtab.m$variable) seqtab.m$variable <- as.character(seqtab.m$variable
seqtab.m$Domain <- sapply(strsplit(seqtab.m$variable, "-"), "[[", 1) seqtab.m$Domain <- sapply(strsplit(seqtab.m$variable, "-"), "[[", 1)
seqtab.m$Phylum <- sapply(strsplit(seqtab.m$variable, "-"), "[[", 2) seqtab.m$Phylum <- sapply(strsplit(seqtab.m$variable, "-"), "[[", 2)
seqtab.m$Class <- sapply(strsplit(seqtab.m$variable, "-"), "[[", 3) seqtab.m$Class <- sapply(strsplit(seqtab.m$variable, "-"), "[[", 3)
...@@ -169,6 +170,7 @@ then do the plotting :) ...@@ -169,6 +170,7 @@ then do the plotting :)
theme(text=element_text(family="Serif", size=16)) + theme(text=element_text(family="Serif", size=16)) +
theme(axis.text.x=element_text(angle=45, hjust=1)) theme(axis.text.x=element_text(angle=45, hjust=1))
} }
```
So the bit above creates the function called `plotTaxon()`, which we can then use to generate the plots. So the bit above creates the function called `plotTaxon()`, which we can then use to generate the plots.
... ...
......