]> git.donarmstrong.com Git - mothur.git/blob - classifyseqscommand.h
added save parameter to align.seqs, chimera commands, classify.seqs, and seq.error...
[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 "classify.h"
16 #include "referencedb.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         
35         vector<string> setParameters();
36         string getCommandName()                 { return "classify.seqs";               }
37         string getCommandCategory()             { return "Phylotype Analysis";  }
38         string getHelpString(); 
39         string getCitation() { return "Wang Q, Garrity GM, Tiedje JM, Cole JR (2007). Naive Bayesian classifier for rapid assignment of rRNA sequences into the new bacterial taxonomy. Appl Environ Microbiol 73: 5261-7. [ for Bayesian classifier ] \nAltschul SF, Madden TL, Schaffer AA, Zhang J, Zhang Z, Miller W, Lipman DJ (1997). Gapped BLAST and PSI-BLAST: a new generation of protein database search programs. Nucleic Acids Res 25: 3389-402. [ for BLAST ] \nDeSantis TZ, Hugenholtz P, Larsen N, Rojas M, Brodie EL, Keller K, Huber T, Dalevi D, Hu P, Andersen GL (2006). Greengenes, a chimera-checked 16S rRNA gene database and workbench compatible with ARB. Appl Environ Microbiol 72: 5069-72. [ for kmer ] \nhttp://www.mothur.org/wiki/Classify.seqs"; }
40         string getDescription()         { return "classify sequences"; }
41         
42         int execute(); 
43         void help() { m->mothurOut(getHelpString()); }  
44         
45         
46         
47 private:
48         struct linePair {
49                 unsigned long int start;
50                 unsigned long int end;
51                 linePair(unsigned long int i, unsigned long int j) : start(i), end(j) {}
52         };
53
54         vector<int> processIDS;   //processid
55         vector<linePair*> lines;
56         vector<string> fastaFileNames;
57         vector<string> namefileNames;
58         vector<string> groupfileNames;
59         vector<string> outputNames;
60         map<string, vector<string> > nameMap;
61         map<string,  vector<string> >::iterator itNames;
62         
63         Classify* classify;
64         ReferenceDB* rdb;
65         
66         string fastaFileName, templateFileName, distanceFileName, namefile, search, method, taxonomyFileName, outputDir, groupfile;
67         int processors, kmerSize, numWanted, cutoff, iters;
68         float match, misMatch, gapOpen, gapExtend;
69         bool abort, probs, save;
70         
71         int driver(linePair*, string, string, string);
72         void appendTaxFiles(string, string);
73         int createProcesses(string, string, string); 
74         string addUnclassifieds(string, int);
75         
76         int MPIReadNamesFile(string);
77         #ifdef USE_MPI
78         int driverMPI(int, int, MPI_File&, MPI_File&, MPI_File&, vector<unsigned long int>&);
79         #endif
80 };
81
82 #endif
83