joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
577 stars 187 forks source link

Alpha diversity : Simpson #940

Open Alpacman opened 6 years ago

Alpacman commented 6 years ago

Hi everyone ! Just a simple question : Does the alpha diversity simpson on phyloseq is the gini-simpson ?

spholmes commented 6 years ago

Gini-Simpson is equal to 1- Simpson. See https://en.wikipedia.org/wiki/Diversity_index#Gini%E2%80%93Simpson_index

On Mon, May 21, 2018 at 4:41 AM, Alpacman notifications@github.com wrote:

Hi everyone ! Just a simple question : Does the alpha diversity simpson on phyloseq is the gini-simpson ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/joey711/phyloseq/issues/940, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJcvcK8YdEu4kFikUKTuH0nbaNlRfi2ks5t0qgFgaJpZM4UG27W .

-- Susan Holmes John Henry Samter Fellow in Undergraduate Education Professor, Statistics 2017-2018 CASBS Fellow, Sequoia Hall, 390 Serra Mall Stanford, CA 94305 http://www-stat.stanford.edu/~susan/

Alpacman commented 6 years ago

And that's the one phyloseq uses?

spholmes commented 6 years ago

phyloseq uses the functions as they are defined by vegan and so the function "diversity" as defined in vegan says:

?diversity

diversity(x, index = "simpson", MARGIN = 1, base = exp(1))

Both variants of Simpson's index are based on D = sum p_i^2. Choice simpson returns 1-D and invsimpson returns 1/D.

So you are right in some sense, phyloseq returns 1-simpson as it is defined in vegan.

I remember other discussions about this but we have kept consistent with vegan for all the choices.

(Maybe in this case unfortunate), but as long as you know.

Hope this helps.

Susan

On Mon, May 21, 2018 at 6:51 AM, Alpacman notifications@github.com wrote:

And that's the one phyloseq uses?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/joey711/phyloseq/issues/940#issuecomment-390659612, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJcvapTuhSmZK1IBPu_BfxYBZKvPHehks5t0sZjgaJpZM4UG27W .

-- Susan Holmes John Henry Samter Fellow in Undergraduate Education Professor, Statistics 2017-2018 CASBS Fellow, Sequoia Hall, 390 Serra Mall Stanford, CA 94305 http://www-stat.stanford.edu/~susan/

Alpacman commented 6 years ago

Thanks you for your answer ! Because I had samples with low shannon diversity, so if I understand this right ,those samples should be high on the simpson index ( so the D one not the 1 -D ). Or in my case they stay low, so after checking that nothing is wrong with my samples ,I got to the conclusion that the simpson index may be the gini one .