7 * Created by Sarah Westcott on 5/7/09.
8 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
14 /**************************************************************************************************/
16 class eachGapDist : public Dist {
19 void calcDist(Sequence A, Sequence B){
24 string seqA = A.getAligned();
25 string seqB = B.getAligned();
26 int alignLength = seqA.length();
28 for(int i=0; i<alignLength; i++){
29 if(seqA[i] != '.' || seqB[i] != '.'){
35 for(int i=start;i<alignLength;i++){
36 if(seqA[i] == '.' && seqB[i] == '.'){
39 else if((seqA[i] == '-' && seqB[i] == '-') || (seqA[i] == '-' && seqB[i] == '.') || (seqA[i] == '.' && seqB[i] == '-')){;}
41 if(seqA[i] != seqB[i]){
48 if(length == 0) { dist = 1.0000; }
49 else { dist = ((double)diff / (double)length); }
54 /**************************************************************************************************/