]> git.donarmstrong.com Git - mothur.git/blob - trimseqscommand.h
added pipeline commands which involved change to command factory and command class...
[mothur.git] / trimseqscommand.h
1 #ifndef TRIMSEQSCOMMAND_H
2 #define TRIMSEQSCOMMAND_H
3
4 /*
5  *  trimseqscommand.h
6  *  Mothur
7  *
8  *  Created by Pat Schloss on 6/6/09.
9  *  Copyright 2009 Patrick D. Schloss. All rights reserved.
10  *
11  */
12
13 #include "mothur.h"
14 #include "command.hpp"
15 #include "sequence.hpp"
16 #include "qualityscores.h"
17
18 class TrimSeqsCommand : public Command {
19 public:
20         TrimSeqsCommand(string);
21         TrimSeqsCommand();
22         ~TrimSeqsCommand();
23         vector<string> getRequiredParameters();
24         vector<string> getValidParameters();
25         vector<string> getRequiredFiles();
26         map<string, vector<string> > getOutputFiles() { return outputTypes; }
27         int execute();
28         void help();
29         
30 private:
31
32         struct linePair {
33                 unsigned long int start;
34                 unsigned long int end;
35                 linePair(unsigned long int i, unsigned long int j) : start(i), end(j) {}
36         };
37
38         void getOligos(vector<string>&, vector<string>&);
39         int stripBarcode(Sequence&, QualityScores&, int&);
40         int stripForward(Sequence&, QualityScores&, int&);
41         bool stripReverse(Sequence&, QualityScores&);
42         bool cullLength(Sequence&);
43         bool cullHomoP(Sequence&);
44         bool cullAmbigs(Sequence&);
45         bool compareDNASeq(string, string);
46         int countDiffs(string, string);
47         map<string, vector<string> > outputTypes;
48
49         bool abort;
50         string fastaFile, oligoFile, qFileName, outputDir;
51         
52         bool flip, allFiles, qtrim;
53         int numFPrimers, numRPrimers, maxAmbig, maxHomoP, minLength, maxLength, processors, tdiffs, bdiffs, pdiffs, comboStarts;
54         int qWindowSize, qWindowStep;
55         double qRollAverage, qThreshold, qWindowAverage, qAverage;
56         vector<string> revPrimer, outputNames;
57         set<string> filesToRemove;
58         map<string, int> barcodes;
59         vector<string> groupVector;
60         map<string, int> primers;
61         map<string, int> combos;
62         
63         vector<int> processIDS;   //processid
64         vector<linePair*> lines;
65         vector<linePair*> qLines;
66         
67         int driverCreateTrim(string, string, string, string, string, string, string, vector<string>, vector<string>, linePair*, linePair*);     
68         int createProcessesCreateTrim(string, string, string, string, string, string, string, vector<string>, vector<string>);
69         int setLines(string, string, vector<unsigned long int>&, vector<unsigned long int>&);
70         
71 };
72
73 #endif