X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=lefsecommand.h;h=cb1bbb6da80f7da1567979dd158fb5861e74a685;hp=095ad48da125fbfe83f30aaff41eb62ec18c610f;hb=d1c97b8c04bb75faca1e76ffad60b37a4d789d3d;hpb=ad4f75fd7c938090d3b1ce4cfefcc21edf1869eb diff --git a/lefsecommand.h b/lefsecommand.h index 095ad48..cb1bbb6 100644 --- a/lefsecommand.h +++ b/lefsecommand.h @@ -12,7 +12,7 @@ #include "command.hpp" /* - Columns = groups, rows are OTUs, class = design?? + Columns = groups, rows are OTUs, class = design From http://huttenhower.sph.harvard.edu/galaxy/root?tool_id=lefse_upload Input data consist of a collection of m samples (columns) each made up of n numerical features (rows, typically normalized per-sample, red representing high values and green low). These samples are labeled with a class (taking two or more possible values) that represents the main biological hypothesis under investigation; they may also have one or more subclass labels reflecting within-class groupings. @@ -22,4 +22,58 @@ Step 3: the resulting subset of vectors is used to build a Linear Discriminant Analysis model from which the relative difference among classes is used to rank the features. The final output thus consists of a list of features that are discriminative with respect to the classes, consistent with the subclass grouping within classes, and ranked according to the effect size with which they differentiate classes. */ + +#include "command.hpp" +#include "inputdata.h" +#include "designmap.h" + +/**************************************************************************************************/ + +class LefseCommand : public Command { +public: + LefseCommand(string); + LefseCommand(); + ~LefseCommand(){} + + vector setParameters(); + string getCommandName() { return "lefse"; } + string getCommandCategory() { return "OTU-Based Approaches"; } + + string getOutputPattern(string); + string getHelpString(); + string getCitation() { return "Segata, N., J. Izard, L. Waldron, D. Gevers, L. Miropolsky, W. S. Garrett, and C. Huttenhower. 2011. Metagenomic biomarker discovery and explanation. Genome Biol 12:R60, http://www.mothur.org/wiki/Lefse"; } + string getDescription() { return "brief description"; } + + int execute(); + void help() { m->mothurOut(getHelpString()); } + +private: + bool abort, allLines, wilc, wilcsamename, curv, subject, normMillion; + string outputDir, sharedfile, designfile, mclass, subclass, rankTec, multiClassStrat; + vector outputNames; + set labels; + double anovaAlpha, wilcoxonAlpha, fBoots, ldaThreshold; + int nlogs, iters, strict, minC; + + int process(vector&, DesignMap&); + int normalize(vector&); + map runKruskalWallis(vector&, DesignMap&); + map runWilcoxon(vector&, DesignMap&, map, map >& class2SubClasses, map >& subClass2GroupIndex, map); + bool testOTUWilcoxon(map >& class2SubClasses, vector abunds, map >& subClass2GroupIndex, map); + map testLDA(vector&, map, map >& class2GroupIndex, map >&); + bool contastWithinClassesOrFewPerClass(vector< vector >&, vector rands, int minCl, map > class2GroupIndex, map indexToClass); + vector< vector > lda(vector< vector >& adjustedLookup, vector rand_s, map& indexToClass, vector); + vector< vector > getMeans(vector& lookup, map >& class2GroupIndex); + int printResults(vector< vector >, map, map, string, vector); + + //for testing + bool printToCoutForRTesting(vector< vector >& adjustedLookup, vector rand_s, map >& class2GroupIndex, map bins, map >&, vector); + int makeShared(int); +}; + +/**************************************************************************************************/ + + + + #endif /* defined(__Mothur__lefsecommand__) */