]> git.donarmstrong.com Git - mothur.git/blob - trimseqscommand.h
changed normalize.shared and sub.sample commands to fix bug in normalize.shared and...
[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 #include "groupmap.h"
18
19 class TrimSeqsCommand : public Command {
20 public:
21         TrimSeqsCommand(string);
22         TrimSeqsCommand();
23         ~TrimSeqsCommand(){}
24         
25         vector<string> setParameters();
26         string getCommandName()                 { return "trim.seqs";   }
27         string getCommandCategory()             { return "Sequence Processing";         }
28         string getHelpString(); 
29         string getCitation() { return "http://www.mothur.org/wiki/Trim.seqs"; }
30         string getDescription()         { return "provides the preprocessing features needed to screen and sort pyrosequences"; }
31
32         int execute(); 
33         void help() { m->mothurOut(getHelpString()); }  
34         
35 private:
36         
37         GroupMap* groupMap;
38         
39         struct linePair {
40                 unsigned long int start;
41                 unsigned long int end;
42                 linePair(unsigned long int i, unsigned long int j) : start(i), end(j) {}
43         };
44         
45         bool getOligos(vector<vector<string> >&, vector<vector<string> >&, vector<vector<string> >&);
46         int stripBarcode(Sequence&, QualityScores&, int&);
47         int stripForward(Sequence&, QualityScores&, int&);
48         bool stripReverse(Sequence&, QualityScores&);
49         
50         bool keepFirstTrim(Sequence&, QualityScores&);
51         bool removeLastTrim(Sequence&, QualityScores&);
52
53         bool cullLength(Sequence&);
54         bool cullHomoP(Sequence&);
55         bool cullAmbigs(Sequence&);
56         bool compareDNASeq(string, string);
57         int countDiffs(string, string);
58
59         bool abort, createGroup;
60         string fastaFile, oligoFile, qFileName, groupfile, nameFile, outputDir;
61         
62         bool flip, allFiles, qtrim;
63         int numFPrimers, numRPrimers, maxAmbig, maxHomoP, minLength, maxLength, processors, tdiffs, bdiffs, pdiffs, comboStarts;
64         int qWindowSize, qWindowStep, keepFirst, removeLast;
65         double qRollAverage, qThreshold, qWindowAverage, qAverage;
66         vector<string> revPrimer, outputNames;
67         set<string> filesToRemove;
68         map<string, int> barcodes;
69         vector<string> groupVector;
70         map<string, int> primers;
71         map<string, int> combos;
72         map<string, int> groupToIndex;
73         vector<string> primerNameVector;        //needed here?
74         vector<string> barcodeNameVector;       //needed here?
75         map<string, int> groupCounts;  
76         map<string, string> nameMap;
77
78         vector<int> processIDS;   //processid
79         vector<linePair*> lines;
80         vector<linePair*> qLines;
81         
82         int driverCreateTrim(string, string, string, string, string, string, string, string, string, vector<vector<string> >, vector<vector<string> >, vector<vector<string> >, linePair*, linePair*);  
83         int createProcessesCreateTrim(string, string, string, string, string, string, string, string, string, vector<vector<string> >, vector<vector<string> >, vector<vector<string> >);
84         int setLines(string, string, vector<unsigned long int>&, vector<unsigned long int>&);
85 };
86
87 #endif