1 #ifndef UNIFRACWEIGHTEDCOMMAND_H
2 #define UNIFRACWEIGHTEDCOMMAND_H
5 * unifracweightedcommand.h
8 * Created by Sarah Westcott on 2/9/09.
9 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
13 #include "command.hpp"
16 #include "progress.hpp"
17 #include "sharedutilities.h"
18 #include "fileoutput.h"
21 class UnifracWeightedCommand : public Command {
24 UnifracWeightedCommand(string);
25 UnifracWeightedCommand();
26 ~UnifracWeightedCommand() {}
28 vector<string> setParameters();
29 string getCommandName() { return "unifrac.weighted"; }
30 string getCommandCategory() { return "Hypothesis Testing"; }
31 string getHelpString();
34 void help() { m->mothurOut(getHelpString()); }
40 linePair(int i, int j) : start(i), num(j) {}
42 vector<linePair> lines;
47 vector<Tree*> T; //user trees
48 vector<double> utreeScores; //user tree unweighted scores
49 vector<double> WScoreSig; //tree weighted score signifigance when compared to random trees - percentage of random trees with that score or lower.
50 vector<string> groupComb; // AB. AC, BC...
53 string sumFile, outputDir;
54 int iters, numGroups, numComp, counter;
55 EstOutput userData; //weighted score info for user tree
56 EstOutput randomData; //weighted score info for random trees
57 vector< vector<double> > rScores; //vector<weighted scores for random trees.> each group comb has an entry
58 vector< vector<double> > uScores; //vector<weighted scores for user trees.> each group comb has an entry
59 vector< map<float, float> > rScoreFreq; //map <weighted score, number of random trees with that score.> -vector entry for each combination.
60 vector< map<float, float> > rCumul; //map <weighted score, cumulative percentage of number of random trees with that score or higher.> -vector entry for each c
61 map<float, float> validScores; //map contains scores from random
63 bool abort, phylip, random, includeRoot;
64 string groups, itersString, outputForm, treefile, groupfile, namefile;
65 vector<string> Groups, outputNames; //holds groups to be used
66 int processors, numUniquesInName;
68 map<string, string> nameMap;
70 void printWSummaryFile();
71 void printWeightedFile();
72 void createPhylipFile();
73 //void removeValidScoresDuplicates();
74 int findIndex(float, int);
75 void calculateFreqsCumuls();
76 int createProcesses(Tree*, vector< vector<string> >, vector< vector<double> >&);
77 int driver(Tree*, vector< vector<string> >, int, int, vector< vector<double> >&);