]> git.donarmstrong.com Git - mothur.git/blobdiff - readtree.h
added sff.multiple command. fixed issue with windows paralellization in chimera...
[mothur.git] / readtree.h
index 41d03058d6478cb371737dbc385c8bb5d0a1c999..6b074de839070a86bd3e010bbf222a7ec4011dce 100644 (file)
@@ -9,22 +9,59 @@
  *
  */
 
-using namespace std;
+#include "mothur.h"
+#include "tree.h"
 
-#include <string>
-#include <iostream>
+#define MAX_LINE               513
+#define SKIPLINE(f,c)  {while((c=f.get())!=EOF && ((c) != '\n')){}}
 
+class Tree;
+
+/****************************************************************************/
 
 class ReadTree {
        public:
-               ReadTree();
-               ~ReadTree();
+               ReadTree(); 
+               virtual ~ReadTree() {};
                
+               virtual int read(TreeMap*) = 0;
+               int readSpecialChar(istream&, char, string);
+               int readNodeChar(istream& f);
+               float readBranchLength(istream& f);
        
-       private:
-       
+               vector<Tree*> getTrees() { return Trees; }
+               int AssembleTrees(map<string, string>);
+               
+       protected:
+               vector<Tree*> Trees;
+               TreeMap* treeMap;
+               int numNodes, numLeaves;
+               MothurOut* m;
+               
+               
+};
+
+/****************************************************************************/
 
+class ReadNewickTree : public ReadTree {
+       
+public:
+       ReadNewickTree(string file) : treeFile(file) { m->openInputFile(file, filehandle); readOk = 0; } 
+       ~ReadNewickTree() {};
+       int read(TreeMap*);
+       
+private:
+       Tree* T;
+       int readNewickInt(istream&, int&, Tree*, TreeMap*);
+       int readTreeString(TreeMap*);
+       string nexusTranslation(TreeMap*);
+       ifstream filehandle;
+       string treeFile;
+       string holder;
+       int readOk;  // readOk = 0 means success, readOk = 1 means errors.
+       
 };
 
+/****************************************************************************/
 
-#endif
\ No newline at end of file
+#endif