# Difference between revisions of "Jest"

The jest calculator returns an estimate of the traditional Jaccard index using Chao1 richness estimates for the richness of individual samples and the richness of the shared OTUs. This calculator can be used in the summary.shared and collect.shared commands.

$C_{Jaccard} = \frac{S_{AB, Chao}}{S_{A,Chao} + S_{B,Chao} - S_{AB,Chao}}$

where,

$S_{AB,Chao}$ = estimated number of OTUs shared between A and B using the sharedchao calculator.

$S_{A,Chao}$ = number of OTUs estimated in A using the chao calculator.

$S_{B,Chao}$ = number of OTUs estimated in B using the chao calculator.

Open the file 98_lt_phylip_amazon.fn.sabund generated using the Amazonian dataset with the following commands:

mothur > read.dist(phylip=98_lt_phylip_amazon.dist, cutoff=0.10)
mothur > cluster()


The 98_lt_phylip_amazon.fn.shared file will contain the following two lines:

0.10	forest	55	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
0.10	pasture	55	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


This indicates that the label for the OTU definition was 0.10. The first line is from the forest sample and the second is from the pasture sample. There are a total of 55 OTUs between the two communities. Elsewhere, we used the sharedchao calculator to estimate that the shared richness was 69.5 OTUs. The following commands using the chao calculator will provide the single sample Chao1 richness estimates:

mothur > read.otu(rabund=98_lt_phylip_amazon.fn.forest.rabund)
mothur > summary.single(calc=chao)
mothur > summary.single(calc=chao)


The output of these commands indicates Chao1 richness estimates of 81.6 ((95% CI=48 to 181) and 69.1 (95% CI=46 to 136) for the pasture and forest samples, respectively. Basically, we would predict that all of the forest OTUs are shared.

$C_{Jaccard} = \frac{69.5}{81.6+69.1-69.5}=0.8559$

Running...

mothur > read.otu(shared=98_lt_phylip_amazon.fn.shared)
mothur > summary.shared(calc=jest)


...and opening 98_lt_phylip_amazon.fn.shared.summary gives:

label	comparison		Jest
0.10	forest	pasture		0.855460


These are the same values that we found above for a cutoff of 0.10.