X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=onegapignore.h;h=32818e3df6fce4bc5ab8a4ddda975572146a2a53;hb=fd98ee6efb944d38bbd61fc36ea9fea2557e3830;hp=785272e08c69a3e1491d5d1d2792bbc9ba3eda5d;hpb=f2d22832d127f781989c98457f42e94aea96075f;p=mothur.git diff --git a/onegapignore.h b/onegapignore.h index 785272e..32818e3 100644 --- a/onegapignore.h +++ b/onegapignore.h @@ -25,6 +25,7 @@ public: int minLength = 0; int start = 0; int end = 0; + bool overlap = false; string seqA = A.getAligned(); string seqB = B.getAligned(); @@ -35,6 +36,7 @@ public: if(seqA[i] != '.' && seqB[i] != '.' && seqA[i] != '-' && seqB[i] != '-' ){ start = i; // cout << "start: " << start << endl; + overlap = true; break; } } @@ -42,6 +44,7 @@ public: if(seqA[i] != '.' && seqB[i] != '.' && seqA[i] != '-' && seqB[i] != '-' ){ end = i; // cout << "end: " << end << endl; + overlap = true; break; } } @@ -73,7 +76,10 @@ public: openGapB = 0; } } - + + //non-overlapping sequences + if (!overlap) { minLength = 0; } + if(minLength == 0) { dist = 1.0000; } else { dist = (double)difference / minLength; } }