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