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.
14 /**************************************************************************************************/
16 class oneGapIgnoreTermGapDist : public Dist {
19 void calcDist(Sequence A, Sequence B){
28 string seqA = A.getAligned();
29 string seqB = B.getAligned();
30 int alignLength = seqA.length();
32 // this assumes that sequences start and end with '.'s instead of'-'s.
33 for(int i=0;i<alignLength;i++){
34 if(seqA[i] != '.' && seqB[i] != '.'){
39 for(int i=alignLength-1;i>=0;i--){
40 if(seqA[i] != '.' && seqB[i] != '.'){
46 for(int i=start;i<=end;i++){
47 if(seqA[i] == '-' && seqB[i] == '-'){ ; }
48 else if(seqB[i] != '-' && seqA[i] == '-'){
56 else if(seqA[i] != '-' && seqB[i] == '-'){
64 else if(seqA[i] != '-' && seqB[i] != '-'){
65 if(seqA[i] != seqB[i]){
74 if(minLength == 0) { dist = 1.0000; }
75 else { dist = (double)difference / minLength; }
80 /**************************************************************************************************/