]> git.donarmstrong.com Git - mothur.git/blobdiff - chimera.h
worked on chimeras
[mothur.git] / chimera.h
index 2febd00e4be6ac8e4c1e8b0f0493cc47ed487834..2dc2989280af72a7b55f5e54b3e699ae1405dda9 100644 (file)
--- a/chimera.h
+++ b/chimera.h
@@ -13,6 +13,7 @@
 
 #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
@@ -37,6 +38,29 @@ class Chimera {
                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);
+                       }
+               }
+               
                
                //pure functions
                virtual void getChimeras() = 0;