7 * Created by Sarah Westcott on 5/7/09.
8 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
14 /**************************************************************************************************/
16 // this class calculates distances by ignoring all gap characters. so if seq a has an "A" and seq
17 // b has a '-', there is no penalty
19 class ignoreGaps : public Dist {
23 void calcDist(Sequence A, Sequence B){
28 string seqA = A.getAligned();
29 string seqB = B.getAligned();
30 int alignLength = seqA.length();
32 for(int i=0;i<alignLength;i++){
33 if(seqA[i] != '.' && seqB[i] != '.'){
39 for(int i=start; i<alignLength; i++){
40 if(seqA[i] == '.' || seqB[i] == '.'){
43 else if((seqA[i] != '-' && seqB[i] != '-')){
44 if(seqA[i] != seqB[i]){
51 if(length == 0) { dist = 1.0000; }
52 else { dist = ((double)diff / (double)length); }
58 /**************************************************************************************************/