]> git.donarmstrong.com Git - mothur.git/blobdiff - sharedlennon.cpp
added sequence name to error string in fastq.info. Changed np_shannon to npshannon.
[mothur.git] / sharedlennon.cpp
index a68da6b05731ee214415e83d76fcb994bcd69dae..f3ed5ece3850f6528ecb56cc99a17765b7766ff7 100644 (file)
@@ -13,7 +13,7 @@
 
 EstOutput Lennon::getValues(vector<SharedRAbundVector*> shared) {
        try {
-               int S1, S2, S12, tempA, tempB, min;
+               double S1, S2, S12, tempA, tempB, min;
                S1 = 0; S2 = 0; S12 = 0; tempA = 0; tempB = 0; min = 0;
                
                /*S1, S2 = number of OTUs observed or estimated in A and B 
@@ -39,7 +39,7 @@ EstOutput Lennon::getValues(vector<SharedRAbundVector*> shared) {
                if (tempA < tempB) { min = tempA; }
                else { min = tempB; }
                
-               data[0] = S12 / (float)(S12 + min);
+               data[0] = 1.0 - S12 / (float)(S12 + min);
                
                if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }