Rarefaction controls the false positive rate when using adonis from the vegan R package (CC193)
Channel: Riffomonas Project
Date: 07/03/2022

Pat creates a simulation to test whether rarefaction can control the false positive rate when using the adonis function from the vegan R package. He reviews alternatives to rarefaction and how to implement them before using vegdist and avgdist from vegan to calculate distances. He then shows how to test for significance using adonis (also called PERMANOVA). Finally, he shows how to run 100 iterations of the test with different random number generator seeds using purrr's map_dfr and then speeds things up by parallelizing it with furrr's future_map_dfr. Rarefaction was the only method able to control the false positive rate with non-rarefied, relative abundance, and normalized data having high false positive rates. He'll show how to synthesize and visualize the data using tools from dplyr and other tidyverse packages.

You can find my blog post for this episode at https://www.riffomonas.org/code_club/2022-03-07-false-detection. The data were generated in our Kozich et al. 2013 paper (http://doi.org/10.1128/AEM.01043-13) using samples from the Schloss et al. 2012 paper (http://doi.org/10.4161/gmic.21008).

#furrr #vegan #adonis #R #Rstudio #Rstats

Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at https://shop.riffomonas.org/youtube to get practice problems, tips, and insights.

If you're interested in taking an upcoming 3 day R workshop be sure to check out our schedule at https://riffomonas.org/workshops/

You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: https://www.riffomonas.org/minimalR/
General data: https://www.riffomonas.org/generalR/

0:00 Rarefaction controls the false positive rate when using adonis
3:54 Review of different methods of controlling for uneven sampling effort
9:54 Running adonis on null model data
12:49 Extracting the p-value from adonis output
15:34 Creating a function to generate significance for different seeds
17:49 Geneate significance values for 100 random seeds
19:17 Assessing results