--- title: "Figure S9 Absolute Beadbeating Heatmap Order" author: "Mads Albertsen" date: "`r format(Sys.time(), '%d-%m-%Y')`" output: html_document --- ## Load packages ```{r Load_packages, message=FALSE, warning=FALSE, results='hide'} library("ampvis") ``` ## Load data ```{r load_data} data(DNAext_1.0) ``` ### Subset to the bead-beating related samples ```{r BB_subset1} bbn <- subset_samples(V13,Exp.beadbeating == "YES") %>% transform_sample_counts(function(x) x / sum(x) * 100) ``` ## Figure S9: Absolute comparison at Order level First we need to extract the relevant Orders. ```{r subset_order} top50 <- amp_heatmap(data = bbn, group = "Beadbeating", tax.aggregate = "Order", tax.empty = "remove", tax.class = "p__Proteobacteria", order.y = "400s6ms", tax.show = 50, output = "complete", tax.add = "Phylum") top50_names <- levels(top50$data$Display) ``` .. which are then used to define wich orders to plot in the absolute comparison. ```{r BB_heatmap_normalised_order, fig.align='center', fig.width=5, fig.height=6, warning=FALSE} amp_heatmap(data = bbn, group = "Beadbeating", normalise = "40s6ms", scale = "Concentration", tax.aggregate = "Order", tax.empty = "remove", tax.class = "p__Proteobacteria", order.x = c("20s4ms","20s6ms","80s4ms","40s6ms","80s6ms","160s6ms","400s6ms"), order.y = "400s6ms", plot.colorscale = "log2", plot.breaks = c(0.3,1.0,3.0), scale.seq = 100, tax.show = top50_names, tax.add = "Phylum", plot.theme = "clean", plot.text.size = 2 ) + scale_x_discrete(labels = c("20s\n4m/s","20s\n6m/s","80s\n4m/s","40s\n6m/s","80s\n6m/s","160s\n6m/s","400s\n6m/s")) + theme(axis.text.x = element_text(size =6, color = "black", hjust = 0.4, angle = 0)) ``` ```{r save_S9, eval=FALSE} ggsave("plots/S9_Fig.eps", width = 120, height = 150, units = "mm") ```