]> git.donarmstrong.com Git - mothur.git/commitdiff
1.23.0
authorwestcott <westcott>
Wed, 4 Jan 2012 13:31:41 +0000 (13:31 +0000)
committerwestcott <westcott>
Wed, 4 Jan 2012 13:31:41 +0000 (13:31 +0000)
69 files changed:
aligncommand.cpp
aligncommand.h
amovacommand.cpp
anosimcommand.cpp
bootstrapsharedcommand.cpp
chimerabellerophoncommand.cpp
chimeraccodecommand.cpp
chimeracheckcommand.cpp
chimeraperseuscommand.cpp
chimerapintailcommand.cpp
chimeraslayercommand.cpp
chimerauchimecommand.cpp
chopseqscommand.cpp
classifyotucommand.cpp
classifyseqscommand.cpp
classifyseqscommand.h
clustercommand.cpp
clusterdoturcommand.cpp
clusterfragmentscommand.cpp
clustersplitcommand.cpp
collectcommand.cpp
collectsharedcommand.cpp
consensusseqscommand.cpp
corraxescommand.cpp
distancecommand.cpp
engine.cpp
filterseqscommand.cpp
getoturepcommand.cpp
hclustercommand.cpp
heatmapcommand.cpp
heatmapsimcommand.cpp
homovacommand.cpp
indicatorcommand.cpp
libshuffcommand.cpp
mantelcommand.cpp
matrixoutputcommand.cpp
metastatscommand.cpp
mgclustercommand.cpp
mothurout.cpp
mothurout.h
nmdscommand.cpp
normalizesharedcommand.cpp
pairwiseseqscommand.cpp
parsimonycommand.cpp
phylodiversitycommand.cpp
phylotypecommand.cpp
pipelinepdscommand.cpp
preclustercommand.cpp
rarefactcommand.cpp
rarefactsharedcommand.cpp
readdistcommand.cpp
removerarecommand.cpp
screenseqscommand.cpp
sensspeccommand.cpp
seqerrorcommand.cpp
seqsummarycommand.cpp
shhhercommand.cpp
shhhseqscommand.cpp
splitabundcommand.cpp
subsamplecommand.cpp
summarycommand.cpp
summaryqualcommand.cpp
summarysharedcommand.cpp
treegroupscommand.cpp
trimflowscommand.cpp
trimseqscommand.cpp
unifracunweightedcommand.cpp
unifracweightedcommand.cpp
venncommand.cpp

index 960d70229a084923fd1cc8dc368ff4b71d815cbd..f03a9017d4867f1d8634a0ef72a25f1590bf13b6 100644 (file)
@@ -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);
                                
index fa1bf57468e31c114224841019b338020e574b21..7f5122a66039c4dcd90c338dad078d11ce81e601 100644 (file)
@@ -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;
index de277ab6edad4828ee5a35f37474cd4a3a8eee55..3ec14bf7c06af5883e7eb6d9b3b38449ceac83be 100644 (file)
@@ -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) {
index 50b6f283d8d58de276b0a08f573894628a98295f..1b6afe35b760ed140b6747d02a41ce5d4424fca1 100644 (file)
@@ -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); 
                }
                
        }
