]> git.donarmstrong.com Git - mothur.git/blobdiff - rarefactsharedcommand.h
added modify names parameter to set.dir
[mothur.git] / rarefactsharedcommand.h
index 2f7920e922cf8509487aa2ae7a3060075b0e90cd..4f08d00d7332ae32824464b809744042bd997d7f 100644 (file)
  */
 
 #include "command.hpp"
-#include "sharedordervector.h"
-#include "sharedlistvector.h"
 #include "inputdata.h"
 #include "rarefact.h"
 #include "display.h"
-#include "readmatrix.hpp"
 #include "validcalculator.h"
-#include "sharedutilities.h"
-
-/* The rarefaction.shared() command:
-       The rarefaction command generates a rarefaction curve from a given file representing several groups.  
-       The rarefaction.shared command can only be executed after a successful read.shared command. It outputs a file for each estimator you choose to use.  
-       The rarefaction.shared command parameters are label, line, iters, jumble and sharedrarefaction.  
-       No parameters are required, but you may not use both the line and label  parameters at the same time.  
-       The rarefaction command should be in the following format: rarefaction.shared(label=yourLabel, line=yourLines, iters=yourIters, 
-       jumble= yourJumble, sharedrarefaction=yourEstimators).  Example rarefaction.shared(label=unique-.01-.03, line=0,5,10, iters=10000, 
-       jumble=1, sharedrarefaction =sharedobserved).  The default values for jumble is 0 (meaning don’t jumble, if it’s set to 1 then it will jumble), 
-       iters is 1000 and sharedrarefaction is sharedobserved which calculates the shared rarefaction curve for the observed richness. 
-        The valid sharedrarefaction estimator is sharedobserved. The label and line parameters are used to analyze specific lines in your input. */
-
-
-class GlobalData;
 
 class RareFactSharedCommand : public Command {
        
 public:
-       RareFactSharedCommand();        
-       ~RareFactSharedCommand();
-       int execute();  
+       RareFactSharedCommand(string);
+       RareFactSharedCommand();
+       ~RareFactSharedCommand() {}
+       
+       vector<string> setParameters();
+       string getCommandName()                 { return "rarefaction.shared";          }
+       string getCommandCategory()             { return "OTU-Based Approaches";        }
+       
+       string getHelpString(); 
+    string getOutputPattern(string);   
+       string getCitation() { return "Magurran AE (2004). Measuring biological diversity. Blackwell Pub.: Malden, Ma. \nhttp://www.mothur.org/wiki/Rarefaction.shared"; }
+       string getDescription()         { return "generate inter-sample rarefaction curves using a re-sampling without replacement approach"; }
+
+       int execute(); 
+       void help() { m->mothurOut(getHelpString()); }  
+       
        
 private:
-       GlobalData* globaldata;
-       SharedUtil* util;
-       SharedListVector* SharedList;
-       ReadMatrix* read;
-       SharedOrderVector* order;
-       InputData* input;
-       ValidCalculators* validCalculator;
-       Rarefact* rCurve;
-       vector<Display*> rDisplays;
-       int freq, nIters;
+       
+       vector<SharedRAbundVector*> lookup;
+       int nIters, subsampleSize, iters;
        string format;
+       float freq;
+       
+     map<int, string> file2Group; //index in outputNames[i] -> group
+       bool abort, allLines, jumble, groupMode, subsample;
+       set<string> labels; //holds labels to be used
+       string label, calc, groups, outputDir, sharedfile, designfile;
+       vector<string>  Estimators, Groups, outputNames, Sets;
+    
+    int process(GroupMap&, string);
+    vector<string> createGroupFile(vector<string>&);
+    int subsampleLookup(vector<SharedRAbundVector*>&, string);
 
 };