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){
29 for(int i=0;i<A.getLength();i++){
30 if(A.getAligned()[i] == '.' || B.getAligned()[i] == '.' || A.getAligned()[i] == '-' || B.getAligned()[i] == '-'){
37 for(int i=A.getLength()-1;i>=0;i--){
38 if(A.getAligned()[i] == '.' || B.getAligned()[i] == '.' || A.getAligned()[i] == '-' || B.getAligned()[i] == '-'){
46 for(int i=start; i<=end; i++){
47 if(A.getAligned()[i] == '.' || B.getAligned()[i] == '.'){
50 else if((A.getAligned()[i] != '-' && B.getAligned()[i] != '-')){
51 if(A.getAligned()[i] != B.getAligned()[i]){
58 if(length == 0) { dist = 1.0000; }
59 else { dist = ((double)diff / (double)length); }
65 /**************************************************************************************************/