X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=subsample.h;h=fdf8576f1950c0a27665a190eee1c3a9ddb09b6b;hp=ef5c389a938820a61201d83629efc6b27c5237d8;hb=1a20e24ee786195ab0e1cccd4f5aede7a88f3f4e;hpb=e98d56be8369a799e61a411bc13d3bd1fa3451e5 diff --git a/subsample.h b/subsample.h index ef5c389..fdf8576 100644 --- a/subsample.h +++ b/subsample.h @@ -13,6 +13,16 @@ #include "sharedrabundvector.h" #include "treemap.h" #include "tree.h" +#include "counttable.h" + +struct item { + string name; + string group; + + item() {} + item(string n, string g) : name(n), group(g) {} + ~item() {} +}; //subsampling overwrites the sharedRabunds. If you need to reuse the original use the getSamplePreserve function. @@ -24,18 +34,16 @@ class SubSample { ~SubSample() {} vector getSample(vector&, 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. - - Tree* getSample(Tree*, TreeMap*, map, int); //creates new subsampled tree, destroys treemap so copy if needed. - Tree* getSample(Tree*, TreeMap*, map, int, map); //creates new subsampled tree, destroys treemap so copy if needed. + 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". + int getSample(SAbundVector*&, int); //destroys sabundvector passed in, so copy it if you need it + CountTable getSample(CountTable&, int, vector); //subsample a countTable bygroup(same number sampled from each group, returns subsampled countTable + CountTable getSample(CountTable&, int, vector, bool); //subsample a countTable. If you want to only sample from specific groups, pass in groups in the vector and set bool=true, otherwise set bool=false. private: MothurOut* m; int eliminateZeroOTUS(vector&); - - vector getSample(TreeMap*, vector); - vector getSample(TreeMap*, int); //names of seqs to include in sample tree - map deconvolute(map wholeSet, vector& subsampleWanted); //returns new nameMap containing only subsampled names, and removes redundants from subsampled wanted because it makes the new nameMap. + map deconvolute(map wholeSet, vector& subsampleWanted); //returns new nameMap containing only subsampled names, and removes redundants from subsampled wanted because it makes the new nameMap. };