]> 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         Tree* getSample(Tree*, TreeMap*, TreeMap*, int, map<string, string>); //creates new subsampled tree. Uses first treemap to fill new treemap with sabsampled seqs. Sets groups of seqs not in subsample to "doNotIncludeMe".
30     
31     private:
32     
33         MothurOut* m;
34         int eliminateZeroOTUS(vector<SharedRAbundVector*>&);
35     
36         vector<string> getSample(TreeMap*, vector<string>);
37         vector<string> getSample(TreeMap*, int); //names of seqs to include in sample tree 
38         vector<string> getSample(TreeMap* tMap, int size, map<string, vector<string> >& sample); //sample maps group -> seqs in group. seqs not in sample are in doNotIncludeMe group
39         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.
40
41
42 };
43
44 #endif