]> git.donarmstrong.com Git - mothur.git/blob - parsefastaqcommand.h
fixes while testing 1.33.0
[mothur.git] / parsefastaqcommand.h
1 #ifndef PARSEFASTAQCOMMAND_H
2 #define PARSEFASTAQCOMMAND_H
3
4 /*
5  *  parsefastaqcommand.h
6  *  Mothur
7  *
8  *  Created by westcott on 9/30/10.
9  *  Copyright 2010 Schloss Lab. All rights reserved.
10  *
11  */
12
13
14 #include "command.hpp"
15 #include "trimoligos.h"
16 #include "sequence.hpp"
17 #include "groupmap.h"
18
19 struct fastqRead2 {
20     string quality;
21         Sequence seq;
22     string wholeRead;
23         
24         fastqRead2() {  };
25         fastqRead2(Sequence s, string q, string w) : seq(s), quality(q), wholeRead(w){};
26         ~fastqRead2() {};
27 };
28
29
30 class ParseFastaQCommand : public Command {
31
32 public:
33         ParseFastaQCommand(string);
34         ParseFastaQCommand();
35         ~ParseFastaQCommand() {}
36         
37         vector<string> setParameters();
38         string getCommandName()                 { return "fastq.info";          }
39         string getCommandCategory()             { return "Sequence Processing"; }
40         
41         string getHelpString(); 
42     string getOutputPattern(string);    
43         string getCitation() { return "http://www.mothur.org/wiki/Parse.fastq"; }
44         string getDescription()         { return "reads a fastq file and creates a fasta and quality file"; }
45
46         
47         int execute(); 
48         void help() { m->mothurOut(getHelpString()); }          
49 private:
50
51         vector<string> outputNames;     
52         string outputDir, fastaQFile, format, oligosfile, groupfile;
53         bool abort, fasta, qual, pacbio, pairedOligos;
54     int pdiffs, bdiffs, ldiffs, sdiffs, tdiffs, split;
55     GroupMap* groupMap;
56     
57     //oligos file data structures
58     vector<string> linker, spacer, primerNameVector, barcodeNameVector, revPrimer;
59         map<string, int> barcodes;
60         map<string, int> primers;
61     map<int, oligosPair> pairedBarcodes;
62     map<int, oligosPair> pairedPrimers;
63     vector<vector<string> > fastqFileNames;
64     string noMatchFile;
65         
66         vector<int> convertQual(string);
67     vector<char> convertTable;
68     bool readOligos(string oligosFile);
69     bool readGroup(string oligosFile);
70     string reverseOligo(string oligo);
71     fastqRead2 readFastq(ifstream&, bool&);
72     int findGroup(fastqRead2, int&, int&, TrimOligos*&, int, int);
73     int findGroup(fastqRead2, int&, int&, string);
74     
75 };
76
77 #endif
78
79