1 #ifndef EACHGAPIGNORE_H
2 #define EACHGAPIGNORE_H
7 * Created by Sarah Westcott on 5/7/09.
8 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
15 /**************************************************************************************************/
17 class eachGapIgnoreTermGapDist : public Dist {
21 void calcDist(Sequence A, Sequence B){
27 string seqA = A.getAligned();
28 string seqB = B.getAligned();
29 int alignLength = seqA.length();
31 for(int i=0;i<alignLength;i++){
32 if(seqA[i] != '.' && seqB[i] != '.' && seqA[i] != '-' && seqB[i] != '-' ){
34 cout << "start: " << start << endl;
38 for(int i=alignLength-1;i>=0;i--){
39 if(seqA[i] != '.' && seqB[i] != '.' && seqA[i] != '-' && seqB[i] != '-' ){
41 cout << "end: " << end << endl;
46 for(int i=start;i<=end;i++){
47 if(seqA[i] == '.' || seqB[i] == '.'){
50 else if(seqA[i] != '-' || seqB[i] != '-'){
51 if(seqA[i] != seqB[i]){
58 if(length == 0) { dist = 1.0000; }
59 else { dist = ((double)diff / (double)length); }
65 /**************************************************************************************************/