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"
23 class UnifracWeightedCommand : public Command {
26 UnifracWeightedCommand();
27 ~UnifracWeightedCommand() { delete weighted; delete util; }
31 GlobalData* globaldata;
34 vector<Tree*> T; //user trees
35 vector<double> utreeScores; //user tree unweighted scores
36 vector<double> WScoreSig; //tree weighted score signifigance when compared to random trees - percentage of random trees with that score or lower.
37 vector<string> groupComb; // AB. AC, BC...
38 Tree* randT; //random tree
42 int iters, numGroups, numComp, counter;
43 EstOutput userData; //weighted score info for user tree
44 EstOutput randomData; //weighted score info for random trees
45 vector< vector<double> > rScores; //vector<weighted scores for random trees.> each group comb has an entry
46 vector< vector<double> > uScores; //vector<weighted scores for user trees.> each group comb has an entry
47 vector< map<float, float> > rScoreFreq; //map <weighted score, number of random trees with that score.> -vector entry for each combination.
48 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
49 map<float, float> validScores; //map contains scores from random
50 map<float, float>::iterator it2;
51 map<float, float>::iterator it;
56 void printWSummaryFile();
57 void printWeightedFile();
58 //void removeValidScoresDuplicates();
59 int findIndex(float, int);
60 void calculateFreqsCumuls();