X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=seqerrorcommand.h;h=aac17b6979910ebc733be840eb37ec720ecc1105;hp=590c554b25ec761a42ecc9593d3b6376b725f15e;hb=050a3ff02473a3d4c0980964e1a9ebe52e55d6b8;hpb=65b6a38d00b3a72021611211e7c25392022c69ed diff --git a/seqerrorcommand.h b/seqerrorcommand.h index 590c554..aac17b6 100644 --- a/seqerrorcommand.h +++ b/seqerrorcommand.h @@ -10,47 +10,25 @@ * */ -#include "mothur.h" #include "command.hpp" #include "sequence.hpp" #include "referencedb.h" +#include "counttable.h" -struct Compare { - 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; - string refName, queryName, sequence; - double errorRate; - int weight, matches, mismatches, total; - - Compare(){ - AA=0; AT=0; AG=0; AC=0; - TA=0; TT=0; TG=0; TC=0; - GA=0; GT=0; GG=0; GC=0; - CA=0; CT=0; CG=0; CC=0; - NA=0; NT=0; NG=0; NC=0; - Ai=0; Ti=0; Gi=0; Ci=0; Ni=0; - dA=0; dT=0; dG=0; dC=0; - refName = ""; - queryName = ""; - weight = 1; - matches = 0; - mismatches = 0; - total = 0; - errorRate = 1.0000; - sequence = ""; - } -}; class SeqErrorCommand : public Command { public: SeqErrorCommand(string); SeqErrorCommand(); - ~SeqErrorCommand() {} + ~SeqErrorCommand(){} vector setParameters(); string getCommandName() { return "seq.error"; } string getCommandCategory() { return "Sequence Processing"; } + string getHelpString(); - string getCitation() { return "http://www.mothur.org/wiki/Seq.error"; } + string getOutputPattern(string); + string getCitation() { return "Schloss PD, Gevers D, Westcott SL (2011). Reducing the effects of PCR amplification and sequencing artifacts on 16S rRNA-based studies. PLoS ONE. 6:e27310.\nhttp://www.mothur.org/wiki/Seq.error"; } string getDescription() { return "seq.error"; } @@ -62,11 +40,38 @@ private: ReferenceDB* rdb; struct linePair { - unsigned long int start; - unsigned long int end; - linePair(unsigned long int i, unsigned long int j) : start(i), end(j) {} + unsigned long long start; + unsigned long long end; + linePair(unsigned long long i, unsigned long long j) : start(i), end(j) {} + ~linePair(){} }; + struct Compare { + 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; + string refName, queryName, sequence; + double errorRate; + int weight, matches, mismatches, total; + + Compare(){ + AA=0; AT=0; AG=0; AC=0; + TA=0; TT=0; TG=0; TC=0; + GA=0; GT=0; GG=0; GC=0; + CA=0; CT=0; CG=0; CC=0; + NA=0; NT=0; NG=0; NC=0; + Ai=0; Ti=0; Gi=0; Ci=0; Ni=0; + dA=0; dT=0; dG=0; dC=0; + refName = ""; + queryName = ""; + weight = 1; + matches = 0; + mismatches = 0; + total = 0; + errorRate = 1.0000; + sequence = ""; + } + ~Compare(){}; + }; + vector processIDS; //processid vector lines; vector qLines; @@ -74,7 +79,7 @@ private: void getReferences(); map getWeights(); - Compare getErrors(Sequence, Sequence); + int getErrors(Sequence, Sequence, Compare&); void printErrorHeader(ofstream&); void printErrorData(Compare, int, ofstream&, ofstream&); void printSubMatrix(); @@ -82,13 +87,13 @@ private: void printErrorQuality(map >); void printQualityFR(vector >, vector >); - int setLines(string, string, string, vector&, vector&, vector&); + int setLines(string, string, string, vector&, vector&, vector&); int driver(string, string, string, string, string, string, linePair, linePair, linePair); int createProcesses(string, string, string, string, string, string); - string queryFileName, referenceFileName, qualFileName, reportFileName, namesFileName, outputDir; + string queryFileName, referenceFileName, qualFileName, reportFileName, namesFileName, outputDir, countfile; double threshold; - bool ignoreChimeras, save; + bool ignoreChimeras, save, aligned; int numRefs, processors; int maxLength, totalBases, totalMatches; //ofstream errorSummaryFile, errorSeqFile;