#include "mothur.h"
-#include "sparsematrix.hpp"
#include "sequence.hpp"
-typedef list<PCell>::iterator MatData;
-typedef map<int, float> SeqMap; //maps sequence to all distance for that seqeunce
+struct Preference {
+ string name;
+ vector<string> leftParent; //keep the name of closest left associated with the two scores
+ vector<string> rightParent; //keep the name of closest right associated with the two scores
+ vector<float> score; //so you can keep last score and calc this score and keep whichever is bigger.
+ vector<float> closestLeft; //keep the closest left associated with the two scores
+ vector<float> closestRight; //keep the closest right associated with the two scores
+ int midpoint;
+
+};
+
+struct SeqDist {
+ Sequence* seq;
+ float dist;
+};
+
+//********************************************************************************************************************
+//sorts lowest to highest
+inline bool compareSeqDist(SeqDist left, SeqDist right){
+ return (left.dist < right.dist);
+}
+//********************************************************************************************************************
+
+struct sim {
+ Sequence* leftParent;
+ Sequence* rightParent;
+ float score;
+ int midpoint;
+};
+
+struct linePair {
+ int start;
+ int end;
+ linePair(int i, int j) : start(i), end(j) {}
+ linePair(){}
+};
/***********************************************************************/
Chimera(string);
Chimera(string, string);
virtual ~Chimera(){};
- virtual void setFilter(bool f) { filter = f; }
+ 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; }
+ virtual void setNumWanted(int n) { numWanted = n; }
- virtual void setCons(string) {};
- virtual void setQuantiles(string) {};
-
- virtual vector<Sequence*> readSeqs(string file) {
- try {
- ifstream in;
- openInputFile(file, in);
- vector<Sequence*> container;
-
- //read in seqs and store in vector
- while(!in.eof()){
-
- Sequence* current = new Sequence(in);
- container.push_back(current);
- gobble(in);
- }
-
- in.close();
- return container;
- }
- catch(exception& e) {
- errorOut(e, "Chimera", "readSeqs");
- exit(1);
- }
- }
+ virtual void setCons(string){};
+ virtual void setQuantiles(string){};
+ virtual vector<Sequence*> readSeqs(string);
+ virtual vector< vector<float> > readQuantiles();
+ virtual void setMask(string);
+ virtual void runFilter(vector<Sequence*>);
+ virtual void createFilter(vector<Sequence*>);
//pure functions
protected:
bool filter, correction;
- int processors, window, increment;
+ int processors, window, increment, numWanted;
+ string seqMask, quanfile, filterString;
};