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"
18 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;
19 string refName, queryName, sequence;
21 int weight, matches, mismatches, total;
24 AA=0; AT=0; AG=0; AC=0;
25 TA=0; TT=0; TG=0; TC=0;
26 GA=0; GT=0; GG=0; GC=0;
27 CA=0; CT=0; CG=0; CC=0;
28 NA=0; NT=0; NG=0; NC=0;
29 Ai=0; Ti=0; Gi=0; Ci=0; Ni=0;
30 dA=0; dT=0; dG=0; dC=0;
42 class SeqErrorCommand : public Command {
44 SeqErrorCommand(string);
48 vector<string> setParameters();
49 string getCommandName() { return "seq.error"; }
50 string getCommandCategory() { return "Sequence Processing"; }
51 string getHelpString();
52 string getCitation() { return "http://www.mothur.org/wiki/Seq.error"; }
53 string getDescription() { return "seq.error"; }
57 void help() { m->mothurOut(getHelpString()); }
63 unsigned long int start;
64 unsigned long int end;
65 linePair(unsigned long int i, unsigned long int j) : start(i), end(j) {}
68 vector<int> processIDS; //processid
69 vector<linePair> lines;
70 vector<linePair> qLines;
71 vector<linePair> rLines;
74 map<string,int> getWeights();
75 Compare getErrors(Sequence, Sequence);
76 void printErrorHeader(ofstream&);
77 void printErrorData(Compare, int, ofstream&, ofstream&);
78 void printSubMatrix();
79 void printErrorFRFile(map<char, vector<int> >, map<char, vector<int> >);
80 void printErrorQuality(map<char, vector<int> >);
81 void printQualityFR(vector<vector<int> >, vector<vector<int> >);
83 int setLines(string, string, string, vector<unsigned long int>&, vector<unsigned long int>&, vector<unsigned long int>&);
84 int driver(string, string, string, string, string, string, linePair, linePair, linePair);
85 int createProcesses(string, string, string, string, string, string);
87 string queryFileName, referenceFileName, qualFileName, reportFileName, namesFileName, outputDir;
90 int numRefs, processors;
91 int maxLength, totalBases, totalMatches;
92 //ofstream errorSummaryFile, errorSeqFile;
93 vector<string> outputNames;
95 vector<Sequence> referenceSeqs;
96 vector<vector<int> > substitutionMatrix;
97 vector<vector<int> > qualForwardMap;
98 vector<vector<int> > qualReverseMap;
99 vector<int> misMatchCounts;
100 map<char, vector<int> > qScoreErrorMap;
101 map<char, vector<int> > errorForward;
102 map<char, vector<int> > errorReverse;
103 map<string, int> weights;
104 vector<string> megaAlignVector;