]> git.donarmstrong.com Git - mothur.git/blob - classifyseqscommand.h
added pipeline commands which involved change to command factory and command class...
[mothur.git] / classifyseqscommand.h
1 #ifndef CLASSIFYSEQSCOMMAND_H
2 #define CLASSIFYSEQSCOMMAND_H
3
4 /*
5  *  classifyseqscommand.h
6  *  Mothur
7  *
8  *  Created by westcott on 11/2/09.
9  *  Copyright 2009 Schloss Lab. All rights reserved.
10  *
11  */
12
13 #include "mothur.h"
14 #include "command.hpp"
15 //#include "alignment.hpp"
16 #include "classify.h"
17
18 //KNN and Bayesian methods modeled from algorithms in
19 //Naı¨ve Bayesian Classifier for Rapid Assignment of rRNA Sequences 
20 //into the New Bacterial Taxonomy􏰎† 
21 //Qiong Wang,1 George M. Garrity,1,2 James M. Tiedje,1,2 and James R. Cole1* 
22 //Center for Microbial Ecology1 and Department of Microbiology and Molecular Genetics,2 Michigan State University, 
23 //East Lansing, Michigan 48824 
24 //Received 10 January 2007/Accepted 18 June 2007 
25
26
27
28 class ClassifySeqsCommand : public Command {
29         
30 public:
31         ClassifySeqsCommand(string);
32         ClassifySeqsCommand();
33         ~ClassifySeqsCommand();
34         vector<string> getRequiredParameters();
35         vector<string> getValidParameters();
36         vector<string> getRequiredFiles();
37         map<string, vector<string> > getOutputFiles() { return outputTypes; }
38         int execute(); 
39         void help();    
40         
41 private:
42         struct linePair {
43                 unsigned long int start;
44                 unsigned long int end;
45                 linePair(unsigned long int i, unsigned long int j) : start(i), end(j) {}
46         };
47
48         vector<int> processIDS;   //processid
49         vector<linePair*> lines;
50         vector<string> fastaFileNames;
51         vector<string> namefileNames;
52         vector<string> groupfileNames;
53         vector<string> outputNames;
54         map<string, vector<string> > nameMap;
55         map<string,  vector<string> >::iterator itNames;
56         map<string, vector<string> > outputTypes;
57         
58         Classify* classify;
59         
60         string fastaFileName, templateFileName, distanceFileName, namefile, search, method, taxonomyFileName, outputDir, groupfile;
61         int processors, kmerSize, numWanted, cutoff, iters;
62         float match, misMatch, gapOpen, gapExtend;
63         bool abort, probs;
64         
65         int driver(linePair*, string, string, string);
66         void appendTaxFiles(string, string);
67         int createProcesses(string, string, string); 
68         string addUnclassifieds(string, int);
69         
70         int MPIReadNamesFile(string);
71         #ifdef USE_MPI
72         int driverMPI(int, int, MPI_File&, MPI_File&, MPI_File&, vector<unsigned long int>&);
73         #endif
74 };
75
76 #endif
77