This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Different calculation of Bray-Curtis dissimilarity in vegan (R) and mothur?

The Bray-Curtis dissimilarity using vegdist of the vegan package in R is calculated as the sum of absolute difference between each pair of OTU:

bray d[jk] = (sum abs(x[ij]-x[ik]))/(sum (x[ij]+x[ik]))

binary: (A+B-2*J)/(A+B)

But this is different from what is described in mothur (http://www.mothur.org/wiki/Braycurtis), and wiki (http://en.wikipedia.org/wiki/Bray%E2%80%93Curtis_dissimilarity), which use the sum of minimum abundance of each pair of OTU.

D_{Bray-Curtis}=1-2\frac{\sum min\left(S_{A,i}\mbox{, } S_{B,i}\right)}{\sum S_{A,i}+\sum S_{B,i}}

Are they the same mathematically?

Thanks!

dissimilarity mothur bray-curtis r

2 answers

Mathematically they're the same and give the same answer. For example...

forest <- c(1, 1, 1, 1, 1, 1, 3, 3, 2, 2, 1, 1, 3, 2, 1, 1, 1, 1, 2, 1, 1, 2, 5, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

pasture <- c(0, 0, 0, 1, 1, 0, 1, 0, 0, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 2, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 1, 1, 1, 1, 1, 7, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1)

1-2*sum(pmin(forest, pasture))/(sum(forest) + sum(pasture))
vegdist(rbind(forest, pasture))

Both will give you 0.7551

In this pdf_file http://www.econ.upf.edu/~michael/stanford/maeb5.pdf, you can find the correct formula´s notation used in vegdist implemented in vegan and their explanation of Bray-Curtis dissimilarity.

Log in to answer this question.