1 #ifndef EACHGAPDISTIGNORENS_H
2 #define EACHGAPDISTIGNORENS_H
5 * eachgapdistignorens.h
8 * Created by Pat Schloss on 4/20/11.
9 * Copyright 2011 Schloss Lab. All rights reserved.
16 /**************************************************************************************************/
18 class eachGapDistIgnoreNs : public Dist {
21 void calcDist(Sequence A, Sequence B){
26 string seqA = A.getAligned();
27 string seqB = B.getAligned();
29 int alignLength = seqA.length();
31 for(int i=0; i<alignLength; i++){
32 if(seqA[i] != '.' || seqB[i] != '.'){
38 for(int i=start;i<alignLength;i++){
39 if(seqA[i] == '.' && seqB[i] == '.'){
42 else if((seqA[i] == '-' && seqB[i] == '-') || (seqA[i] == '-' && seqB[i] == '.') || (seqA[i] == '.' && seqB[i] == '-') || seqA[i] == 'N' || seqB[i] == 'N'){;}
44 if(seqA[i] != seqB[i]){
51 if(length == 0) { dist = 1.0000; }
52 else { dist = ((double)diff / (double)length); }
56 /**************************************************************************************************/