]> git.donarmstrong.com Git - mothur.git/blob - trimseqscommand.h
added citation function to commands
[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         
31         int execute(); 
32         void help() { m->mothurOut(getHelpString()); }  
33         
34 private:
35         
36         GroupMap* groupMap;
37         
38         struct linePair {
39                 unsigned long int start;
40                 unsigned long int end;
41                 linePair(unsigned long int i, unsigned long int j) : start(i), end(j) {}
42         };
43         
44         void getOligos(vector<vector<string> >&, vector<vector<string> >&);
45         int stripBarcode(Sequence&, QualityScores&, int&);
46         int stripForward(Sequence&, QualityScores&, int&);
47         bool stripReverse(Sequence&, QualityScores&);
48         
49         bool keepFirstTrim(Sequence&, QualityScores&);
50         bool removeLastTrim(Sequence&, QualityScores&);
51
52         bool cullLength(Sequence&);
53         bool cullHomoP(Sequence&);
54         bool cullAmbigs(Sequence&);
55         bool compareDNASeq(string, string);
56         int countDiffs(string, string);
57
58         bool abort;
59         string fastaFile, oligoFile, qFileName, groupfile, outputDir;
60         
61         bool flip, allFiles, qtrim;
62         int numFPrimers, numRPrimers, maxAmbig, maxHomoP, minLength, maxLength, processors, tdiffs, bdiffs, pdiffs, comboStarts;
63         int qWindowSize, qWindowStep, keepFirst, removeLast;
64         double qRollAverage, qThreshold, qWindowAverage, qAverage;
65         vector<string> revPrimer, outputNames;
66         set<string> filesToRemove;
67         map<string, int> barcodes;
68         vector<string> groupVector;
69         map<string, int> primers;
70         map<string, int> combos;
71         map<string, int> groupToIndex;
72         vector<string> primerNameVector;        //needed here?
73         vector<string> barcodeNameVector;       //needed here?
74         map<string, int> groupCounts;  
75
76         vector<int> processIDS;   //processid
77         vector<linePair*> lines;
78         vector<linePair*> qLines;
79         
80         int driverCreateTrim(string, string, string, string, string, string, string, vector<vector<string> >, vector<vector<string> >, linePair*, linePair*);   
81         int createProcessesCreateTrim(string, string, string, string, string, string, string, vector<vector<string> >, vector<vector<string> >);
82         int setLines(string, string, vector<unsigned long int>&, vector<unsigned long int>&);
83 };
84
85 #endif