File: diversityestimatorcommand.hpp

package info (click to toggle)
mothur 1.48.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,676 kB
  • sloc: cpp: 161,854; makefile: 119; sh: 31
file content (65 lines) | stat: -rw-r--r-- 2,402 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
//  diversityestimatorcommand.hpp
//  Mothur
//
//  Created by Sarah Westcott on 4/4/19.
//  Copyright © 2019 Schloss Lab. All rights reserved.
//

#ifndef diversityestimatorcommand_hpp
#define diversityestimatorcommand_hpp

#include "command.hpp"
#include "inputdata.h"
#include "validcalculator.h"


//******************************************************

class EstimatorSingleCommand : public Command {
public:
    EstimatorSingleCommand(string);
    ~EstimatorSingleCommand(){}
    
    vector<string> setParameters();
    string getCommandName()			{ return "estimator.single";            }
    string getCommandCategory()		{ return "OTU-Based Approaches";		}
    
    string getHelpString();
    string getCommonQuestions();
    string getOutputPattern(string);
    string getCitation() { return "http://www.mothur.org/wiki/Estimator.single"; }
    string getDescription()		{ return "This command implements the diversity estimators from https://github.com/chrisquince/DiversityEstimates. https://www.ncbi.nlm.nih.gov/pubmed/18650928"; }
    
    int execute();
    void help() { m->mothurOut(getHelpString()); }
    
private:
    
    bool abort, allLines, burnSampleSet, burnSet, createSampling, itersSet;
    string label, calc,  sharedfile, listfile, rabundfile, sabundfile, format, inputfile, samplefile;
    double freq, sigmaAlpha, sigmaBeta, sigmaS, sigmaN, coverage;
    int iters, burn, burnSample, fitIters;
    vector<string> outputNames;
    set<string> labels; //holds labels to be used
    vector<string> groups, rarefactCalcs, abundCalcs, smallBurn;
    map<string, vector<mcmcSample> > sampling;
    map<string, vector<mcmcSample> > ::iterator it;
    set<string> samplingCalcs;
    map<string, string> calcToSamplingCalc;
    map<string, string> ::iterator itCalcSample;
    
    int fillSampling(int, int, bool filldNu=false);
    int processSingleSample();
    int processSharedFile();
    int processShared(SharedRAbundVectors*& shared, vector<ofstream*>& out, string fileRoot);
    int processSingle(SAbundVector*&, string, vector<ofstream*>&, string);
    
    int runRarefactCalcs(int numSeqs, string groupName, ofstream& out);
    vector<string> runSamplingCalcs(SAbundVector*&, string);
    vector<double> runAbundCalcs(SAbundVector*&, string groupName);
    
};
//*******************************************************

#endif /* diversityestimatorcommand_hpp */