Question: Different calculation of Bray-Curtis dissimilarity in vegan (R) and mothur?
0
gravatar for songzewei
4.1 years ago by
songzewei0
United States
songzewei0 wrote:

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!

ADD COMMENTlink modified 2.9 years ago by ingra_sg0 • written 4.1 years ago by songzewei0
6
gravatar for pschloss
4.1 years ago by
pschloss290
United States
pschloss290 wrote:

 

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

 

ADD COMMENTlink modified 4.1 years ago • written 4.1 years ago by pschloss290
0
gravatar for ingra_sg
2.9 years ago by
ingra_sg0
ingra_sg0 wrote:

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.

ADD COMMENTlink written 2.9 years ago by ingra_sg0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1056 users visited in the last hour