KasperSkytte / ampvis2

Tools for visualising microbial community amplicon data
https://kasperskytte.github.io/ampvis2/
GNU General Public License v3.0
67 stars 24 forks source link

Similar values for Shannon diversity for rarefied and unrarefied reads #159

Closed afmbafmb closed 1 year ago

afmbafmb commented 1 year ago

Hi,

amp_alphadiv gave the same values for Shannon diversity (with small variations in the decimal points) when using both rarefied and unrarefied reads for the AalborgWWTP data. Can I just check if the rarefied reads were used for the Shannon diversity calculations? Or was the RawReads used instead?

These are my codes :

alphadiversityresult_xrarefy <- amp_alphadiv(AalborgWWTPs, measure = c("shannon", "simpson"), rarefy = NULL)

alphadiversityresult <- amp_alphadiv(AalborgWWTPs, measure = c("shannon", "simpson"), rarefy = 20000)

Thank you!

KasperSkytte commented 1 year ago

Hi

The indices are calculated on the rarefied reads. But rarefaction doesn't always have a noticable effect. With this data not much is removed.

KasperSkytte commented 1 year ago

You can test by using the amp_rarefy function first, then pass on to amp_alphadiv without rarefying there. Results should be similar, not identical as there are random numbers involved. Can set the seed if you want