X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=subsample.h;h=fdf8576f1950c0a27665a190eee1c3a9ddb09b6b;hp=feca37eddbfbf42cd4d7674adea5a18ceed3acee;hb=1a20e24ee786195ab0e1cccd4f5aede7a88f3f4e;hpb=f6b5fea6e0fcc395235dfbfb466b9b6a031b540a diff --git a/subsample.h b/subsample.h index feca37e..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,19 +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*, TreeMap*, int, map); //creates new subsampled tree. Uses first treemap to fill new treemap with sabsampled seqs. Sets groups of seqs not in subsample to "doNotIncludeMe". + 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 - vector getSample(TreeMap* tMap, int size, map >& sample); //sample maps group -> seqs in group. seqs not in sample are in doNotIncludeMe group - 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. };