--- title: "Figure 3A Relative Beadbeating Heatmap" 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 and normalise sample counts ```{r BB_subset1} bbn <- subset_samples(V13,Exp.beadbeating == "YES") %>% transform_sample_counts(function(x) x / sum(x) * 100) ``` ## Figure 3A: Relative bead beating ```{r Fig3A, fig.align='center', fig.width=3.5, fig.height=2.8} amp_heatmap(data = bbn, group = "Beadbeating", tax.aggregate = "Phylum", tax.empty = "remove", tax.class = "p__Proteobacteria", order.x = c("20s4ms","20s6ms","80s4ms","40s6ms","80s6ms","160s6ms","400s6ms"), order.y = "400s6ms", plot.colorscale = "log10", plot.breaks = c(2,5,10,20), scale.seq = 100, tax.show = 11, plot.text.size = 2, plot.theme = "clean" ) + 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(angle = 0, hjust = 0.4, size = 8, color = "black")) ``` ## Save the plot ```{r save, eval=FALSE} ggsave("plots/Fig3A.eps", width = 90, height = 70, units = "mm") ```