X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=subsample.h;h=fdf8576f1950c0a27665a190eee1c3a9ddb09b6b;hp=55abed9adae227e72713a9b1ed083d5731dc3be2;hb=1a20e24ee786195ab0e1cccd4f5aede7a88f3f4e;hpb=6c2b1e530a5c0bb87040e58a3e410097acdfcc3d diff --git a/subsample.h b/subsample.h index 55abed9..fdf8576 100644 --- a/subsample.h +++ b/subsample.h @@ -15,6 +15,14 @@ #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. @@ -28,6 +36,8 @@ class 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*, 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: