File: classifysvmsharedcommand.h

package info (click to toggle)
mothur 1.48.5-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 13,684 kB
  • sloc: cpp: 161,854; makefile: 122; sh: 31
file content (85 lines) | stat: -rwxr-xr-x 2,485 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//
//  classifysvmsharedcommand.h
//  Mothur
//
//  Created by Joshua Lynch on 6/28/2013.
//  Copyright (c) 2013 Schloss Lab. All rights reserved.
//
//  This class is based on ClassifySharedCommand
//

#ifndef __Mothur__classifysvmsharedcommand__
#define __Mothur__classifysvmsharedcommand__

#include "command.hpp"
#include "inputdata.h"
#include "svm.hpp"
#include "designmap.h"

class ClassifySvmSharedCommand : public Command {
public:
  
  ClassifySvmSharedCommand(string);
  ~ClassifySvmSharedCommand() = default;;
  
  vector<string> setParameters();
  string getCommandName()			{ return "classify.svm";     }
  string getCommandCategory()		{ return "OTU-Based Approaches";		}  
  string getHelpString();	
  string getOutputPattern(string);
  string getCitation()              { return "http://www.mothur.org/wiki/Classify.svm\n"; }
  string getDescription()		    { return "implements the support vector machine machine learning algorithm to identify OTUs that can be used to differentiate between various groups of samples"; }
  int execute();
  
  void help() { m->mothurOut(getHelpString()); }

  void readSharedAndDesignFiles(const string&, const string&, LabeledObservationVector&, FeatureVector&);
  void readSharedRAbundVectors(vector<SharedRAbundVector*>&, DesignMap&, LabeledObservationVector&, FeatureVector&, vector<string>);

  vector<double>& getSmocList() { return smocList; }
  const KernelParameterRangeMap& getKernelParameterRangeMap() { return kernelParameterRangeMap; }

private:
    bool abort;
    vector<string> outputNames, Groups;

    string sharedfile, designfile;
    set<string> labels;
    bool allLines;

    int processors;
    bool useTiming;

    DesignMap designMap;
    
    // mode is either "rfe" or "classify"
    string mode;

    int evaluationFoldCount;
    int trainingFoldCount;
    vector<double> smocList;
    KernelParameterRangeMap kernelParameterRangeMap;

    string transformName;

    int verbosity;

    double stdthreshold;


    void processSharedAndDesignData(vector<SharedRAbundVector*> lookup, vector<string>);
    void trainSharedAndDesignData(vector<SharedRAbundVector*> lookup, vector<string>);

    void getParameterValue(int& target, string pstring, int defaultvalue) {
        if (pstring == "not found" or pstring == "") {
            target = defaultvalue;
        }
        else {
            util.mothurConvert(pstring, target);
        }
    }


};

#endif /* defined(__Mothur__classifysvmsharedcommand__) */