]> git.donarmstrong.com Git - mothur.git/blob - parsimonycommand.h
changes while testing
[mothur.git] / parsimonycommand.h
1 #ifndef PARSIMONYCOMMAND_H
2 #define PARSIMONYCOMMAND_H
3 /*
4  *  parsimonycommand.h
5  *  Mothur
6  *
7  *  Created by Sarah Westcott on 1/26/09.
8  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
9  *
10  */
11
12 #include "command.hpp"
13 #include "parsimony.h"
14 #include "counttable.h"
15 #include "progress.hpp"
16 #include "sharedutilities.h"
17 #include "fileoutput.h"
18 #include "readtree.h"
19
20
21 class ParsimonyCommand : public Command {
22
23 public:
24         ParsimonyCommand(string);       
25         ParsimonyCommand();
26         ~ParsimonyCommand(){}
27         
28         vector<string> setParameters();
29         string getCommandName()                 { return "parsimony";                           }
30         string getCommandCategory()             { return "Hypothesis Testing";          }
31         
32         string getHelpString(); 
33     string getOutputPattern(string);    
34         string getCitation() { return "Slatkin M, Maddison WP (1989). A cladistic measure of gene flow inferred from the phylogenies of alleles. Genetics 123: 603-13. \nSlatkin M, Maddison WP (1990). Detecting isolation by distance using phylogenies of genes. Genetics 126: 249-60. \nMartin AP (2002). Phylogenetic approaches for describing and comparing the diversity of microbial communities. Appl Environ Microbiol 68: 3673-82. \nSchloss PD, Handelsman J (2006). Introducing TreeClimber, a test to compare microbial community structure. Appl Environ Microbiol 72: 2379-84.\nhttp://www.mothur.org/wiki/Parsimony"; }
35         string getDescription()         { return "generic test that describes whether two or more communities have the same structure"; }
36
37         int execute();
38         void help() { m->mothurOut(getHelpString()); }
39         
40 private:
41         FileOutput* output;
42         vector<Tree*> T;           //user trees
43         Tree* randT;  //random tree
44         Tree* copyUserTree; 
45         CountTable* ct; 
46         CountTable* savect;
47         vector<string> groupComb; // AB. AC, BC...
48         string sumFile, randomtree, allGroups, outputDir, treefile, groupfile, namefile, countfile;
49         int iters, numGroups, numComp, counter, processors, numUniquesInName;
50         vector<int> numEachGroup; //vector containing the number of sequences in each group the users wants for random distrib.
51         vector< vector<float> > userTreeScores; //scores for users trees for each comb.
52         vector< vector<float> > UScoreSig;  //tree score signifigance when compared to random trees - percentage of random trees with that score or lower.
53         EstOutput userData;                     //pscore info for user tree
54         EstOutput randomData;           //pscore info for random trees
55         map<int, double>  validScores;  //map contains scores from both user and random
56         vector< map<int, double> > rscoreFreq;  //map <pscore, number of random trees with that score.> -vector entry for each combination.
57         vector< map<int, double> > uscoreFreq;  //map <pscore, number of user trees with that score.> -vector entry for each combination.
58         vector< map<int, double> > rCumul;  //map <pscore, cumulative percentage of number of random trees with that score or lower.> -vector entry for each combination.
59         vector< map<int, double> > uCumul;  //map <pscore, cumulative percentage of number of user trees with that score or lower .> -vector entry for each combination.
60         
61         ofstream outSum;
62         bool abort;
63         string groups, itersString;
64         vector<string> Groups, outputNames; //holds groups to be used
65         map<string, string> nameMap;
66         
67         void printParsimonyFile();  
68         int printUSummaryFile();
69         void getUserInput();
70         int readNamesFile();
71         
72 };
73
74
75 #endif