X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=readtree.h;h=8a692432c7cda431c6f5d73f409a0fa8e9152671;hp=02b6129b21b0bc960e1d16f9d028baab374bb465;hb=615301e57c25e241356a9c2380648d117709458d;hpb=d037597badc8d18e235c59f0c1114180edb7f98f diff --git a/readtree.h b/readtree.h index 02b6129..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,16 +23,22 @@ 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); + + vector getTrees() { return Trees; } + int AssembleTrees(); protected: - GlobalData* globaldata; + vector Trees; + CountTable* ct; int numNodes, numLeaves; + MothurOut* m; + }; @@ -44,18 +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: Tree* T; - int readNewickInt(istream&, int&, Tree*); - void readTreeString(); - void nexusTranslation(); + 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. + }; /****************************************************************************/