1 #ifndef ONEIGNOREGAPS_H
2 #define ONEIGNOREGAPS_H
7 * Created by Sarah Westcott on 5/7/09.
8 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
15 /**************************************************************************************************/
17 class oneGapIgnoreTermGapDist : public Dist {
20 void calcDist(Sequence A, Sequence B){
29 string seqA = A.getAligned();
30 string seqB = B.getAligned();
31 int alignLength = seqA.length();
33 // this assumes that sequences start and end with '.'s instead of'-'s.
34 for(int i=0;i<alignLength;i++){
35 if(seqA[i] != '.' && seqB[i] != '.' && seqA[i] != '-' && seqB[i] != '-' ){
37 cout << "start: " << start << endl;
41 for(int i=alignLength-1;i>=0;i--){
42 if(seqA[i] != '.' && seqB[i] != '.' && seqA[i] != '-' && seqB[i] != '-' ){
44 cout << "end: " << end << endl;
49 for(int i=start;i<=end;i++){
50 if(seqA[i] == '-' && seqB[i] == '-'){ ; }
51 else if(seqB[i] != '-' && seqA[i] == '-'){
59 else if(seqA[i] != '-' && seqB[i] == '-'){
67 else if(seqA[i] != '-' && seqB[i] != '-'){
68 if(seqA[i] != seqB[i]){
77 if(minLength == 0) { dist = 1.0000; }
78 else { dist = (double)difference / minLength; }
83 /**************************************************************************************************/