X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=readtree.h;h=8a692432c7cda431c6f5d73f409a0fa8e9152671;hp=1abef8a179478b9db980ee6c21e6e6b9855a024b;hb=615301e57c25e241356a9c2380648d117709458d;hpb=58cf1d08fee8c64334979075fa57bcafb035a2ed diff --git a/readtree.h b/readtree.h index 1abef8a..8a69243 100644 --- a/readtree.h +++ b/readtree.h @@ -9,12 +9,9 @@ * */ -using namespace std; - -#include -#include -#include "globaldata.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')){}} @@ -26,21 +23,23 @@ class Tree; class ReadTree { public: ReadTree(); - ~ReadTree() {}; + virtual ~ReadTree() {}; - virtual void read() {}; + virtual int read(CountTable*) = 0; int readSpecialChar(istream&, char, string); int readNodeChar(istream& f); float readBranchLength(istream& f); - - - Tree* getTree() { return T; } + + vector getTrees() { return Trees; } + int AssembleTrees(); + protected: + vector Trees; + CountTable* ct; int numNodes, numLeaves; - GlobalData* globaldata; + MothurOut* m; + - protected: - Tree* T; }; /****************************************************************************/ @@ -48,14 +47,20 @@ class ReadTree { class ReadNewickTree : public ReadTree { public: - ReadNewickTree(string file) : treeFile(file) { openInputFile(file, filehandle); } + ReadNewickTree(string file) : treeFile(file) { m->openInputFile(file, filehandle); readOk = 0; } ~ReadNewickTree() {}; - void read(); + int read(CountTable*); private: - int readNewickInt(istream&, int&, Tree*); + Tree* T; + int readNewickInt(istream&, int&, Tree*, CountTable*); + int readTreeString(CountTable*); + string nexusTranslation(CountTable*); ifstream filehandle; string treeFile; + string holder; + int readOk; // readOk = 0 means success, readOk = 1 means errors. + }; /****************************************************************************/