1 #ifndef SEQERRORCOMMAND
2 #define SEQERRORCOMMAND
8 * Created by Pat Schloss on 7/15/10.
9 * Copyright 2010 Schloss Lab. All rights reserved.
13 #include "command.hpp"
14 #include "sequence.hpp"
15 #include "referencedb.h"
18 class SeqErrorCommand : public Command {
20 SeqErrorCommand(string);
24 vector<string> setParameters();
25 string getCommandName() { return "seq.error"; }
26 string getCommandCategory() { return "Sequence Processing"; }
27 string getOutputFileNameTag(string, string);
28 string getHelpString();
29 string getCitation() { return "http://www.mothur.org/wiki/Seq.error"; }
30 string getDescription() { return "seq.error"; }
34 void help() { m->mothurOut(getHelpString()); }
41 unsigned long long start;
42 unsigned long long end;
43 linePair(unsigned long long i, unsigned long long j) : start(i), end(j) {}
48 int AA, AT, AG, AC, TA, TT, TG, TC, GA, GT, GG, GC, CA, CT, CG, CC, NA, NT, NG, NC, Ai, Ti, Gi, Ci, Ni, dA, dT, dG, dC;
49 string refName, queryName, sequence;
51 int weight, matches, mismatches, total;
54 AA=0; AT=0; AG=0; AC=0;
55 TA=0; TT=0; TG=0; TC=0;
56 GA=0; GT=0; GG=0; GC=0;
57 CA=0; CT=0; CG=0; CC=0;
58 NA=0; NT=0; NG=0; NC=0;
59 Ai=0; Ti=0; Gi=0; Ci=0; Ni=0;
60 dA=0; dT=0; dG=0; dC=0;
73 vector<int> processIDS; //processid
74 vector<linePair> lines;
75 vector<linePair> qLines;
76 vector<linePair> rLines;
79 map<string,int> getWeights();
80 int getErrors(Sequence, Sequence, Compare&);
81 void printErrorHeader(ofstream&);
82 void printErrorData(Compare, int, ofstream&, ofstream&);
83 void printSubMatrix();
84 void printErrorFRFile(map<char, vector<int> >, map<char, vector<int> >);
85 void printErrorQuality(map<char, vector<int> >);
86 void printQualityFR(vector<vector<int> >, vector<vector<int> >);
88 int setLines(string, string, string, vector<unsigned long long>&, vector<unsigned long long>&, vector<unsigned long long>&);
89 int driver(string, string, string, string, string, string, linePair, linePair, linePair);
90 int createProcesses(string, string, string, string, string, string);
92 string queryFileName, referenceFileName, qualFileName, reportFileName, namesFileName, outputDir;
94 bool ignoreChimeras, save;
95 int numRefs, processors;
96 int maxLength, totalBases, totalMatches;
97 //ofstream errorSummaryFile, errorSeqFile;
98 vector<string> outputNames;
100 vector<Sequence> referenceSeqs;
101 vector<vector<int> > substitutionMatrix;
102 vector<vector<int> > qualForwardMap;
103 vector<vector<int> > qualReverseMap;
104 vector<int> misMatchCounts;
105 map<char, vector<int> > qScoreErrorMap;
106 map<char, vector<int> > errorForward;
107 map<char, vector<int> > errorReverse;
108 map<string, int> weights;
109 vector<string> megaAlignVector;