]> git.donarmstrong.com Git - mothur.git/blob - subsample.h
Merge remote-tracking branch 'mothur/master'
[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
17 //subsampling overwrites the sharedRabunds.  If you need to reuse the original use the getSamplePreserve function.
18
19 class SubSample {
20         
21     public:
22     
23         SubSample() { m = MothurOut::getInstance(); }
24         ~SubSample() {}
25     
26         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.
27         
28         Tree* getSample(Tree*, TreeMap*, map<string, string>, int); //creates new subsampled tree, destroys treemap so copy if needed.
29     
30     private:
31     
32         MothurOut* m;
33         int eliminateZeroOTUS(vector<SharedRAbundVector*>&);
34     
35         vector<string> getSample(TreeMap*, int); //returns map contains names of seqs in subsample -> group. 
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