X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=phylosummary.h;fp=phylosummary.h;h=9ebdf81ac4fbd06490f05d7be7c15b6f6a5d1179;hb=cd9dbd8b53bbe32af3e9c6bead4aa6d796a278a5;hp=0000000000000000000000000000000000000000;hpb=6f4b9401f7deb8aaf0d87659298308f4138cc3b0;p=mothur.git diff --git a/phylosummary.h b/phylosummary.h new file mode 100644 index 0000000..9ebdf81 --- /dev/null +++ b/phylosummary.h @@ -0,0 +1,61 @@ +#ifndef RAWTRAININGDATAMAKER_H +#define RAWTRAININGDATAMAKER_H + +/* + * rawTrainingDataMaker.h + * Mothur + * + * Created by westcott on 4/21/10. + * Copyright 2010 Schloss Lab. All rights reserved. + * + */ + +#include "mothur.h" +#include "mothurout.h" +#include "groupmap.h" + +/**************************************************************************************************/ + +struct rawTaxNode { + map children; //childs name to index in tree + int parent, level; + string name, rank; + map groupCount; + int total; + + rawTaxNode(string n) : name(n), level(0), parent(-1), total(0) {} + rawTaxNode(){} +}; + +/**************************************************************************************************/ +//doesn't use MPI ifdefs since only pid 0 uses this class +class PhyloSummary { + +public: + PhyloSummary(string, string); + ~PhyloSummary() { if (groupmap != NULL) { delete groupmap; } } + + void summarize(string); //pass it a taxonomy file and a group file and it makes the tree + int addSeqToTree(string, string); + void print(ofstream&); + int getMaxLevel() { return maxLevel; } + +private: + string getNextTaxon(string&); + vector tree; + void print(int, ofstream&); + void assignRank(int); + void readTreeStruct(ifstream&); + GroupMap* groupmap; + + int numNodes; + int numSeqs; + int maxLevel; + MothurOut* m; +}; + +/**************************************************************************************************/ + +#endif + +