]> git.donarmstrong.com Git - mothur.git/blob - subsample.h
major change to the tree class to use the count table class instead of tree map....
[mothur.git] / subsample.h
1 #ifndef Mothur_subsample_h
2 #define Mothur_subsample_h
3
4 //
5 //  subsample.h
6 //  Mothur
7 //
8 //  Created by Sarah Westcott on 4/2/12.
9 //  Copyright (c) 2012 Schloss Lab. All rights reserved.
10 //
11
12 #include "mothurout.h"
13 #include "sharedrabundvector.h"
14 #include "treemap.h"
15 #include "tree.h"
16 #include "counttable.h"
17
18
19 //subsampling overwrites the sharedRabunds.  If you need to reuse the original use the getSamplePreserve function.
20
21 class SubSample {
22         
23     public:
24     
25         SubSample() { m = MothurOut::getInstance(); }
26         ~SubSample() {}
27     
28         vector<string> getSample(vector<SharedRAbundVector*>&, int); //returns the bin labels for the subsample, mothurOuts binlabels are preserved so you can run this multiple times. Overwrites original vector passed in, if you need to preserve it deep copy first.
29         Tree* getSample(Tree*, CountTable*, CountTable*, int); //creates new subsampled tree. Uses first counttable to fill new counttable with sabsampled seqs. Sets groups of seqs not in subsample to "doNotIncludeMe".
30         int getSample(SAbundVector*&, int); //destroys sabundvector passed in, so copy it if you need it
31     
32     private:
33     
34         MothurOut* m;
35         int eliminateZeroOTUS(vector<SharedRAbundVector*>&);
36          map<string, string> deconvolute(map<string, string> wholeSet, vector<string>& subsampleWanted); //returns new nameMap containing only subsampled names, and removes redundants from subsampled wanted because it makes the new nameMap.
37
38
39 };
40
41 #endif