...
Code Block |
---|
tiff_exp <- paste0("community_tax_abund_BW_plot_", taxgroup, "_samples_.tiff") ggsave(file = tiff_exp, dpi = 300, compression = "lzw", device = "tiff", plot = p, width = 20, height = 20, units = "cm") pdf_exp <- paste0("community_tax_abund_BW_plot_", taxgroup, "_samples_.pdf") ggsave(file = pdf_exp, device = "pdf", plot = p, width = 20, height = 20, units = "cm") |
...
6d. Choosing a variable to analyse
In the Alpha Diversity section, you already imported your nfcore/ampliseq results and converted them to an ampvis2 object. To have another quick look at your ampvis object:
Code Block |
---|
ampvisdata |
As As in the Alpha Diversity section, you need to choose a variable to work with.
...
Code Block |
---|
colnames(samples_table) |
Now Now enter the variable you want to analyse:
Code Block |
---|
group <- "Nose_size" |
And once again you’ll need to order the groups in your variable. See the ‘Ordering your variable’ section in the Alpha diversity section for more details.
Choose how you want to order your groups:
Code Block |
---|
lev <- c("Small", "Medium", "Big") |
Then run the following to apply the levels to your data:
Code Block |
---|
ampvisdata$metadata[[group]] <- factor(ampvisdata$metadata[[group]], levels = lev) |
6e. Community structure by variable
In this section you can generate heatmaps and box and whisker plots for the variable you selected above, and for each taxonomic level.
If you want to analyse another variable here, go back to the previous section, choose another variable and re-run the code from that point.