index d24942179feea5c328505292d2433f141c8bf1b0..de9657420aabb0f8dd817a7bfe1fb4339bc3144e 100644 (file)
@@ -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) {
                        
index ac1645dd4e1f4f271cad18240c80814cf87c2b03..1fc87db562bf2994465ee3b9e043f4a961c4e844 100644 (file)
@@ -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) {
index 7468011ee79e22c9f796733cb9db651f7e5e53f1..af6e33a1254adc623948604100f8b9109e6c18e6 100644 (file)
@@ -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); 
index 400a715aeedf604efb80e580f6c345677f74a430..9f53b1753903a44b469f0766a261894cb3177476 100644 (file)
@@ -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) {
index 61970d53ac38a3f9877e5a010e48bc0b336dc669..8eaf536040a5703bbd7d9f4b93329f79cf6c6830 100644 (file)
@@ -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) {
index 062779335148afcc61fb1fd51236467776b9d19b..3eb6589a83beebf79f8cf812ce519b35d0bcc37e 100644 (file)
@@ -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); 
index 0512be1a70b1d12b0667f5945e4d1acb5b4768d8..cfcad1514ca629823081f54e35156934275644b1 100644 (file)
@@ -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 = ""; }
index 40b3f2683fbdc47770dd3a4292df5ae8cc6fbf75..01289a0d0edf66969827d65a11a703c24da86845 100644 (file)
@@ -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; }
index abfd8dc239b185a69e86e7641a8505761ff9766e..68576cdb521efc994bedf2d3b2d40cc98a740b9c 100644 (file)
@@ -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);  
index f36631a0590725867dffc402f74fd73af6168e20..e28961b74888ee5bdefb9eb022fd11afe328e07f 100644 (file)
@@ -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);
index af6d91449065af894f086c497cfcbc171f374098..9ee7b5e946a7f5819cbac94bab7efe8c0cb71aef 100644 (file)
@@ -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); 
 
 
                        
index eef96ffbe5d32f88f9f9552165b299f0247505dc..0e21a203caaa0c4a8166d7ecb08a685cd36f3169 100644 (file)
@@ -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();
index 47f55311cc6037a7dca827338d51ab903027fc40..528f71c11c24f7a47133bef2d60a6906249abe92 100644 (file)
@@ -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);
index 0d57e68a8a0b656798e107dd7f69eea6d7b9205c..603bd73d680b485fb4df6ef6cf62e935af3f1ff5 100644 (file)
@@ -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"; }
index 8d2d3eac9ba398dbce884d61c99dd81b3f2442b6..ad1bd81b4a9d4554751cfbbc5eb836e107e7b53d 100644 (file)
@@ -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);
                        
                }
                                
index 7505ae66e453fff787d807117ed2e026f658e6a0..787d84aa3ef40042f3e2358283648ba63e8eb098 100644 (file)
@@ -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"; }
                        
index a65b417ed8cfcb82ff11847c3a58633589ed6c41..e0d62dd5ddd7acd106d18af31de013f6fce9c462 100644 (file)
@@ -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); 
                }
                
        }
index a5721b0a528b563c881a8815e74b6a7fd25a0299..f3a320b89e0695483a5124b6336d68cf89179293 100644 (file)
@@ -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);
index e32867f3737b27bc3b9e929a73f142fe564d48c4..4f8c53bc9b8cd70fab82a13cd8507a8e5719a07a 100644 (file)
@@ -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);      }
index b943aa4bf9dd962a4364af7069d24eb64c380a78..4e9c3c6270b9142ba69963ab0ee2283668473a8b 100644 (file)
@@ -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";             }
                        
index 0f067aeab3b6ce1a50ba5e60870b410bbf72ba67..65edcf75366d4096b1256266b05296146c30167b 100644 (file)
@@ -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);
index 670af78757abf5ac2b25ff2adcd4c7b41257e9ee..ea1c0e14dc9f89fe0157d24828a2e9552297389c 100644 (file)
@@ -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(); }
index d17f6a32749a44cf84ce24d1cdb251fd982020a1..82c73f3d439c1d3cc154c8dac67398075134a1e8 100644 (file)
@@ -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") { 
index 2f6f810e0add659c6c661cef7e383fd36b2f8ad2..35437e760ac636e51cf9f960d8c36e8a6dfce47e 100644 (file)
@@ -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));
                }
        }
