X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=chimera.h;h=8eec3cd03f16a0613f1c05e37e386dde7008c5be;hb=0e40e23448c2ee274268d85e0d0e65cb9eaeee6f;hp=e0e8944c6935afa6441b16c052b89b1fe2a51994;hpb=3abb236c602eb168ee112f080b563ebe2c705029;p=mothur.git diff --git a/chimera.h b/chimera.h index e0e8944..8eec3cd 100644 --- a/chimera.h +++ b/chimera.h @@ -12,10 +12,76 @@ #include "mothur.h" -#include "sparsematrix.hpp" +#include "sequence.hpp" -typedef list::iterator MatData; -typedef map SeqMap; //maps sequence to all distance for that seqeunce +/***********************************************************************/ +struct Preference { + string name; + string leftParent; //keep the name of closest left + string rightParent; //keep the name of closest + float score; //preference score + float closestLeft; //keep the closest left + float closestRight; //keep the closest right + int midpoint; + Preference() { name = ""; leftParent = ""; rightParent = ""; score = 0.0; closestLeft = 10000.0; closestRight = 10000.0; midpoint = 0; } + ~Preference() {} +}; +/***********************************************************************/ +struct score_struct { + int prev; + int score; + int row; + int col; +}; +/***********************************************************************/ +struct trace_struct { + int col; + int oldCol; + int row; +}; +/***********************************************************************/ +struct results { + int regionStart; + int regionEnd; + int nastRegionStart; + int nastRegionEnd; + string parent; + string parentAligned; + float queryToParent; + float queryToParentLocal; + float divR; +}; +/***********************************************************************/ +struct SeqDist { + Sequence* seq; + float dist; + int index; +}; +//******************************************************************************************************************** +//sorts lowest to highest +inline bool compareRegionStart(results left, results right){ + return (left.nastRegionStart < right.nastRegionStart); +} +//******************************************************************************************************************** +//sorts lowest to highest +inline bool compareSeqDist(SeqDist left, SeqDist right){ + return (left.dist < right.dist); +} +//******************************************************************************************************************** + +struct sim { + string leftParent; + string rightParent; + float score; + int midpoint; +}; + +struct linePair { + unsigned long int start; + unsigned long int end; + linePair(unsigned long int i, unsigned long int j) : start(i), end(j) {} + linePair(){} +}; /***********************************************************************/ @@ -24,29 +90,34 @@ class Chimera { public: - Chimera(){}; - Chimera(string); - Chimera(string, string); - virtual ~Chimera(){}; - virtual void setFilter(bool f) { filter = f; } - virtual void setCorrection(bool c) { correction = c; } - virtual void setProcessors(int p) { processors = p; } - virtual void setWindow(int w) { window = w; } - virtual void setIncrement(int i) { increment = i; } + Chimera(){ m = MothurOut::getInstance(); length = 0; unaligned = false; } + virtual ~Chimera(){ for (int i = 0; i < templateSeqs.size(); i++) { delete templateSeqs[i]; } }; + virtual bool getUnaligned() { return unaligned; } + virtual int getLength() { return length; } + virtual vector readSeqs(string); + virtual void setMask(string); + virtual map runFilter(Sequence*); + virtual string createFilter(vector, float); + virtual void printHeader(ostream&){}; + virtual int getChimeras(Sequence*){ return 0; } + virtual int getChimeras(){ return 0; } + virtual Sequence* print(ostream&, ostream&){ return NULL; } + virtual int print(ostream&, ostream&, string){ return 0; } - virtual void setCons(string) {}; + #ifdef USE_MPI + virtual Sequence* print(MPI_File&, MPI_File&){ return 0; } + virtual int print(MPI_File&, MPI_File&, string){ return 0; } + #endif - //pure functions - virtual void getChimeras() = 0; - virtual void print(ostream&) = 0; - protected: - bool filter, correction; - int processors, window, increment; - - + vector templateSeqs; + bool filter, unaligned; + int length; + string seqMask, filterString, outputDir, templateFileName; + Sequence* getSequence(string); //find sequence from name + MothurOut* m; }; /***********************************************************************/