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 getHelpString();
28 string getCitation() { return "http://www.mothur.org/wiki/Seq.error"; }
29 string getDescription() { return "seq.error"; }
33 void help() { m->mothurOut(getHelpString()); }
40 unsigned long long start;
41 unsigned long long end;
42 linePair(unsigned long long i, unsigned long long j) : start(i), end(j) {}
47 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;
48 string refName, queryName, sequence;
50 int weight, matches, mismatches, total;
53 AA=0; AT=0; AG=0; AC=0;
54 TA=0; TT=0; TG=0; TC=0;
55 GA=0; GT=0; GG=0; GC=0;
56 CA=0; CT=0; CG=0; CC=0;
57 NA=0; NT=0; NG=0; NC=0;
58 Ai=0; Ti=0; Gi=0; Ci=0; Ni=0;
59 dA=0; dT=0; dG=0; dC=0;
72 vector<int> processIDS; //processid
73 vector<linePair> lines;
74 vector<linePair> qLines;
75 vector<linePair> rLines;
78 map<string,int> getWeights();
79 int getErrors(Sequence, Sequence, Compare&);
80 void printErrorHeader(ofstream&);
81 void printErrorData(Compare, int, ofstream&, ofstream&);
82 void printSubMatrix();
83 void printErrorFRFile(map<char, vector<int> >, map<char, vector<int> >);
84 void printErrorQuality(map<char, vector<int> >);
85 void printQualityFR(vector<vector<int> >, vector<vector<int> >);
87 int setLines(string, string, string, vector<unsigned long long>&, vector<unsigned long long>&, vector<unsigned long long>&);
88 int driver(string, string, string, string, string, string, linePair, linePair, linePair);
89 int createProcesses(string, string, string, string, string, string);
91 string queryFileName, referenceFileName, qualFileName, reportFileName, namesFileName, outputDir;
93 bool ignoreChimeras, save;
94 int numRefs, processors;
95 int maxLength, totalBases, totalMatches;
96 //ofstream errorSummaryFile, errorSeqFile;
97 vector<string> outputNames;
99 vector<Sequence> referenceSeqs;
100 vector<vector<int> > substitutionMatrix;
101 vector<vector<int> > qualForwardMap;
102 vector<vector<int> > qualReverseMap;
103 vector<int> misMatchCounts;
104 map<char, vector<int> > qScoreErrorMap;
105 map<char, vector<int> > errorForward;
106 map<char, vector<int> > errorReverse;
107 map<string, int> weights;
108 vector<string> megaAlignVector;