index b2af0349c9b341a635ad9eb341a3a5e35198f90e..47136938a19e6c5d4b8dd2b8110849249ac50b06 100644 (file)
@@ -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);
index 57c4c86b44bf2ccf9368c2c8c26acc1e67d360af..7d9b482564287916f599b0f3148ee4d6a80861f2 100644 (file)
@@ -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") { 
index d78b3cf1af17a3d10b25b7238e94b8b8ff69f002..de35075e98ee938e67f1880cada0ebfb1e0ba26a 100644 (file)
@@ -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;
index 18690048c712c69bad1b1e9aa44c4e6b64a8cee9..9b7ec9fb030becda2b3df217afedcdd40facd4cc 100644 (file)
@@ -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); 
                }
                
        }
index 40d3bcd26f42ff67b424ee6087bc276ceccbd752..1864f7473b0e21ff06d84ce76968f81374189954 100644 (file)
@@ -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?
index 1e8102f49f40753d239f8188f1a88cc9e3578587..1d1d41fadb4ca36994cefa4dc1c2d608126a93b1 100644 (file)
@@ -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); 
index c3ab352a0119ad3aad7ee0959b7c387522a642d1..409eae414779acb412abec7aa295b61e82cd0e16 100644 (file)
@@ -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; }
                }
index f5737c766f61d759bf8fae8c5dba74de73b1ed52..d1cf54ba03216996b3335e030e6db7d80efd7222 100644 (file)
@@ -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";  }
index 0ff8b3f7b92369beff5414b605c3696ca14dd50f..b7aa7e5fcb3bcc809c89ac3cc82c1ecae9d6272a 100644 (file)
@@ -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);
                }
 
        }
index f0886c8c133c12a84c627304cafbe8173ef45519..9c45afe95277b5c7106e3f87f64e60e53b9bf321 100644 (file)
@@ -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); 
index c58e634500270cce359470ebc56f7244ef994c8c..9dcdc80e761f1483059297dbcd996a0a06b43e5b 100644 (file)
@@ -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<vector<double> > MothurOut::binomial(int maxOrder){
index 5ba3d083677a35f4ef0004506bf63f25facb481f..d2a36b351902f3bc25d7c2132fb2c20f15421b23 100644 (file)
@@ -53,7 +53,7 @@ class MothurOut {
                vector<string> binLabelsInFile;
                vector<string> 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<string, vector<string> >&);
                int readNames(string, vector<seqPriorityNode>&, map<string, string>&);
                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();
index da82784f56124d5a360294fb9cc7c4b6b1114307..1d936d458d2edb69e6d49f51d8a79171389ea544 100644 (file)
@@ -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; }
index 43c8e2260c4e678bbd2e7718a6313b15d97eed8b..bbf9a8335a3c2847f89b8cf136670c03a73e9725 100644 (file)
@@ -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; }
                        }
                        
index 2245ac9a80a1ccd94b7f13273fb80f4ab6f004b7..114f545aa26eb326f078b6ab7e1b18e024ecdcb5 100644 (file)
@@ -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); 
index 3752935aac5ad0211c5f9bf5b66ca00dce2b366b..ccf29526f5e803049371c452bcdcf7ddad10da48 100644 (file)
@@ -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);
                        
                }
 
index ca0d02aca04b0a737d45c29b44cb02c2925ff257..69c7b304623e44878cdafb8925fbffd9f45cd718 100644 (file)
@@ -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 = "";  }
index e6dace8b796103804c16a4de86104cff0b05da4f..00f960bbbab8d07ecbee08dc01b78907c60c0185 100644 (file)
@@ -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; }
index 898ad9b72640a4f5c9050f98b399e23efeafd58d..968ba4f66a9d233a14e5f579e9563ac4d9bbd706 100644 (file)
@@ -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();
index cf4256851eb583a78b78fd5ab800bbfa5d46f5e8..cac80b8d775d2e5bd4810198e69a2d5ad625c04d 100644 (file)
@@ -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;i<processIDS.size();i++){
+                       newFName = m->getFullPathName(".\\" + newFName);
+                       newNName = m->getFullPathName(".\\" + newNName);
+                       cout << newFName << endl;
                        m->appendFiles((newFName + toString(processIDS[i]) + ".temp"), newFName);
                        m->mothurRemove((newFName + toString(processIDS[i]) + ".temp"));
                        
index 8d1cfc864d35d12d2127672f68af60802cd8b02d..b8c1c6f1a6420f8a139eb5c71b0320b87277035e 100644 (file)
@@ -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);
index b0d6650a605bb053704e9827b8366fea3aac3665..64bdbb4ceebd18f5abeff63b26fbb4d4ac3dc924 100644 (file)
@@ -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; }
index 788bdcbfef41f0afeb080782e1bae651f8666258..8bf6996333b246814a28009d309ab8f3b6bf8718 100644 (file)
@@ -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); 
index 351ace6db7ea98c033514086004091e6352f663e..24b616560de3bed794d423f4cb7a3544f0d48f5f 100644 (file)
@@ -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);
index ec2d8e003a31a712de8c32d255d164b6b13cd46c..16618f74cc8e251c7d28d10ca37fcd2e7b09d017 100644 (file)
@@ -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); 
                }
 
        }
