X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=subsample.h;h=fdf8576f1950c0a27665a190eee1c3a9ddb09b6b;hp=9156e094f9706426fa50d3d9b7e664494e839485;hb=1a20e24ee786195ab0e1cccd4f5aede7a88f3f4e;hpb=53171f07cc0c0e560e2b4ba2946f690d59fc2dc4 diff --git a/subsample.h b/subsample.h index 9156e09..fdf8576 100644 --- a/subsample.h +++ b/subsample.h @@ -11,6 +11,18 @@ #include "mothurout.h" #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. @@ -21,14 +33,18 @@ class SubSample { SubSample() { m = MothurOut::getInstance(); } ~SubSample() {} - vector getSample(vector&, int); //returns the bin labels for the subsample, mothurOuts binlabels are preserved so you can run this multiple times. - - vector getSamplePreserve(vector&, vector&, int); + 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: MothurOut* m; int eliminateZeroOTUS(vector&); + 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. + };