From: westcott Date: Wed, 4 Jan 2012 13:31:41 +0000 (+0000) Subject: 1.23.0 X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=0ca63a8165baa0afa459e644ebe140ba496d5ba0 1.23.0 --- diff --git a/aligncommand.cpp b/aligncommand.cpp index 960d702..f03a901 100644 --- a/aligncommand.cpp +++ b/aligncommand.cpp @@ -224,34 +224,29 @@ AlignCommand::AlignCommand(string option) { // ...at some point should added some additional type checking... string temp; temp = validParameter.validFile(parameters, "ksize", false); if (temp == "not found"){ temp = "8"; } - convert(temp, kmerSize); + m->mothurConvert(temp, kmerSize); temp = validParameter.validFile(parameters, "match", false); if (temp == "not found"){ temp = "1.0"; } - convert(temp, match); + m->mothurConvert(temp, match); temp = validParameter.validFile(parameters, "mismatch", false); if (temp == "not found"){ temp = "-1.0"; } - convert(temp, misMatch); + m->mothurConvert(temp, misMatch); temp = validParameter.validFile(parameters, "gapopen", false); if (temp == "not found"){ temp = "-2.0"; } - convert(temp, gapOpen); + m->mothurConvert(temp, gapOpen); temp = validParameter.validFile(parameters, "gapextend", false); if (temp == "not found"){ temp = "-1.0"; } - convert(temp, gapExtend); + m->mothurConvert(temp, gapExtend); temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "flip", false); if (temp == "not found"){ temp = "f"; } flip = m->isTrue(temp); temp = validParameter.validFile(parameters, "save", false); if (temp == "not found"){ temp = "f"; } save = m->isTrue(temp); - //this is so the threads can quickly load the reference data - #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) - #else - if (processors != 1) { save = true; } - #endif rdb->save = save; if (save) { //clear out old references rdb->clearMemory(); @@ -272,7 +267,7 @@ AlignCommand::AlignCommand(string option) { else { if (save) { rdb->setSavedReference(templateFileName); } } temp = validParameter.validFile(parameters, "threshold", false); if (temp == "not found"){ temp = "0.50"; } - convert(temp, threshold); + m->mothurConvert(temp, threshold); search = validParameter.validFile(parameters, "search", false); if (search == "not found"){ search = "kmer"; } if ((search != "suffix") && (search != "kmer") && (search != "blast")) { m->mothurOut("invalid search option: choices are kmer, suffix or blast."); m->mothurOutEndLine(); abort=true; } @@ -923,7 +918,7 @@ int AlignCommand::createProcesses(string alignFileName, string reportFileName, s string extension = ""; if (i != 0) { extension = toString(i) + ".temp"; } - alignData* tempalign = new alignData((alignFileName + extension), (reportFileName + extension), (accnosFName + extension), filename, align, search, kmerSize, m, lines[i]->start, lines[i]->end, flip, match, misMatch, gapOpen, gapExtend, threshold, i); + alignData* tempalign = new alignData(templateFileName, (alignFileName + extension), (reportFileName + extension), (accnosFName + extension), filename, align, search, kmerSize, m, lines[i]->start, lines[i]->end, flip, match, misMatch, gapOpen, gapExtend, threshold, i); pDataArray.push_back(tempalign); processIDS.push_back(i); diff --git a/aligncommand.h b/aligncommand.h index fa1bf57..7f5122a 100644 --- a/aligncommand.h +++ b/aligncommand.h @@ -79,6 +79,7 @@ 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 alignData { + string templateFileName; string alignFName; string reportFName; string accnosFName; @@ -94,7 +95,8 @@ struct alignData { int count, kmerSize, threadID; alignData(){} - alignData(string a, string r, string ac, string f, string al, string se, int ks, MothurOut* mout, unsigned long long st, unsigned long long en, bool fl, float ma, float misMa, float gapO, float gapE, float thr, int tid) { + alignData(string te, string a, string r, string ac, string f, string al, string se, int ks, MothurOut* mout, unsigned long long st, unsigned long long en, bool fl, float ma, float misMa, float gapO, float gapE, float thr, int tid) { + templateFileName = te; alignFName = a; reportFName = r; accnosFName = ac; @@ -145,7 +147,7 @@ static DWORD WINAPI MyAlignThreadFunction(LPVOID lpParam){ pDataArray->count = pDataArray->end; - AlignmentDB* templateDB = new AlignmentDB("saved-silent", pDataArray->search, pDataArray->kmerSize, pDataArray->gapOpen, pDataArray->gapExtend, pDataArray->match, pDataArray->misMatch, pDataArray->threadID); + AlignmentDB* templateDB = new AlignmentDB(templateFileName, pDataArray->search, pDataArray->kmerSize, pDataArray->gapOpen, pDataArray->gapExtend, pDataArray->match, pDataArray->misMatch, pDataArray->threadID); //moved this into driver to avoid deep copies in windows paralellized version Alignment* alignment; diff --git a/amovacommand.cpp b/amovacommand.cpp index de277ab..3ec14bf 100644 --- a/amovacommand.cpp +++ b/amovacommand.cpp @@ -136,11 +136,11 @@ AmovaCommand::AmovaCommand(string option) { string temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } - convert(temp, iters); + m->mothurConvert(temp, iters); temp = validParameter.validFile(parameters, "alpha", false); if (temp == "not found") { temp = "0.05"; } - convert(temp, experimentwiseAlpha); + m->mothurConvert(temp, experimentwiseAlpha); } } catch(exception& e) { diff --git a/anosimcommand.cpp b/anosimcommand.cpp index 50b6f28..1b6afe3 100644 --- a/anosimcommand.cpp +++ b/anosimcommand.cpp @@ -138,11 +138,11 @@ AnosimCommand::AnosimCommand(string option) { string temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } - convert(temp, iters); + m->mothurConvert(temp, iters); temp = validParameter.validFile(parameters, "alpha", false); if (temp == "not found") { temp = "0.05"; } - convert(temp, experimentwiseAlpha); + m->mothurConvert(temp, experimentwiseAlpha); } } diff --git a/bootstrapsharedcommand.cpp b/bootstrapsharedcommand.cpp index d249421..de96574 100644 --- a/bootstrapsharedcommand.cpp +++ b/bootstrapsharedcommand.cpp @@ -157,7 +157,7 @@ BootSharedCommand::BootSharedCommand(string option) { string temp; temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } - convert(temp, iters); + m->mothurConvert(temp, iters); if (abort == false) { diff --git a/chimerabellerophoncommand.cpp b/chimerabellerophoncommand.cpp index ac1645d..1fc87db 100644 --- a/chimerabellerophoncommand.cpp +++ b/chimerabellerophoncommand.cpp @@ -193,13 +193,13 @@ ChimeraBellerophonCommand::ChimeraBellerophonCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "window", false); if (temp == "not found") { temp = "0"; } - convert(temp, window); + m->mothurConvert(temp, window); temp = validParameter.validFile(parameters, "increment", false); if (temp == "not found") { temp = "25"; } - convert(temp, increment); + m->mothurConvert(temp, increment); } } catch(exception& e) { diff --git a/chimeraccodecommand.cpp b/chimeraccodecommand.cpp index 7468011..af6e33a 100644 --- a/chimeraccodecommand.cpp +++ b/chimeraccodecommand.cpp @@ -223,13 +223,13 @@ ChimeraCcodeCommand::ChimeraCcodeCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "window", false); if (temp == "not found") { temp = "0"; } - convert(temp, window); + m->mothurConvert(temp, window); temp = validParameter.validFile(parameters, "numwanted", false); if (temp == "not found") { temp = "20"; } - convert(temp, numwanted); + m->mothurConvert(temp, numwanted); temp = validParameter.validFile(parameters, "save", false); if (temp == "not found"){ temp = "f"; } save = m->isTrue(temp); diff --git a/chimeracheckcommand.cpp b/chimeracheckcommand.cpp index 400a715..9f53b17 100644 --- a/chimeracheckcommand.cpp +++ b/chimeracheckcommand.cpp @@ -281,7 +281,7 @@ ChimeraCheckCommand::ChimeraCheckCommand(string option) { string temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "save", false); if (temp == "not found"){ temp = "f"; } save = m->isTrue(temp); @@ -306,14 +306,14 @@ ChimeraCheckCommand::ChimeraCheckCommand(string option) { temp = validParameter.validFile(parameters, "ksize", false); if (temp == "not found") { temp = "7"; } - convert(temp, ksize); + m->mothurConvert(temp, ksize); temp = validParameter.validFile(parameters, "svg", false); if (temp == "not found") { temp = "F"; } svg = m->isTrue(temp); if (nameFileNames.size() != 0) { svg = true; } temp = validParameter.validFile(parameters, "increment", false); if (temp == "not found") { temp = "10"; } - convert(temp, increment); + m->mothurConvert(temp, increment); } } catch(exception& e) { diff --git a/chimeraperseuscommand.cpp b/chimeraperseuscommand.cpp index 61970d5..8eaf536 100644 --- a/chimeraperseuscommand.cpp +++ b/chimeraperseuscommand.cpp @@ -345,16 +345,16 @@ ChimeraPerseusCommand::ChimeraPerseusCommand(string option) { string temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found"){ temp = "0.50"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); temp = validParameter.validFile(parameters, "alpha", false); if (temp == "not found"){ temp = "-5.54"; } - convert(temp, alpha); + m->mothurConvert(temp, alpha); temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found"){ temp = "0.33"; } - convert(temp, beta); + m->mothurConvert(temp, beta); } } catch(exception& e) { diff --git a/chimerapintailcommand.cpp b/chimerapintailcommand.cpp index 0627793..3eb6589 100644 --- a/chimerapintailcommand.cpp +++ b/chimerapintailcommand.cpp @@ -225,13 +225,13 @@ ChimeraPintailCommand::ChimeraPintailCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "window", false); if (temp == "not found") { temp = "0"; } - convert(temp, window); + m->mothurConvert(temp, window); temp = validParameter.validFile(parameters, "increment", false); if (temp == "not found") { temp = "25"; } - convert(temp, increment); + m->mothurConvert(temp, increment); temp = validParameter.validFile(parameters, "save", false); if (temp == "not found"){ temp = "f"; } save = m->isTrue(temp); diff --git a/chimeraslayercommand.cpp b/chimeraslayercommand.cpp index 0512be1..cfcad15 100644 --- a/chimeraslayercommand.cpp +++ b/chimeraslayercommand.cpp @@ -383,7 +383,7 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option) { string temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "save", false); if (temp == "not found"){ temp = "f"; } save = m->isTrue(temp); @@ -441,34 +441,34 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option) { temp = validParameter.validFile(parameters, "ksize", false); if (temp == "not found") { temp = "7"; } - convert(temp, ksize); + m->mothurConvert(temp, ksize); temp = validParameter.validFile(parameters, "window", false); if (temp == "not found") { temp = "50"; } - convert(temp, window); + m->mothurConvert(temp, window); temp = validParameter.validFile(parameters, "match", false); if (temp == "not found") { temp = "5"; } - convert(temp, match); + m->mothurConvert(temp, match); temp = validParameter.validFile(parameters, "mismatch", false); if (temp == "not found") { temp = "-4"; } - convert(temp, mismatch); + m->mothurConvert(temp, mismatch); temp = validParameter.validFile(parameters, "divergence", false); if (temp == "not found") { temp = "1.007"; } - convert(temp, divR); + m->mothurConvert(temp, divR); temp = validParameter.validFile(parameters, "minsim", false); if (temp == "not found") { temp = "90"; } - convert(temp, minSimilarity); + m->mothurConvert(temp, minSimilarity); temp = validParameter.validFile(parameters, "mincov", false); if (temp == "not found") { temp = "70"; } - convert(temp, minCoverage); + m->mothurConvert(temp, minCoverage); temp = validParameter.validFile(parameters, "minbs", false); if (temp == "not found") { temp = "90"; } - convert(temp, minBS); + m->mothurConvert(temp, minBS); temp = validParameter.validFile(parameters, "minsnp", false); if (temp == "not found") { temp = "10"; } - convert(temp, minSNP); + m->mothurConvert(temp, minSNP); temp = validParameter.validFile(parameters, "parents", false); if (temp == "not found") { temp = "3"; } - convert(temp, parents); + m->mothurConvert(temp, parents); temp = validParameter.validFile(parameters, "realign", false); if (temp == "not found") { temp = "t"; } realign = m->isTrue(temp); @@ -482,13 +482,13 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option) { search = validParameter.validFile(parameters, "search", false); if (search == "not found") { search = "blast"; } temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } - convert(temp, iters); + m->mothurConvert(temp, iters); temp = validParameter.validFile(parameters, "increment", false); if (temp == "not found") { temp = "5"; } - convert(temp, increment); + m->mothurConvert(temp, increment); temp = validParameter.validFile(parameters, "numwanted", false); if (temp == "not found") { temp = "15"; } - convert(temp, numwanted); + m->mothurConvert(temp, numwanted); blastlocation = validParameter.validFile(parameters, "blastlocation", false); if (blastlocation == "not found") { blastlocation = ""; } diff --git a/chimerauchimecommand.cpp b/chimerauchimecommand.cpp index 40b3f26..01289a0 100644 --- a/chimerauchimecommand.cpp +++ b/chimerauchimecommand.cpp @@ -418,7 +418,7 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option) { string temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); abskew = validParameter.validFile(parameters, "abskew", false); if (abskew == "not found"){ useAbskew = false; abskew = "1.9"; }else{ useAbskew = true; } if (useAbskew && templatefile != "self") { m->mothurOut("The abskew parameter is only valid with template=self, ignoring."); m->mothurOutEndLine(); useAbskew = false; } diff --git a/chopseqscommand.cpp b/chopseqscommand.cpp index abfd8dc..68576cd 100644 --- a/chopseqscommand.cpp +++ b/chopseqscommand.cpp @@ -121,7 +121,7 @@ ChopSeqsCommand::ChopSeqsCommand(string option) { outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = m->hasPath(fastafile); } string temp = validParameter.validFile(parameters, "numbases", false); if (temp == "not found") { temp = "0"; } - convert(temp, numbases); + m->mothurConvert(temp, numbases); temp = validParameter.validFile(parameters, "countgaps", false); if (temp == "not found") { temp = "f"; } countGaps = m->isTrue(temp); diff --git a/classifyotucommand.cpp b/classifyotucommand.cpp index f36631a..e28961b 100644 --- a/classifyotucommand.cpp +++ b/classifyotucommand.cpp @@ -206,7 +206,7 @@ ClassifyOtuCommand::ClassifyOtuCommand(string option) { if ((basis != "otu") && (basis != "sequence")) { m->mothurOut("Invalid option for basis. basis options are otu and sequence, using otu."); m->mothurOutEndLine(); } string temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "51"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); temp = validParameter.validFile(parameters, "probs", false); if (temp == "not found"){ temp = "true"; } probs = m->isTrue(temp); diff --git a/classifyseqscommand.cpp b/classifyseqscommand.cpp index af6d914..9ee7b5e 100644 --- a/classifyseqscommand.cpp +++ b/classifyseqscommand.cpp @@ -374,19 +374,14 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option) { // ...at some point should added some additional type checking... string temp; temp = validParameter.validFile(parameters, "ksize", false); if (temp == "not found"){ temp = "8"; } - convert(temp, kmerSize); + m->mothurConvert(temp, kmerSize); temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "save", false); if (temp == "not found"){ temp = "f"; } save = m->isTrue(temp); - //this is so the threads can quickly load the reference data - #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) - #else - if ((processors != 1) && (rdb->referenceSeqs.size() == 0)) { save = true; } - #endif rdb->save = save; if (save) { //clear out old references rdb->clearMemory(); @@ -425,28 +420,28 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option) { method = validParameter.validFile(parameters, "method", false); if (method == "not found"){ method = "bayesian"; } temp = validParameter.validFile(parameters, "match", false); if (temp == "not found"){ temp = "1.0"; } - convert(temp, match); + m->mothurConvert(temp, match); temp = validParameter.validFile(parameters, "mismatch", false); if (temp == "not found"){ temp = "-1.0"; } - convert(temp, misMatch); + m->mothurConvert(temp, misMatch); temp = validParameter.validFile(parameters, "gapopen", false); if (temp == "not found"){ temp = "-2.0"; } - convert(temp, gapOpen); + m->mothurConvert(temp, gapOpen); temp = validParameter.validFile(parameters, "gapextend", false); if (temp == "not found"){ temp = "-1.0"; } - convert(temp, gapExtend); + m->mothurConvert(temp, gapExtend); temp = validParameter.validFile(parameters, "numwanted", false); if (temp == "not found"){ temp = "10"; } - convert(temp, numWanted); + m->mothurConvert(temp, numWanted); temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found"){ temp = "0"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); temp = validParameter.validFile(parameters, "probs", false); if (temp == "not found"){ temp = "true"; } probs = m->isTrue(temp); temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "100"; } - convert(temp, iters); + m->mothurConvert(temp, iters); diff --git a/classifyseqscommand.h b/classifyseqscommand.h index eef96ff..0e21a20 100644 --- a/classifyseqscommand.h +++ b/classifyseqscommand.h @@ -157,8 +157,8 @@ static DWORD WINAPI MyClassThreadFunction(LPVOID lpParam){ //make classify Classify* myclassify; - if(pDataArray->method == "bayesian"){ myclassify = new Bayesian("saved", "saved", pDataArray->search, pDataArray->kmerSize, pDataArray->cutoff, pDataArray->iters, pDataArray->threadID); } - else if(pDataArray->method == "knn"){ myclassify = new Knn("saved", "saved", pDataArray->search, pDataArray->kmerSize, pDataArray->gapOpen, pDataArray->gapExtend, pDataArray->match, pDataArray->misMatch, pDataArray->numWanted, pDataArray->threadID); } + if(pDataArray->method == "bayesian"){ myclassify = new Bayesian(pDataArray->taxonomyFileName, pDataArray->templateFileName, pDataArray->search, pDataArray->kmerSize, pDataArray->cutoff, pDataArray->iters, pDataArray->threadID); } + else if(pDataArray->method == "knn"){ myclassify = new Knn(pDataArray->taxonomyFileName, pDataArray->templateFileName, pDataArray->search, pDataArray->kmerSize, pDataArray->gapOpen, pDataArray->gapExtend, pDataArray->match, pDataArray->misMatch, pDataArray->numWanted, pDataArray->threadID); } else { pDataArray->m->mothurOut(pDataArray->search + " is not a valid method option. I will run the command using bayesian."); pDataArray->m->mothurOutEndLine(); diff --git a/clustercommand.cpp b/clustercommand.cpp index 47f5531..528f71c 100644 --- a/clustercommand.cpp +++ b/clustercommand.cpp @@ -183,7 +183,7 @@ ClusterCommand::ClusterCommand(string option) { if (temp == "not found") { temp = "100"; } //saves precision legnth for formatting below length = temp.length(); - convert(temp, precision); + m->mothurConvert(temp, precision); temp = validParameter.validFile(parameters, "hard", false); if (temp == "not found") { temp = "T"; } hard = m->isTrue(temp); @@ -193,7 +193,7 @@ ClusterCommand::ClusterCommand(string option) { temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "10"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); cutoff += (5 / (precision * 10.0)); method = validParameter.validFile(parameters, "method", false); diff --git a/clusterdoturcommand.cpp b/clusterdoturcommand.cpp index 0d57e68..603bd73 100644 --- a/clusterdoturcommand.cpp +++ b/clusterdoturcommand.cpp @@ -146,11 +146,11 @@ ClusterDoturCommand::ClusterDoturCommand(string option) { if (temp == "not found") { temp = "100"; } //saves precision legnth for formatting below length = temp.length(); - convert(temp, precision); + m->mothurConvert(temp, precision); temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "10"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); cutoff += (5 / (precision * 10.0)); temp = validParameter.validFile(parameters, "hard", false); if (temp == "not found") { temp = "T"; } diff --git a/clusterfragmentscommand.cpp b/clusterfragmentscommand.cpp index 8d2d3ea..ad1bd81 100644 --- a/clusterfragmentscommand.cpp +++ b/clusterfragmentscommand.cpp @@ -152,10 +152,10 @@ ClusterFragmentsCommand::ClusterFragmentsCommand(string option) { string temp; temp = validParameter.validFile(parameters, "diffs", false); if (temp == "not found"){ temp = "0"; } - convert(temp, diffs); + m->mothurConvert(temp, diffs); temp = validParameter.validFile(parameters, "percent", false); if (temp == "not found"){ temp = "0"; } - convert(temp, percent); + m->mothurConvert(temp, percent); } diff --git a/clustersplitcommand.cpp b/clustersplitcommand.cpp index 7505ae6..787d84a 100644 --- a/clustersplitcommand.cpp +++ b/clustersplitcommand.cpp @@ -264,7 +264,7 @@ ClusterSplitCommand::ClusterSplitCommand(string option) { if (temp == "not found") { temp = "100"; } //saves precision legnth for formatting below length = temp.length(); - convert(temp, precision); + m->mothurConvert(temp, precision); temp = validParameter.validFile(parameters, "hard", false); if (temp == "not found") { temp = "T"; } hard = m->isTrue(temp); @@ -274,7 +274,7 @@ ClusterSplitCommand::ClusterSplitCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "splitmethod", false); if (splitmethod != "fasta") { @@ -283,11 +283,11 @@ ClusterSplitCommand::ClusterSplitCommand(string option) { } temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "0.25"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); cutoff += (5 / (precision * 10.0)); temp = validParameter.validFile(parameters, "taxlevel", false); if (temp == "not found") { temp = "3"; } - convert(temp, taxLevelCutoff); + m->mothurConvert(temp, taxLevelCutoff); method = validParameter.validFile(parameters, "method", false); if (method == "not found") { method = "average"; } diff --git a/collectcommand.cpp b/collectcommand.cpp index a65b417..e0d62dd 100644 --- a/collectcommand.cpp +++ b/collectcommand.cpp @@ -280,13 +280,13 @@ CollectCommand::CollectCommand(string option) { string temp; temp = validParameter.validFile(parameters, "freq", false); if (temp == "not found") { temp = "100"; } - convert(temp, freq); + m->mothurConvert(temp, freq); temp = validParameter.validFile(parameters, "abund", false); if (temp == "not found") { temp = "10"; } - convert(temp, abund); + m->mothurConvert(temp, abund); temp = validParameter.validFile(parameters, "size", false); if (temp == "not found") { temp = "0"; } - convert(temp, size); + m->mothurConvert(temp, size); } } diff --git a/collectsharedcommand.cpp b/collectsharedcommand.cpp index a5721b0..f3a320b 100644 --- a/collectsharedcommand.cpp +++ b/collectsharedcommand.cpp @@ -274,7 +274,7 @@ CollectSharedCommand::CollectSharedCommand(string option) { string temp; temp = validParameter.validFile(parameters, "freq", false); if (temp == "not found") { temp = "100"; } - convert(temp, freq); + m->mothurConvert(temp, freq); temp = validParameter.validFile(parameters, "all", false); if (temp == "not found") { temp = "false"; } all = m->isTrue(temp); diff --git a/consensusseqscommand.cpp b/consensusseqscommand.cpp index e32867f..4f8c53b 100644 --- a/consensusseqscommand.cpp +++ b/consensusseqscommand.cpp @@ -159,7 +159,7 @@ ConsensusSeqsCommand::ConsensusSeqsCommand(string option) { } string temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "100"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); //if the user changes the output directory command factory will send this info to us in the output parameter outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = m->hasPath(fastafile); } diff --git a/corraxescommand.cpp b/corraxescommand.cpp index b943aa4..4e9c3c6 100644 --- a/corraxescommand.cpp +++ b/corraxescommand.cpp @@ -187,7 +187,7 @@ CorrAxesCommand::CorrAxesCommand(string option) { } string temp; temp = validParameter.validFile(parameters, "numaxes", false); if (temp == "not found"){ temp = "3"; } - convert(temp, numaxes); + m->mothurConvert(temp, numaxes); method = validParameter.validFile(parameters, "method", false); if (method == "not found"){ method = "pearson"; } diff --git a/distancecommand.cpp b/distancecommand.cpp index 0f067ae..65edcf7 100644 --- a/distancecommand.cpp +++ b/distancecommand.cpp @@ -179,11 +179,11 @@ DistanceCommand::DistanceCommand(string option) { convert(temp, countends); temp = validParameter.validFile(parameters, "cutoff", false); if(temp == "not found"){ temp = "1.0"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "compress", false); if(temp == "not found"){ temp = "F"; } convert(temp, compress); diff --git a/engine.cpp b/engine.cpp index 670af78..ea1c0e1 100644 --- a/engine.cpp +++ b/engine.cpp @@ -186,11 +186,13 @@ bool InteractEngine::getInput(){ mout->names.clear(); mout->saveNextLabel = ""; mout->printedHeaders = false; + mout->commandInputsConvertError = false; mout->currentBinLabels.clear(); mout->binLabelsInFile.clear(); Command* command = cFactory->getCommand(commandName, options); - quitCommandCalled = command->execute(); + if (mout->commandInputsConvertError) { quitCommandCalled = 2; } + else { quitCommandCalled = command->execute(); } //if we aborted command if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); } @@ -370,12 +372,14 @@ bool BatchEngine::getInput(){ mout->names.clear(); mout->saveNextLabel = ""; mout->printedHeaders = false; + mout->commandInputsConvertError = false; mout->currentBinLabels.clear(); mout->binLabelsInFile.clear(); Command* command = cFactory->getCommand(commandName, options); - quitCommandCalled = command->execute(); + if (mout->commandInputsConvertError) { quitCommandCalled = 2; } + else { quitCommandCalled = command->execute(); } //if we aborted command if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); } @@ -537,12 +541,13 @@ bool ScriptEngine::getInput(){ mout->names.clear(); mout->saveNextLabel = ""; mout->printedHeaders = false; + mout->commandInputsConvertError = false; mout->currentBinLabels.clear(); mout->binLabelsInFile.clear(); - Command* command = cFactory->getCommand(commandName, options); - quitCommandCalled = command->execute(); + if (mout->commandInputsConvertError) { quitCommandCalled = 2; } + else { quitCommandCalled = command->execute(); } //if we aborted command if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); } diff --git a/filterseqscommand.cpp b/filterseqscommand.cpp index d17f6a3..82c73f3 100644 --- a/filterseqscommand.cpp +++ b/filterseqscommand.cpp @@ -222,7 +222,7 @@ FilterSeqsCommand::FilterSeqsCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); vertical = validParameter.validFile(parameters, "vertical", false); if (vertical == "not found") { diff --git a/getoturepcommand.cpp b/getoturepcommand.cpp index 2f6f810..35437e7 100644 --- a/getoturepcommand.cpp +++ b/getoturepcommand.cpp @@ -297,10 +297,10 @@ GetOTURepCommand::GetOTURepCommand(string option) { if ((weighted) && (namefile == "")) { m->mothurOut("You cannot set weighted to true unless you provide a namesfile."); m->mothurOutEndLine(); abort = true; } temp = validParameter.validFile(parameters, "precision", false); if (temp == "not found") { temp = "100"; } - convert(temp, precision); + m->mothurConvert(temp, precision); temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "10.0"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); cutoff += (5 / (precision * 10.0)); } } diff --git a/hclustercommand.cpp b/hclustercommand.cpp index b2af034..4713693 100644 --- a/hclustercommand.cpp +++ b/hclustercommand.cpp @@ -182,14 +182,14 @@ HClusterCommand::HClusterCommand(string option) { if (temp == "not found") { temp = "100"; } //saves precision legnth for formatting below length = temp.length(); - convert(temp, precision); + m->mothurConvert(temp, precision); temp = validParameter.validFile(parameters, "hard", false); if (temp == "not found") { temp = "T"; } hard = m->isTrue(temp); temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "10"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); cutoff += (5 / (precision * 10.0)); method = validParameter.validFile(parameters, "method", false); diff --git a/heatmapcommand.cpp b/heatmapcommand.cpp index 57c4c86..7d9b482 100644 --- a/heatmapcommand.cpp +++ b/heatmapcommand.cpp @@ -226,10 +226,10 @@ HeatMapCommand::HeatMapCommand(string option) { } string temp = validParameter.validFile(parameters, "numotu", false); if (temp == "not found") { temp = "0"; } - convert(temp, numOTU); + m->mothurConvert(temp, numOTU); temp = validParameter.validFile(parameters, "fontsize", false); if (temp == "not found") { temp = "24"; } - convert(temp, fontSize); + m->mothurConvert(temp, fontSize); sorted = validParameter.validFile(parameters, "sorted", false); if (sorted == "not found") { diff --git a/heatmapsimcommand.cpp b/heatmapsimcommand.cpp index d78b3cf..de35075 100644 --- a/heatmapsimcommand.cpp +++ b/heatmapsimcommand.cpp @@ -242,7 +242,7 @@ HeatMapSimCommand::HeatMapSimCommand(string option) { } string temp = validParameter.validFile(parameters, "fontsize", false); if (temp == "not found") { temp = "24"; } - convert(temp, fontsize); + m->mothurConvert(temp, fontsize); if (abort == false) { ValidCalculators validCalculator; diff --git a/homovacommand.cpp b/homovacommand.cpp index 1869004..9b7ec9f 100644 --- a/homovacommand.cpp +++ b/homovacommand.cpp @@ -139,11 +139,11 @@ HomovaCommand::HomovaCommand(string option) { string temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } - convert(temp, iters); + m->mothurConvert(temp, iters); temp = validParameter.validFile(parameters, "alpha", false); if (temp == "not found") { temp = "0.05"; } - convert(temp, experimentwiseAlpha); + m->mothurConvert(temp, experimentwiseAlpha); } } diff --git a/indicatorcommand.cpp b/indicatorcommand.cpp index 40d3bcd..1864f74 100644 --- a/indicatorcommand.cpp +++ b/indicatorcommand.cpp @@ -175,11 +175,11 @@ IndicatorCommand::IndicatorCommand(string option) { if (label == "not found") { label = ""; m->mothurOut("You did not provide a label, I will use the first label in your inputfile."); m->mothurOutEndLine(); label=""; } string temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } - convert(temp, iters); + m->mothurConvert(temp, iters); temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); if ((relabundfile == "") && (sharedfile == "")) { //is there are current file available for either of these? diff --git a/libshuffcommand.cpp b/libshuffcommand.cpp index 1e8102f..1d1d41f 100644 --- a/libshuffcommand.cpp +++ b/libshuffcommand.cpp @@ -170,13 +170,13 @@ LibShuffCommand::LibShuffCommand(string option) { string temp; temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "10000"; } - convert(temp, iters); + m->mothurConvert(temp, iters); temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "1.0"; } - convert(temp, cutOff); + m->mothurConvert(temp, cutOff); temp = validParameter.validFile(parameters, "step", false); if (temp == "not found") { temp = "0.01"; } - convert(temp, step); + m->mothurConvert(temp, step); temp = validParameter.validFile(parameters, "sim", false); if (temp == "not found") { temp = "F"; } sim = m->isTrue(temp); diff --git a/mantelcommand.cpp b/mantelcommand.cpp index c3ab352..409eae4 100644 --- a/mantelcommand.cpp +++ b/mantelcommand.cpp @@ -125,7 +125,7 @@ MantelCommand::MantelCommand(string option) { method = validParameter.validFile(parameters, "method", false); if (method == "not found"){ method = "pearson"; } string temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } - convert(temp, iters); + m->mothurConvert(temp, iters); if ((method != "pearson") && (method != "spearman") && (method != "kendall")) { m->mothurOut(method + " is not a valid method. Valid methods are pearson, spearman, and kendall."); m->mothurOutEndLine(); abort = true; } } diff --git a/matrixoutputcommand.cpp b/matrixoutputcommand.cpp index f5737c7..d1cf54b 100644 --- a/matrixoutputcommand.cpp +++ b/matrixoutputcommand.cpp @@ -186,7 +186,7 @@ MatrixOutputCommand::MatrixOutputCommand(string option) { string temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); calc = validParameter.validFile(parameters, "calc", false); if (calc == "not found") { calc = "jclass-thetayc"; } diff --git a/metastatscommand.cpp b/metastatscommand.cpp index 0ff8b3f..b7aa7e5 100644 --- a/metastatscommand.cpp +++ b/metastatscommand.cpp @@ -178,14 +178,14 @@ MetaStatsCommand::MetaStatsCommand(string option) { string temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } - convert(temp, iters); + m->mothurConvert(temp, iters); temp = validParameter.validFile(parameters, "threshold", false); if (temp == "not found") { temp = "0.05"; } - convert(temp, threshold); + m->mothurConvert(temp, threshold); temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); } } diff --git a/mgclustercommand.cpp b/mgclustercommand.cpp index f0886c8..9c45afe 100644 --- a/mgclustercommand.cpp +++ b/mgclustercommand.cpp @@ -149,10 +149,10 @@ MGClusterCommand::MGClusterCommand(string option) { string temp; temp = validParameter.validFile(parameters, "precision", false); if (temp == "not found") { temp = "100"; } precisionLength = temp.length(); - convert(temp, precision); + m->mothurConvert(temp, precision); temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "0.70"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); cutoff += (5 / (precision * 10.0)); method = validParameter.validFile(parameters, "method", false); @@ -162,10 +162,10 @@ MGClusterCommand::MGClusterCommand(string option) { else { m->mothurOut("Not a valid clustering method. Valid clustering algorithms are furthest, nearest or average."); m->mothurOutEndLine(); abort = true; } temp = validParameter.validFile(parameters, "length", false); if (temp == "not found") { temp = "5"; } - convert(temp, length); + m->mothurConvert(temp, length); temp = validParameter.validFile(parameters, "penalty", false); if (temp == "not found") { temp = "0.10"; } - convert(temp, penalty); + m->mothurConvert(temp, penalty); temp = validParameter.validFile(parameters, "min", false); if (temp == "not found") { temp = "true"; } minWanted = m->isTrue(temp); diff --git a/mothurout.cpp b/mothurout.cpp index c58e634..9dcdc80 100644 --- a/mothurout.cpp +++ b/mothurout.cpp @@ -1514,6 +1514,84 @@ int MothurOut::mothurRemove(string filename){ exit(1); } } +/***********************************************************************/ +bool MothurOut::mothurConvert(string item, int& num){ + try { + bool error = false; + + if (isNumeric1(item)) { + convert(item, num); + }else { + num = 0; + error = true; + mothurOut("[ERROR]: cannot convert " + item + " to an integer."); mothurOutEndLine(); + commandInputsConvertError = true; + } + + return error; + } + catch(exception& e) { + errorOut(e, "MothurOut", "mothurConvert"); + exit(1); + } +} +/***********************************************************************/ +bool MothurOut::isNumeric1(string stringToCheck){ + try { + bool numeric = false; + + if(stringToCheck.find_first_not_of("0123456789.-") == string::npos) { numeric = true; } + + return numeric; + } + catch(exception& e) { + errorOut(e, "MothurOut", "isNumeric1"); + exit(1); + } + +} +/***********************************************************************/ +bool MothurOut::mothurConvert(string item, float& num){ + try { + bool error = false; + + if (isNumeric1(item)) { + convert(item, num); + }else { + num = 0; + error = true; + mothurOut("[ERROR]: cannot convert " + item + " to a float."); mothurOutEndLine(); + commandInputsConvertError = true; + } + + return error; + } + catch(exception& e) { + errorOut(e, "MothurOut", "mothurConvert"); + exit(1); + } +} +/***********************************************************************/ +bool MothurOut::mothurConvert(string item, double& num){ + try { + bool error = false; + + if (isNumeric1(item)) { + convert(item, num); + }else { + num = 0; + error = true; + mothurOut("[ERROR]: cannot convert " + item + " to a double."); mothurOutEndLine(); + commandInputsConvertError = true; + } + + return error; + } + catch(exception& e) { + errorOut(e, "MothurOut", "mothurConvert"); + exit(1); + } +} /**************************************************************************************************/ vector > MothurOut::binomial(int maxOrder){ diff --git a/mothurout.h b/mothurout.h index 5ba3d08..d2a36b3 100644 --- a/mothurout.h +++ b/mothurout.h @@ -53,7 +53,7 @@ class MothurOut { vector binLabelsInFile; vector currentBinLabels; string saveNextLabel, argv, sharedHeaderMode; - bool printedHeaders; + bool printedHeaders, commandInputsConvertError; //functions from mothur.h //file operations @@ -84,6 +84,9 @@ class MothurOut { int readNames(string, map >&); int readNames(string, vector&, map&); int mothurRemove(string); + bool mothurConvert(string, int&); //use for converting user inputs. Sets commandInputsConvertError to true if error occurs. Engines check this. + bool mothurConvert(string, float&); //use for converting user inputs. Sets commandInputsConvertError to true if error occurs. Engines check this. + bool mothurConvert(string, double&); //use for converting user inputs. Sets commandInputsConvertError to true if error occurs. Engines check this. //searchs and checks @@ -97,6 +100,7 @@ class MothurOut { int getNumChar(string, char); bool isTrue(string); bool isContainingOnlyDigits(string); + bool isNumeric1(string); //string manipulation @@ -198,6 +202,7 @@ class MothurOut { flowfile = ""; gui = false; printedHeaders = false; + commandInputsConvertError = false; sharedHeaderMode = ""; } ~MothurOut(); diff --git a/nmdscommand.cpp b/nmdscommand.cpp index da82784..1d936d4 100644 --- a/nmdscommand.cpp +++ b/nmdscommand.cpp @@ -141,19 +141,19 @@ NMDSCommand::NMDSCommand(string option) { } string temp = validParameter.validFile(parameters, "mindim", false); if (temp == "not found") { temp = "2"; } - convert(temp, mindim); + m->mothurConvert(temp, mindim); temp = validParameter.validFile(parameters, "maxiters", false); if (temp == "not found") { temp = "500"; } - convert(temp, maxIters); + m->mothurConvert(temp, maxIters); temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "10"; } - convert(temp, iters); + m->mothurConvert(temp, iters); temp = validParameter.validFile(parameters, "maxdim", false); if (temp == "not found") { temp = "2"; } - convert(temp, maxdim); + m->mothurConvert(temp, maxdim); temp = validParameter.validFile(parameters, "epsilon", false); if (temp == "not found") { temp = "0.000000000001"; } - convert(temp, epsilon); + m->mothurConvert(temp, epsilon); if (mindim < 1) { m->mothurOut("mindim must be at least 1."); m->mothurOutEndLine(); abort = true; } if (maxdim < mindim) { m->mothurOut("maxdim must be greater than mindim."); m->mothurOutEndLine(); abort = true; } diff --git a/normalizesharedcommand.cpp b/normalizesharedcommand.cpp index 43c8e22..bbf9a83 100644 --- a/normalizesharedcommand.cpp +++ b/normalizesharedcommand.cpp @@ -176,7 +176,7 @@ NormalizeSharedCommand::NormalizeSharedCommand(string option) { if (temp == "not found") { norm = 0; //once you have read, set norm to smallest group number }else { - convert(temp, norm); + m->mothurConvert(temp, norm); if (norm < 0) { m->mothurOut("norm must be positive."); m->mothurOutEndLine(); abort=true; } } diff --git a/pairwiseseqscommand.cpp b/pairwiseseqscommand.cpp index 2245ac9..114f545 100644 --- a/pairwiseseqscommand.cpp +++ b/pairwiseseqscommand.cpp @@ -212,23 +212,23 @@ PairwiseSeqsCommand::PairwiseSeqsCommand(string option) { // ...at some point should added some additional type checking... string temp; temp = validParameter.validFile(parameters, "match", false); if (temp == "not found"){ temp = "1.0"; } - convert(temp, match); + m->mothurConvert(temp, match); temp = validParameter.validFile(parameters, "mismatch", false); if (temp == "not found"){ temp = "-1.0"; } - convert(temp, misMatch); + m->mothurConvert(temp, misMatch); temp = validParameter.validFile(parameters, "gapopen", false); if (temp == "not found"){ temp = "-2.0"; } - convert(temp, gapOpen); + m->mothurConvert(temp, gapOpen); temp = validParameter.validFile(parameters, "gapextend", false); if (temp == "not found"){ temp = "-1.0"; } - convert(temp, gapExtend); + m->mothurConvert(temp, gapExtend); temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "cutoff", false); if(temp == "not found"){ temp = "1.0"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); temp = validParameter.validFile(parameters, "countends", false); if(temp == "not found"){ temp = "T"; } countends = m->isTrue(temp); diff --git a/parsimonycommand.cpp b/parsimonycommand.cpp index 3752935..ccf2952 100644 --- a/parsimonycommand.cpp +++ b/parsimonycommand.cpp @@ -171,11 +171,11 @@ ParsimonyCommand::ParsimonyCommand(string option) { } itersString = validParameter.validFile(parameters, "iters", false); if (itersString == "not found") { itersString = "1000"; } - convert(itersString, iters); + m->mothurConvert(itersString, iters); string temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); } diff --git a/phylodiversitycommand.cpp b/phylodiversitycommand.cpp index ca0d02a..69c7b30 100644 --- a/phylodiversitycommand.cpp +++ b/phylodiversitycommand.cpp @@ -167,10 +167,10 @@ PhyloDiversityCommand::PhyloDiversityCommand(string option) { string temp; temp = validParameter.validFile(parameters, "freq", false); if (temp == "not found") { temp = "100"; } - convert(temp, freq); + m->mothurConvert(temp, freq); temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } - convert(temp, iters); + m->mothurConvert(temp, iters); temp = validParameter.validFile(parameters, "rarefy", false); if (temp == "not found") { temp = "F"; } rarefy = m->isTrue(temp); @@ -187,7 +187,7 @@ PhyloDiversityCommand::PhyloDiversityCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = ""; } diff --git a/phylotypecommand.cpp b/phylotypecommand.cpp index e6dace8..00f960b 100644 --- a/phylotypecommand.cpp +++ b/phylotypecommand.cpp @@ -144,7 +144,7 @@ PhylotypeCommand::PhylotypeCommand(string option) { string temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "-1"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); label = validParameter.validFile(parameters, "label", false); if (label == "not found") { label = ""; allLines = 1; } diff --git a/pipelinepdscommand.cpp b/pipelinepdscommand.cpp index 898ad9b..968ba4f 100644 --- a/pipelinepdscommand.cpp +++ b/pipelinepdscommand.cpp @@ -180,7 +180,7 @@ PipelineCommand::PipelineCommand(string option) { string temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); if (pipeFilename != "") { abort = readUsersPipeline(); diff --git a/preclustercommand.cpp b/preclustercommand.cpp index cf42568..cac80b8 100644 --- a/preclustercommand.cpp +++ b/preclustercommand.cpp @@ -156,11 +156,11 @@ PreClusterCommand::PreClusterCommand(string option) { else { m->setGroupFile(groupfile); bygroup = true; } string temp = validParameter.validFile(parameters, "diffs", false); if(temp == "not found"){ temp = "1"; } - convert(temp, diffs); + m->mothurConvert(temp, diffs); temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); } @@ -372,6 +372,9 @@ int PreClusterCommand::createProcessesGroups(SequenceParser* parser, string newF //append output files for(int i=0;igetFullPathName(".\\" + newFName); + newNName = m->getFullPathName(".\\" + newNName); + cout << newFName << endl; m->appendFiles((newFName + toString(processIDS[i]) + ".temp"), newFName); m->mothurRemove((newFName + toString(processIDS[i]) + ".temp")); diff --git a/rarefactcommand.cpp b/rarefactcommand.cpp index 8d1cfc8..b8c1c6f 100644 --- a/rarefactcommand.cpp +++ b/rarefactcommand.cpp @@ -253,17 +253,17 @@ RareFactCommand::RareFactCommand(string option) { string temp; temp = validParameter.validFile(parameters, "freq", false); if (temp == "not found") { temp = "100"; } - convert(temp, freq); + m->mothurConvert(temp, freq); temp = validParameter.validFile(parameters, "abund", false); if (temp == "not found") { temp = "10"; } - convert(temp, abund); + m->mothurConvert(temp, abund); temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } - convert(temp, nIters); + m->mothurConvert(temp, nIters); temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "groupmode", false); if (temp == "not found") { temp = "T"; } groupMode = m->isTrue(temp); diff --git a/rarefactsharedcommand.cpp b/rarefactsharedcommand.cpp index b0d6650..64bdbb4 100644 --- a/rarefactsharedcommand.cpp +++ b/rarefactsharedcommand.cpp @@ -162,10 +162,10 @@ RareFactSharedCommand::RareFactSharedCommand(string option) { string temp; temp = validParameter.validFile(parameters, "freq", false); if (temp == "not found") { temp = "100"; } - convert(temp, freq); + m->mothurConvert(temp, freq); temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } - convert(temp, nIters); + m->mothurConvert(temp, nIters); temp = validParameter.validFile(parameters, "jumble", false); if (temp == "not found") { temp = "T"; } if (m->isTrue(temp)) { jumble = true; } diff --git a/readdistcommand.cpp b/readdistcommand.cpp index 788bdcb..8bf6996 100644 --- a/readdistcommand.cpp +++ b/readdistcommand.cpp @@ -121,7 +121,7 @@ ReadDistCommand::ReadDistCommand(string option) { //get user cutoff and precision or use defaults string temp; temp = validParameter.validFile(parameters, "precision", false); if (temp == "not found") { temp = "100"; } - convert(temp, precision); + m->mothurConvert(temp, precision); temp = validParameter.validFile(parameters, "sim", false); if (temp == "not found") { temp = "F"; } sim = m->isTrue(temp); diff --git a/removerarecommand.cpp b/removerarecommand.cpp index 351ace6..24b6165 100644 --- a/removerarecommand.cpp +++ b/removerarecommand.cpp @@ -220,7 +220,7 @@ RemoveRareCommand::RemoveRareCommand(string option) { string temp = validParameter.validFile(parameters, "nseqs", false); if (temp == "not found") { m->mothurOut("nseqs is a required parameter."); m->mothurOutEndLine(); abort = true; } - else { convert(temp, nseqs); } + else { m->mothurConvert(temp, nseqs); } temp = validParameter.validFile(parameters, "bygroup", false); if (temp == "not found") { temp = "f"; } byGroup = m->isTrue(temp); diff --git a/screenseqscommand.cpp b/screenseqscommand.cpp index ec2d8e0..16618f7 100644 --- a/screenseqscommand.cpp +++ b/screenseqscommand.cpp @@ -220,26 +220,26 @@ ScreenSeqsCommand::ScreenSeqsCommand(string option) { // ...at some point should added some additional type checking... string temp; temp = validParameter.validFile(parameters, "start", false); if (temp == "not found") { temp = "-1"; } - convert(temp, startPos); + m->mothurConvert(temp, startPos); temp = validParameter.validFile(parameters, "end", false); if (temp == "not found") { temp = "-1"; } - convert(temp, endPos); + m->mothurConvert(temp, endPos); temp = validParameter.validFile(parameters, "maxambig", false); if (temp == "not found") { temp = "-1"; } - convert(temp, maxAmbig); + m->mothurConvert(temp, maxAmbig); temp = validParameter.validFile(parameters, "maxhomop", false); if (temp == "not found") { temp = "-1"; } - convert(temp, maxHomoP); + m->mothurConvert(temp, maxHomoP); temp = validParameter.validFile(parameters, "minlength", false); if (temp == "not found") { temp = "-1"; } - convert(temp, minLength); + m->mothurConvert(temp, minLength); temp = validParameter.validFile(parameters, "maxlength", false); if (temp == "not found") { temp = "-1"; } - convert(temp, maxLength); + m->mothurConvert(temp, maxLength); temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "optimize", false); //optimizing trumps the optimized values original value if (temp == "not found"){ temp = "none"; } @@ -259,7 +259,7 @@ ScreenSeqsCommand::ScreenSeqsCommand(string option) { if (optimize.size() == 1) { if (optimize[0] == "none") { optimize.clear(); } } temp = validParameter.validFile(parameters, "criteria", false); if (temp == "not found"){ temp = "90"; } - convert(temp, criteria); + m->mothurConvert(temp, criteria); } } diff --git a/sensspeccommand.cpp b/sensspeccommand.cpp index 2fb2efb..82922ed 100644 --- a/sensspeccommand.cpp +++ b/sensspeccommand.cpp @@ -183,11 +183,11 @@ SensSpecCommand::SensSpecCommand(string option) { // cout << "name:\t" << nameFile << endl; temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "-1.00"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); // cout << cutoff << endl; temp = validParameter.validFile(parameters, "precision", false); if (temp == "not found") { temp = "100"; } - convert(temp, precision); + m->mothurConvert(temp, precision); // cout << precision << endl; string label = validParameter.validFile(parameters, "label", false); diff --git a/seqerrorcommand.cpp b/seqerrorcommand.cpp index 253e03e..9ac7c5b 100644 --- a/seqerrorcommand.cpp +++ b/seqerrorcommand.cpp @@ -213,7 +213,7 @@ SeqErrorCommand::SeqErrorCommand(string option) { //check for optional parameter and set defaults // ...at some point should added some additional type checking... temp = validParameter.validFile(parameters, "threshold", false); if (temp == "not found") { temp = "1.00"; } - convert(temp, threshold); + m->mothurConvert(temp, threshold); temp = validParameter.validFile(parameters, "save", false); if (temp == "not found"){ temp = "f"; } save = m->isTrue(temp); @@ -242,7 +242,7 @@ SeqErrorCommand::SeqErrorCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); substitutionMatrix.resize(6); for(int i=0;i<6;i++){ substitutionMatrix[i].resize(6,0); } diff --git a/seqsummarycommand.cpp b/seqsummarycommand.cpp index eeba041..93950d1 100644 --- a/seqsummarycommand.cpp +++ b/seqsummarycommand.cpp @@ -131,7 +131,7 @@ SeqSummaryCommand::SeqSummaryCommand(string option) { string temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); } diff --git a/shhhercommand.cpp b/shhhercommand.cpp index 13e7ccf..e266b98 100644 --- a/shhhercommand.cpp +++ b/shhhercommand.cpp @@ -251,19 +251,19 @@ ShhherCommand::ShhherCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found"){ temp = "0.01"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); temp = validParameter.validFile(parameters, "mindelta", false); if (temp == "not found"){ temp = "0.000001"; } - convert(temp, minDelta); + m->mothurConvert(temp, minDelta); temp = validParameter.validFile(parameters, "maxiter", false); if (temp == "not found"){ temp = "1000"; } - convert(temp, maxIters); + m->mothurConvert(temp, maxIters); temp = validParameter.validFile(parameters, "sigma", false);if (temp == "not found") { temp = "60"; } - convert(temp, sigma); + m->mothurConvert(temp, sigma); flowOrder = validParameter.validFile(parameters, "order", false); if (flowOrder == "not found"){ flowOrder = "TACG"; } diff --git a/shhhseqscommand.cpp b/shhhseqscommand.cpp index 8ef4c8c..6a339b8 100644 --- a/shhhseqscommand.cpp +++ b/shhhseqscommand.cpp @@ -37,7 +37,7 @@ string ShhhSeqsCommand::getHelpString(){ string helpString = ""; helpString += "The shhh.seqs command reads a fasta and name file and ....\n"; helpString += "The shhh.seqs command parameters are fasta, name, group, sigma and processors.\n"; - helpString += "The fasta parameter allows you to enter the fasta file containing your potentially sequences, and is required, unless you have a valid current fasta file. \n"; + helpString += "The fasta parameter allows you to enter the fasta file containing your sequences, and is required, unless you have a valid current fasta file. \n"; helpString += "The name parameter allows you to provide a name file associated with your fasta file. It is required. \n"; helpString += "The group parameter allows you to provide a group file. When checking sequences, only sequences from the same group as the query sequence will be used as the reference. \n"; helpString += "The processors parameter allows you to specify how many processors you would like to use. The default is 1. \n"; @@ -160,11 +160,11 @@ ShhhSeqsCommand::ShhhSeqsCommand(string option) { else { m->setGroupFile(groupfile); } string temp = validParameter.validFile(parameters, "sigma", false); if(temp == "not found"){ temp = "0.01"; } - convert(temp, sigma); + m->mothurConvert(temp, sigma); temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); } } catch(exception& e) { diff --git a/splitabundcommand.cpp b/splitabundcommand.cpp index 140f379..989ef59 100644 --- a/splitabundcommand.cpp +++ b/splitabundcommand.cpp @@ -213,7 +213,7 @@ SplitAbundCommand::SplitAbundCommand(string option) { accnos = m->isTrue(temp); temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "0"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); if (cutoff == 0) { m->mothurOut("You must provide a cutoff to qualify what is abundant for the split.abund command. "); m->mothurOutEndLine(); abort = true; } diff --git a/subsamplecommand.cpp b/subsamplecommand.cpp index 24c83fd..fe9e934 100644 --- a/subsamplecommand.cpp +++ b/subsamplecommand.cpp @@ -234,7 +234,7 @@ SubSampleCommand::SubSampleCommand(string option) { } string temp = validParameter.validFile(parameters, "size", false); if (temp == "not found"){ temp = "0"; } - convert(temp, size); + m->mothurConvert(temp, size); temp = validParameter.validFile(parameters, "persample", false); if (temp == "not found"){ temp = "f"; } persample = m->isTrue(temp); diff --git a/summarycommand.cpp b/summarycommand.cpp index 629750b..022b174 100644 --- a/summarycommand.cpp +++ b/summarycommand.cpp @@ -231,10 +231,10 @@ SummaryCommand::SummaryCommand(string option) { string temp; temp = validParameter.validFile(parameters, "abund", false); if (temp == "not found") { temp = "10"; } - convert(temp, abund); + m->mothurConvert(temp, abund); temp = validParameter.validFile(parameters, "size", false); if (temp == "not found") { temp = "0"; } - convert(temp, size); + m->mothurConvert(temp, size); temp = validParameter.validFile(parameters, "groupmode", false); if (temp == "not found") { temp = "T"; } groupMode = m->isTrue(temp); diff --git a/summaryqualcommand.cpp b/summaryqualcommand.cpp index 0969a12..421a8f2 100644 --- a/summaryqualcommand.cpp +++ b/summaryqualcommand.cpp @@ -131,7 +131,7 @@ SummaryQualCommand::SummaryQualCommand(string option) { string temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); } } catch(exception& e) { diff --git a/summarysharedcommand.cpp b/summarysharedcommand.cpp index c8d112f..7116e46 100644 --- a/summarysharedcommand.cpp +++ b/summarysharedcommand.cpp @@ -205,7 +205,7 @@ SummarySharedCommand::SummarySharedCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); if (abort == false) { diff --git a/treegroupscommand.cpp b/treegroupscommand.cpp index 3a8cd26..8c5aa4b 100644 --- a/treegroupscommand.cpp +++ b/treegroupscommand.cpp @@ -257,10 +257,10 @@ TreeGroupCommand::TreeGroupCommand(string option) { string temp; temp = validParameter.validFile(parameters, "precision", false); if (temp == "not found") { temp = "100"; } - convert(temp, precision); + m->mothurConvert(temp, precision); temp = validParameter.validFile(parameters, "cutoff", false); if (temp == "not found") { temp = "10"; } - convert(temp, cutoff); + m->mothurConvert(temp, cutoff); cutoff += (5 / (precision * 10.0)); //if the user changes the output directory command factory will send this info to us in the output parameter diff --git a/trimflowscommand.cpp b/trimflowscommand.cpp index c2ea534..77dacfe 100644 --- a/trimflowscommand.cpp +++ b/trimflowscommand.cpp @@ -149,10 +149,10 @@ TrimFlowsCommand::TrimFlowsCommand(string option) { string temp; temp = validParameter.validFile(parameters, "minflows", false); if (temp == "not found") { temp = "450"; } - convert(temp, minFlows); + m->mothurConvert(temp, minFlows); temp = validParameter.validFile(parameters, "maxflows", false); if (temp == "not found") { temp = "450"; } - convert(temp, maxFlows); + m->mothurConvert(temp, maxFlows); temp = validParameter.validFile(parameters, "oligos", true); @@ -164,28 +164,28 @@ TrimFlowsCommand::TrimFlowsCommand(string option) { else if(m->isTrue(temp)) { fasta = 1; } temp = validParameter.validFile(parameters, "maxhomop", false); if (temp == "not found"){ temp = "9"; } - convert(temp, maxHomoP); + m->mothurConvert(temp, maxHomoP); temp = validParameter.validFile(parameters, "signal", false); if (temp == "not found"){ temp = "0.50"; } - convert(temp, signal); + m->mothurConvert(temp, signal); temp = validParameter.validFile(parameters, "noise", false); if (temp == "not found"){ temp = "0.70"; } - convert(temp, noise); + m->mothurConvert(temp, noise); temp = validParameter.validFile(parameters, "bdiffs", false); if (temp == "not found"){ temp = "0"; } - convert(temp, bdiffs); + m->mothurConvert(temp, bdiffs); temp = validParameter.validFile(parameters, "pdiffs", false); if (temp == "not found"){ temp = "0"; } - convert(temp, pdiffs); + m->mothurConvert(temp, pdiffs); temp = validParameter.validFile(parameters, "tdiffs", false); if (temp == "not found"){ int tempTotal = pdiffs + bdiffs; temp = toString(tempTotal); } - convert(temp, tdiffs); + m->mothurConvert(temp, tdiffs); if(tdiffs == 0){ tdiffs = bdiffs + pdiffs; } temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); flowOrder = validParameter.validFile(parameters, "order", false); if (flowOrder == "not found"){ flowOrder = "TACG"; } diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index b804c8f..213e241 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -213,25 +213,25 @@ TrimSeqsCommand::TrimSeqsCommand(string option) { temp = validParameter.validFile(parameters, "maxambig", false); if (temp == "not found") { temp = "-1"; } - convert(temp, maxAmbig); + m->mothurConvert(temp, maxAmbig); temp = validParameter.validFile(parameters, "maxhomop", false); if (temp == "not found") { temp = "0"; } - convert(temp, maxHomoP); + m->mothurConvert(temp, maxHomoP); temp = validParameter.validFile(parameters, "minlength", false); if (temp == "not found") { temp = "0"; } - convert(temp, minLength); + m->mothurConvert(temp, minLength); temp = validParameter.validFile(parameters, "maxlength", false); if (temp == "not found") { temp = "0"; } - convert(temp, maxLength); + m->mothurConvert(temp, maxLength); temp = validParameter.validFile(parameters, "bdiffs", false); if (temp == "not found") { temp = "0"; } - convert(temp, bdiffs); + m->mothurConvert(temp, bdiffs); temp = validParameter.validFile(parameters, "pdiffs", false); if (temp == "not found") { temp = "0"; } - convert(temp, pdiffs); + m->mothurConvert(temp, pdiffs); temp = validParameter.validFile(parameters, "tdiffs", false); if (temp == "not found") { int tempTotal = pdiffs + bdiffs; temp = toString(tempTotal); } - convert(temp, tdiffs); + m->mothurConvert(temp, tdiffs); if(tdiffs == 0){ tdiffs = bdiffs + pdiffs; } @@ -246,7 +246,7 @@ TrimSeqsCommand::TrimSeqsCommand(string option) { else { nameFile = temp; m->setNameFile(nameFile); } temp = validParameter.validFile(parameters, "qthreshold", false); if (temp == "not found") { temp = "0"; } - convert(temp, qThreshold); + m->mothurConvert(temp, qThreshold); temp = validParameter.validFile(parameters, "qtrim", false); if (temp == "not found") { temp = "t"; } qtrim = m->isTrue(temp); @@ -277,7 +277,7 @@ TrimSeqsCommand::TrimSeqsCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); if(allFiles && (oligoFile == "")){ diff --git a/unifracunweightedcommand.cpp b/unifracunweightedcommand.cpp index c09301f..047d06e 100644 --- a/unifracunweightedcommand.cpp +++ b/unifracunweightedcommand.cpp @@ -171,7 +171,7 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(string option) { } itersString = validParameter.validFile(parameters, "iters", false); if (itersString == "not found") { itersString = "1000"; } - convert(itersString, iters); + m->mothurConvert(itersString, iters); string temp = validParameter.validFile(parameters, "distance", false); if (temp == "not found") { phylip = false; outputForm = ""; } @@ -188,7 +188,7 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); if (!random) { iters = 0; } //turn off random calcs diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp index bc9d0c5..b007db1 100644 --- a/unifracweightedcommand.cpp +++ b/unifracweightedcommand.cpp @@ -172,7 +172,7 @@ UnifracWeightedCommand::UnifracWeightedCommand(string option) { } itersString = validParameter.validFile(parameters, "iters", false); if (itersString == "not found") { itersString = "1000"; } - convert(itersString, iters); + m->mothurConvert(itersString, iters); string temp = validParameter.validFile(parameters, "distance", false); if (temp == "not found") { phylip = false; outputForm = ""; } @@ -189,7 +189,7 @@ UnifracWeightedCommand::UnifracWeightedCommand(string option) { temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); - convert(temp, processors); + m->mothurConvert(temp, processors); if (!random) { iters = 0; } //turn off random calcs } diff --git a/venncommand.cpp b/venncommand.cpp index b5b401d..1b4e3bc 100644 --- a/venncommand.cpp +++ b/venncommand.cpp @@ -193,7 +193,7 @@ VennCommand::VennCommand(string option) { string temp; temp = validParameter.validFile(parameters, "abund", false); if (temp == "not found") { temp = "10"; } - convert(temp, abund); + m->mothurConvert(temp, abund); temp = validParameter.validFile(parameters, "nseqs", false); if (temp == "not found"){ temp = "f"; } nseqs = m->isTrue(temp); @@ -202,7 +202,7 @@ VennCommand::VennCommand(string option) { perm = m->isTrue(temp); temp = validParameter.validFile(parameters, "fontsize", false); if (temp == "not found") { temp = "24"; } - convert(temp, fontsize); + m->mothurConvert(temp, fontsize); }