7 * Created by Sarah Westcott on 5/7/09.
8 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
15 /**************************************************************************************************/
17 class oneGapDist : public Dist {
23 void calcDist(Sequence A, Sequence B){
31 string seqA = A.getAligned();
32 string seqB = B.getAligned();
33 int alignLength = seqA.length();
35 for(int i=0;i<alignLength;i++){
36 if((seqA[i] != '.' || seqB[i] != '.')){
42 for(int i=start;i<alignLength;i++){
43 if((seqA[i] == '-' && seqB[i] == '-') || (seqA[i] == '.' && seqB[i] == '-') || (seqA[i] == '-' && seqB[i] == '.')){ ; }
44 else if(seqA[i] == '.' && seqB[i] == '.'){
47 else if(seqB[i] != '-' && (seqA[i] == '-' || seqA[i] == '.')){
55 else if(seqA[i] != '-' && (seqB[i] == '-' || seqB[i] == '.')){
63 else if(seqA[i] != '-' && seqB[i] != '-'){
64 if(seqA[i] != seqB[i]){
78 if(minLength == 0) { dist = 1.0000; }
79 else { dist = (double)difference / minLength; }
84 /**************************************************************************************************/