]> git.donarmstrong.com Git - mothur.git/blobdiff - chimera.h
fixed some issues while testing 1.6
[mothur.git] / chimera.h
index 2dc2989280af72a7b55f5e54b3e699ae1405dda9..5df383ddcc56e62e853babb4f23e0978ce76d9c1 100644 (file)
--- a/chimera.h
+++ b/chimera.h
 
 
 #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 {
+               string leftParent;
+               string rightParent; 
+               float score;  
+               int midpoint;
+};
+
+struct linePair {
+                       int start;
+                       int end;
+                       linePair(int i, int j) : start(i), end(j) {}
+                       linePair(){}
+};
 
 /***********************************************************************/
 
@@ -29,37 +62,23 @@ class Chimera {
                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 setKmerSize(int k)                 {       kmerSize = k;           }
+               virtual void setSVG(int s)                              {       svg = s;                        }
+               virtual void setName(string n)                  {       name = 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
@@ -68,8 +87,9 @@ class Chimera {
                
        protected:
                
-               bool filter, correction;
-               int processors, window, increment;
+               bool filter, correction, svg;
+               int processors, window, increment, numWanted, kmerSize;
+               string seqMask, quanfile, filterString, name;
                        
 
 };