X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=readtree.h;h=8a692432c7cda431c6f5d73f409a0fa8e9152671;hp=15597bafbfd64eb88c2f4304aff0fb9b78ac60ea;hb=cf9987b67aa49777a4c91c2d21f96e58bf17aa82;hpb=9651e8e7172d86707b34af15e95ec60ad4c3c3f9 diff --git a/readtree.h b/readtree.h index 15597ba..8a69243 100644 --- a/readtree.h +++ b/readtree.h @@ -9,11 +9,9 @@ * */ -using namespace std; - -#include "globaldata.hpp" -#include "utilities.hpp" +#include "mothur.h" #include "tree.h" +#include "counttable.h" #define MAX_LINE 513 #define SKIPLINE(f,c) {while((c=f.get())!=EOF && ((c) != '\n')){}} @@ -25,16 +23,21 @@ class Tree; class ReadTree { public: ReadTree(); - ~ReadTree() {}; + virtual ~ReadTree() {}; - virtual int read() = 0; + virtual int read(CountTable*) = 0; int readSpecialChar(istream&, char, string); int readNodeChar(istream& f); float readBranchLength(istream& f); + + vector getTrees() { return Trees; } + int AssembleTrees(); protected: - GlobalData* globaldata; + vector Trees; + CountTable* ct; int numNodes, numLeaves; + MothurOut* m; }; @@ -44,15 +47,15 @@ class ReadTree { class ReadNewickTree : public ReadTree { public: - ReadNewickTree(string file) : treeFile(file) { openInputFile(file, filehandle); readOk = 0; } + ReadNewickTree(string file) : treeFile(file) { m->openInputFile(file, filehandle); readOk = 0; } ~ReadNewickTree() {}; - int read(); + int read(CountTable*); private: Tree* T; - int readNewickInt(istream&, int&, Tree*); - int readTreeString(); - void nexusTranslation(); + int readNewickInt(istream&, int&, Tree*, CountTable*); + int readTreeString(CountTable*); + string nexusTranslation(CountTable*); ifstream filehandle; string treeFile; string holder;