Using vegan to calculate alpha diversity metrics within the tidyverse in R (CC196)

  Рет қаралды 21,057

Riffomonas Project

Riffomonas Project

Күн бұрын

Пікірлер: 52
@AlertedDonkey42
@AlertedDonkey42 2 жыл бұрын
Literally just started working with some invertebrate community data today and saw this. It's helpful! Thanks!
@Riffomonas
@Riffomonas 2 жыл бұрын
Wonderful!
@SalmaSarker-i1p
@SalmaSarker-i1p 28 күн бұрын
Dear Patrick, I hope this email finds you well. I am currently working on soil microbiology and analyzing data in R. Your videos have been incredibly helpful for me as a novice researcher. I have been closely following your Raffomonas channel and your publications on the importance of rarefaction for ecological microbial data, which have been immensely insightful. Based on your recommendations, I implemented empirical rarefaction, performing 1,000 iterations with my desired sequencing depth. From this, I derived the mean richness and standard deviation values for all my samples. However, I am now looking to move forward with beta diversity analysis and calculating various indices of alpha diversity. This requires an ASV table, but the empirical rarefied data I currently have does not include an ASV column. I managed to combine my treatment metadata with the empirical data, and I also have a phyloseq object from before the rarefaction process. I was wondering if it is possible to perform empirical rarefaction directly on my phyloseq object. If so, what output should I expect? Would it provide an ASV table along with mean richness and other metrics? Additionally, I have read in your paper that “Rarefaction repeats the subsampling a large number of times (e.g., 100 or 1,000 times) and calculates the mean of the alpha or beta diversity metric over those subsamplings; rarefaction is implemented with the vegan R package using the rarefy or avgdist functions.” Could you please provide more guidance on how I should proceed with alpha and beta diversity analysis using empirical rarefied data? Your insights would be invaluable for my project, and I sincerely appreciate your time and expertise.
@Riffomonas
@Riffomonas 27 күн бұрын
Hi Salma - I really know nothing about phyloseq :) I'd encourage you to use mothur instead. You can see how we use rarefaction for alpha and beta diversity using OTUs, phylotypes, and ASVs in the MiSeq SOP - mothur.org/wiki/miseq_sop/
@theresadavenport8346
@theresadavenport8346 Жыл бұрын
Theis video series is so helpful! I am following along with my own data, highly recommended!
@ggimdone4138
@ggimdone4138 7 ай бұрын
Stunning. Learnt alot from this vid. Thanks man, super clear!!!
@Riffomonas
@Riffomonas 7 ай бұрын
My pleasure - thanks for watching!
@kishormaharjan5313
@kishormaharjan5313 Жыл бұрын
Hi, this is great. I'm struggling with creating the function for Pielou’s Evenness Index and including that one along with richness, Shannon, Simpson. Please help.
@abdoulieb.jallow996
@abdoulieb.jallow996 4 ай бұрын
thank so much for the video. what about if sample autumn, winter and spring in a river at 3 different locations and you were to look at this by locations and season in the year?
@Riffomonas
@Riffomonas 4 ай бұрын
I'd encourage you to check out the summary.single function in the mothur package to rarefy all samples to the same level of sequencing effort
@allmywhat
@allmywhat 2 жыл бұрын
Great content! Could you show a video on how to incorporate the rarefied data from your previous videos into plotting alpha diversity to compare it to non-rarefied data?
@Riffomonas
@Riffomonas 2 жыл бұрын
Thanks Michael - I do this a few times over the series on rarefaction. Non rarefied data are more variable, larger and produce spurious significant differences more often when effects are confounded with sampling effort
@hope2024-g
@hope2024-g 2 жыл бұрын
Thank you so much Sir for your awesome video! Could you show us Generalized additive model using mgcv package with interpretation using a data contain both continues and categorical variables plz?
@Riffomonas
@Riffomonas 2 жыл бұрын
Thanks for watching! Unfortunately that’s not a tool I use so it’ll probably be awhile before I make a video with that
@svetlinavasileva109
@svetlinavasileva109 2 жыл бұрын
Hi Pat, thanks so much for your videos, they are pure gold! I was wondering how can I apply this to data in another format. I have a dataframe (df) with samples as rows and taxa as columns. I tried this code, but it doesn't work. df%>% summarize(richness=richness(x), shannon=shannon(x), simpson=simpson(x), invsimpson=1/simpson(x), n=sum(x)) I guess, I am not sure what to put instead of (value) as in your code. Or would I need to transform the data?
@Riffomonas
@Riffomonas 2 жыл бұрын
Thanks for watching! You’d still need to pivot longer to get columns of samples, taxa, and counts. Then group by samples and then the summarize function you have
@svetlinavasileva109
@svetlinavasileva109 2 жыл бұрын
@@Riffomonas Thank you!
@KarizmaFahlevy
@KarizmaFahlevy Жыл бұрын
Hi, thank you very much for the videos !! Im still new in R, and happy to learn Do you have any lecture video for functional diversity, traitspace, CWM using the FD packages?
@Riffomonas
@Riffomonas 10 ай бұрын
sorry but i don't
@KarizmaFahlevy
@KarizmaFahlevy 7 ай бұрын
@@Riffomonas Thanks
@emekaemmanuel5258
@emekaemmanuel5258 2 жыл бұрын
Does the Vegan function calculate Observed ASVs and Faith's Phylogenetic Diversity (PD) index?
@Riffomonas
@Riffomonas 2 жыл бұрын
Not that I know of. I calculated PD using mothur.
@deodatusruganuza5254
@deodatusruganuza5254 Жыл бұрын
I am working on human GI nematodes which has one species, that has multiple ASvs are diversity measure important??
@AntaraKulkarni
@AntaraKulkarni 2 жыл бұрын
This is a great video, thank you so much! I was wondering about the y axis in the calculation of a Shannon Diversity. If n represents the total abundance of all the sites, wouldn't it keep increasing for all metrics?
@josenicolasperez-garcia8119
@josenicolasperez-garcia8119 2 жыл бұрын
Can yo help me, in Anosim test how I can have the pairwase R and p values? I have the general result in Rstudio but not the pairwase result
@Riffomonas
@Riffomonas 2 жыл бұрын
You might need to assign the output to a variable and then run str on that variable
@efratsharon1294
@efratsharon1294 2 жыл бұрын
Thank you, It would be helpful to add statistics on top of the alpha diversity metrics calculated. Thanks
@Riffomonas
@Riffomonas 2 жыл бұрын
I’m not 100% what you mean but you can add any text to a plot by adding a geom_text to the existing plot.
@efratsharon1294
@efratsharon1294 2 жыл бұрын
@@Riffomonas I meant calculate the significance of comparing between Alpha diversity of healthy and sick (or other conditions)
@heidiyeh7585
@heidiyeh7585 2 жыл бұрын
@@efratsharon1294 I second this, specifically how to run an ANOVA that shows whether the groups you were analyzing for the first 10 minutes of this video have a statistically significant difference in their alpha diversity values
@mohamedmdaini8143
@mohamedmdaini8143 Жыл бұрын
Thank you for the amazing tuto, but the "%>%" doesnt really work in my case, it always shows "could not find function "%>%", any solutions? Thanks
@tommajor3725
@tommajor3725 Жыл бұрын
you need to install the dplyr package install.packages("dplyr") library(dplyr)
@Riffomonas
@Riffomonas 8 ай бұрын
be sure that you've run library(tidyverse) or library(magrittr) to get the %>% to work. Alternatively, you could use the base R pipe - |>
@mohamedmdaini8143
@mohamedmdaini8143 8 ай бұрын
@@Riffomonas thank you
@cristianjaviermena6955
@cristianjaviermena6955 Жыл бұрын
Thanks you Patch!
@bjmoreno100
@bjmoreno100 2 жыл бұрын
what is the structure and format of the data and tables that you use to perform this analysis ?
@bjmoreno100
@bjmoreno100 2 жыл бұрын
i have a table of tha that contains a information of each individual in one row , and i only want to select group, name and value when the result of value is the count of name times apear in one group.
@Riffomonas
@Riffomonas 2 жыл бұрын
The rows are samples and the columns are taxa. You can see the file if you go to the link in the description and then to the GitHub link
@spencersiddons5577
@spencersiddons5577 2 жыл бұрын
Hi there. How can I import the dataset from github into R? I select "Download" in the github file and it brings up the data in a table (the .shared file) in a new webpage, but I cannot figure out where to go from there. Thank you!
@Riffomonas
@Riffomonas 2 жыл бұрын
Thanks for watching Spencer. If you follow the video at riffomonas.org/code_club/2022-01-24-catching-up you'll see how to get the data you need.
@spencersiddons5577
@spencersiddons5577 2 жыл бұрын
@@Riffomonas Thank you!
@upheaveworker2108
@upheaveworker2108 Жыл бұрын
So basically, the alpha diversity is in our study plot, but in beta diversity, it must be compared to alpha diversity in other region/continent/island/country, mustn't it?
@Riffomonas
@Riffomonas 10 ай бұрын
beta takes into account who is there and in what abundance. alpha doesn't care. two communities could have the same number of taxa (alpha), but completely different taxa (beta)
@meseretmuche6984
@meseretmuche6984 2 жыл бұрын
remarkable lecture Q: how can i calculate the hill number diversity index in r (q=0, q=1, and q=2)
@Riffomonas
@Riffomonas 2 жыл бұрын
Thanks for watching - i don't know that vegan does hill numbers (i've never used them in my work). You could certainly write your own function to do it in R
@jotaro.10
@jotaro.10 8 ай бұрын
i am a beginner, how to get that "x" in our data?
@Riffomonas
@Riffomonas 8 ай бұрын
Sorry, I'm not sure where you are referring to - can you point me to where in the video you are asking about?
@jotaro.10
@jotaro.10 8 ай бұрын
Like the one in richness
@Riffomonas
@Riffomonas 8 ай бұрын
@@jotaro.10 x is a "dummy" variable that is used to calculate the alpha diversity metric. If you look at around 4:00 you'll see the richness function is called with the values from the "value" column in the dataframe
@SeguC48
@SeguC48 2 жыл бұрын
Beautiful !!!
@Riffomonas
@Riffomonas 2 жыл бұрын
Thank you! Glad you found the channel 🤓
@hermanediesse6035
@hermanediesse6035 Жыл бұрын
the best video ever
How to rarefy community data in R with vegan and the tidyverse (CC200)
23:00
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Field Ecology - Diversity Metrics in R
15:20
Alison Styring
Рет қаралды 16 М.
Alpha diversity metrics
10:54
QIIME 2
Рет қаралды 13 М.
Multi-Panel Plots in R (using ggplot2)
12:18
Peeling Back Data
Рет қаралды 40 М.
alpha, beta, gamma diversity - mussel data
5:47
Tim O'Connell ecology, birding, & natural history
Рет қаралды 11 М.
Rarefying ecological distances with R: Should you?  (CC189)
22:01
Riffomonas Project
Рет қаралды 6 М.
Is normalization an acceptable alternative to rarefaction? Nope. (CC190)
22:10
Rarefied Species Accumulation Curves (the simple way) tutorial
10:50
The Wildlife Degree - University of Suffolk
Рет қаралды 18 М.