X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=ignoregaps.h;fp=ignoregaps.h;h=894f92d9644182ece0a7d18e491384d2058f2d54;hb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc;hp=0000000000000000000000000000000000000000;hpb=1b73ff67c83892a025e597dabd9df6fe7b58206a;p=mothur.git diff --git a/ignoregaps.h b/ignoregaps.h new file mode 100644 index 0000000..894f92d --- /dev/null +++ b/ignoregaps.h @@ -0,0 +1,67 @@ +#ifndef IGNOREGAPS_H +#define IGNOREGAPS_H +/* + * ignoregaps.h + * Mothur + * + * Created by Sarah Westcott on 5/7/09. + * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved. + * + */ + +#include "dist.h" + +/**************************************************************************************************/ + +// this class calculates distances by ignoring all gap characters. so if seq a has an "A" and seq +// b has a '-', there is no penalty + +class ignoreGaps : public Dist { + +public: + + ignoreGaps() {} + + void calcDist(Sequence A, Sequence B){ + int diff = 0; + int length = 0; + int start = 0; + bool overlap = false; + + string seqA = A.getAligned(); + string seqB = B.getAligned(); + int alignLength = seqA.length(); + + for(int i=0;i