index 2fb2efbc25ef434850f87115bc6d93a91a23dd6f..82922ededbff38fd76909d1694742c6adac7666b 100644 (file)
@@ -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);                    
index 253e03e2a1d380cb4d13f360fc9a5fecaaeb0808..9ac7c5bcef6fee9c8e01b7838a3560f3478c5fcc 100644 (file)
@@ -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);      }
index eeba0417b08f90aeb19d0ecf3664010133ad88fe..93950d1f6222c10af735808d87130213b6664017 100644 (file)
@@ -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);
 
 
                }
index 13e7ccfd496d035c151eaade308f9832af76b511..e266b98837f4a787975319c7e098904cae552209 100644 (file)
@@ -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";              }
index 8ef4c8c24f6d7a6398631591f0e7a2a34d7965c1..6a339b880eb54eedaa7be7af3c297ed0089beb10 100644 (file)
@@ -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) {
index 140f37909039c4eb44580c745d1886a1534d78d9..989ef596168ff1894009fd8c625edc881197ef87 100644 (file)
@@ -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;  }
 
index 24c83fdc2142a0ad875cba6ff49ffd3d15b73fef..fe9e93423969796187dd59452f7e3a3496d4ee57 100644 (file)
@@ -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);
index 629750bbccb5ed027edf5ef53dbba3686ddb4bba..022b174a5c21f4de6f26c2dcd8232b0744da8120 100644 (file)
@@ -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);
index 0969a1216f3f2152ef21d0e453a6920dff1d663a..421a8f2ad36c64e218aa68a4eb6fd8dc651362d0 100644 (file)
@@ -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) {
index c8d112fd3031d4995e4675a3dbe3d4daf91aebf9..7116e46e0f9e96045fc3c60a717ae41819949118 100644 (file)
@@ -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) {
                        
index 3a8cd2681893851b0f81dd6eea434c3f29814a68..8c5aa4bbdc926515c6e3796a3a7969aa9abffca9 100644 (file)
@@ -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 
index c2ea5346125d31ed6779b1b7f20c9280a79678c1..77dacfe711ea694d7d81cb7536fd15d14cb0ec97 100644 (file)
@@ -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";              }
index b804c8f16638e329e4f665b34c36dd46a84f6dfe..213e241ccfc6ee8feeb6c34ed9b589343c7c71d1 100644 (file)
@@ -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 == "")){
index c09301f62be0cba7bb2eee024442cc94e6e5c0a3..047d06e27fadff92f647f75875f038f4bf8b04fd 100644 (file)
@@ -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
                        
index bc9d0c5048f198ac6e30309e4af0255c67dcf605..b007db1f6eddc2d8e6119add616803b1d58526a2 100644 (file)
@@ -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
                }
index b5b401de349fcf9d57253582d7c68d9c6cd3f99a..1b4e3bc70848d7511c1dcd136fb4c320e4265b11 100644 (file)
@@ -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);
 
                }