]> git.donarmstrong.com Git - mothur.git/blobdiff - treegroupscommand.h
added sequence name to error string in fastq.info. Changed np_shannon to npshannon.
[mothur.git] / treegroupscommand.h
index 3c40eff6ab95c0dcb12e931e5f785f30654243db..d2d6c721c72fcc5d96926fc246c31e89743dca58 100644 (file)
  */
  
 #include "command.hpp"
-#include "sharedordervector.h"
-#include "sharedlistvector.h"
 #include "inputdata.h"
 #include "groupmap.h"
-#include "readotu.h"
 #include "validcalculator.h"
 #include "tree.h"
 #include "treemap.h"
-#include "sharedutilities.h"
+#include "readmatrix.hpp"
+#include "readcolumn.h"
+#include "readphylip.h"
+#include "sparsematrix.hpp"
 
 
 /* This command create a tree file for each similarity calculator at distance level, using various calculators to find the similiarity between groups. 
        The user can select the lines or labels they wish to use as well as the groups they would like included.
        They can also use as many or as few calculators as they wish. */
        
-class GlobalData;
+
+typedef list<PCell>::iterator MatData;
 
 class TreeGroupCommand : public Command {
        
 public:
-       TreeGroupCommand();     
+       TreeGroupCommand(string);       
+       TreeGroupCommand();
        ~TreeGroupCommand();
-       int execute();  
+       
+       vector<string> setParameters();
+       string getCommandName()                 { return "tree.shared";                         }
+       string getCommandCategory()             { return "OTU-Based Approaches";        }
+       string getHelpString(); 
+       string getCitation() { return "http://www.mothur.org/wiki/Tree.shared"; }
+       string getDescription()         { return "generate a tree file that describes the dissimilarity among groups"; }
+
+       
+       int execute(); 
+       void help() { m->mothurOut(getHelpString()); }  
        
 private:
-       void createTree();
-       void printSims();
+       int createTree();
+       void printSims(ostream&);
+       int makeSimsShared();
+       int makeSimsDist();
        
-       GlobalData* globaldata;
-       SharedUtil* util;
-       ReadOTUFile* read;
+       ReadMatrix* readMatrix;
+       SparseMatrix* matrix;
+       NameAssignment* nameMap;
+       ListVector* list;
        TreeMap* tmap;
        Tree* t;
        vector<Calculator*> treeCalculators;
        vector< vector<float> > simMatrix;
        map<int, int> index;  //maps row in simMatrix to vector index in the tree       
        InputData* input;
-       ValidCalculators* validCalculator;
-       SharedListVector* SharedList;
-       SharedOrderVector* order;
        vector<SharedRAbundVector*> lookup;
-       string format, outputFile, groupNames;
+       string lastLabel;
+       string format, outputFile, groupNames, filename, sharedfile, inputfile;
        int numGroups;
+       ofstream out;
+       float precision, cutoff;
+
+       bool abort, allLines;
+       set<string> labels; //holds labels to be used
+       string phylipfile, columnfile, namefile, calc, groups, label, outputDir;
+       vector<string>  Estimators, Groups, outputNames; //holds estimators to be used
+       
+       //if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
+       int process(vector<SharedRAbundVector*>);
+       
+       
 
 };