# R script to plot aggregate RPKM abundance information for major uncultivated lineages # clear existing settings and data rm(list=ls()) # required libraries require(ggplot2) require(RColorBrewer) # read in the abundance data bar <- read.csv("Dropbox/Thrash_Lab/GoM_hypoxia_assemblies/taxon_abundance_calcs/Abund_calcs3.csv", header=TRUE) # set the order of the groups for the plot bar$minor <- as.character(bar$minor) bar$minor <- factor(bar$minor, levels=c("MGII","SAR406","SAR202","PAUC34f","Peregrinibacteria","Uhrbacteria","ACD39")) # create a bar plot of RPKM by sample, iterated over all groups, # and colored according to the DO concentration of the sample ggplot(bar, aes(x=Sample, y=Ai, fill=DO)) + geom_bar(stat="identity", position="dodge") + facet_wrap(~ minor, nrow=1) + labs(x="Sample", y="RPKM Abundance") + theme_bw() + theme(axis.text.x = element_text(angle = 90, size=6), strip.text.x = element_text(face="bold", size = 7)) + labs(fill = bquote('DO ('*mu~'mol' ~kg^-1*')'))