X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=summaryqualcommand.h;h=31390b4296ff7659fdfb2946d3f37ff33b2877b7;hb=dc383fb61b6d165a8d36e6108df8bc7129243ae6;hp=1ec3cf1891893227d07d256cecd15f742ee9d127;hpb=0718c426add1df69adcc24444ef45550fb262ca7;p=mothur.git diff --git a/summaryqualcommand.h b/summaryqualcommand.h index 1ec3cf1..31390b4 100644 --- a/summaryqualcommand.h +++ b/summaryqualcommand.h @@ -25,6 +25,7 @@ public: vector setParameters(); string getCommandName() { return "summary.qual"; } string getCommandCategory() { return "Sequence Processing"; } + string getOutputFileNameTag(string, string); string getHelpString(); string getCitation() { return "http://www.mothur.org/wiki/Summary.qual"; } string getDescription() { return "summarize the quality of a set of sequences"; } @@ -58,9 +59,9 @@ private: // This is passed by void pointer so it can be any data type // that can be passed using a single void pointer (LPVOID). struct seqSumQualData { - vector* position; - vector* averageQ; - vector< vector >* scores; + vector position; + vector averageQ; + vector< vector > scores; string filename, namefile; unsigned long long start; unsigned long long end; @@ -69,10 +70,7 @@ struct seqSumQualData { map nameMap; ~seqSumQualData(){} - seqSumQualData(vector* p, vector* a, vector< vector >* s, string f, MothurOut* mout, unsigned long long st, unsigned long long en, string n, map nam) { - position = p; - averageQ = a; - scores = s; + seqSumQualData(string f, MothurOut* mout, unsigned long long st, unsigned long long en, string n, map nam) { filename = f; m = mout; start = st; @@ -84,7 +82,7 @@ struct seqSumQualData { }; /**************************************************************************************************/ -#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) +#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) #else static DWORD WINAPI MySeqSumQualThreadFunction(LPVOID lpParam){ seqSumQualData* pDataArray; @@ -122,20 +120,20 @@ static DWORD WINAPI MySeqSumQualThreadFunction(LPVOID lpParam){ vector thisScores = current.getQualityScores(); //resize to num of positions setting number of seqs with that size to 1 - if (pDataArray->position->size() < thisScores.size()) { pDataArray->position->resize(thisScores.size(), 0); } - if (pDataArray->averageQ->size() < thisScores.size()) { pDataArray->averageQ->resize(thisScores.size(), 0); } - if (pDataArray->scores->size() < thisScores.size()) { - pDataArray->scores->resize(thisScores.size()); - for (int i = 0; i < pDataArray->scores->size(); i++) { pDataArray->scores->at(i).resize(41, 0); } + if (pDataArray->position.size() < thisScores.size()) { pDataArray->position.resize(thisScores.size(), 0); } + if (pDataArray->averageQ.size() < thisScores.size()) { pDataArray->averageQ.resize(thisScores.size(), 0); } + if (pDataArray->scores.size() < thisScores.size()) { + pDataArray->scores.resize(thisScores.size()); + for (int i = 0; i < pDataArray->scores.size(); i++) { pDataArray->scores.at(i).resize(41, 0); } } //increase counts of number of seqs with this position //average is really the total, we will average in execute for (int i = 0; i < thisScores.size(); i++) { - pDataArray->position->at(i) += num; - pDataArray->averageQ->at(i) += (thisScores[i] * num); //weighting for namesfile + pDataArray->position.at(i) += num; + pDataArray->averageQ.at(i) += (thisScores[i] * num); //weighting for namesfile if (thisScores[i] > 40) { pDataArray->m->mothurOut("[ERROR]: " + current.getName() + " has a quality scores of " + toString(thisScores[i]) + ", expecting values to be less than 40."); pDataArray->m->mothurOutEndLine(); pDataArray->m->control_pressed = true; } - else { pDataArray->scores->at(i)[thisScores[i]] += num; } + else { pDataArray->scores.at(i)[thisScores[i]] += num; } } count += num;