]> git.donarmstrong.com Git - mothur.git/blobdiff - preclustercommand.cpp
added binary file operations to mothurout class. added comment to sequence class...
[mothur.git] / preclustercommand.cpp
index c2564c1f769a835fd85559f10811672eb6a34e0d..fe722a669f2c0ca983c94ef21cc73dc95f5719bc 100644 (file)
@@ -192,7 +192,7 @@ PreClusterCommand::PreClusterCommand(string option) {
                        else if (countfile == "not open") { abort = true; countfile =  ""; }    
                        else {   
                 m->setCountTableFile(countfile); 
-                ct.readTable(countfile);
+                ct.readTable(countfile, true, false);
                 if (ct.hasGroupInfo()) { bygroup = true; }
                 else { bygroup = false;  }
             }
@@ -300,6 +300,7 @@ int PreClusterCommand::execute(){
                        m->mothurOut("It took " + toString(time(NULL) - start) + " secs to run pre.cluster."); m->mothurOutEndLine(); 
                                
                }else {
+            if (processors != 1) { m->mothurOut("When using running without group information mothur can only use 1 processor, continuing."); m->mothurOutEndLine(); processors = 1; }
                        if (namefile != "") { readNameFile(); }
                
                        //reads fasta file and return number of seqs
@@ -597,7 +598,7 @@ int PreClusterCommand::process(string newMapFile){
                     out << "ideal_seq_" << (i+1) << '\t' << alignSeqs[i].numIdentical << endl << chunk << endl;;
                     
                 }//end if active i
-                if(i % 100 == 0)       { m->mothurOut(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)); m->mothurOutEndLine(); }
+                if(i % 100 == 0)       { m->mothurOutJustToScreen(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)+"\n");       }
             }
         }else {
             map<int, string> mapFile;
@@ -632,7 +633,7 @@ int PreClusterCommand::process(string newMapFile){
                     }//end abundance check
                 }//end for loop j
                 
-                if(i % 100 == 0)       { m->mothurOut(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)); m->mothurOutEndLine(); }
+                if(i % 100 == 0)       { m->mothurOutJustToScreen(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)+"\n");       }
             }
             
             for (int i = 0; i < numSeqs; i++) {
@@ -903,15 +904,9 @@ void PreClusterCommand::readNameFile(){
                while (!in.eof()) {
                        in >> firstCol >> secondCol; m->gobble(in);
             
-            for (int i = 0; i < firstCol.length(); i++) {
-                if (firstCol[i] == ':') { firstCol[i] = '_'; m->changedSeqNames = true; }
-            }
-            
-            int size = 1;
-            for (int i = 0; i < secondCol.length(); i++) {
-                if (secondCol[i] == ':') { secondCol[i] = '_'; m->changedSeqNames = true; }
-                else if(secondCol[i] == ','){  size++; }
-            }
+            m->checkName(firstCol);
+            m->checkName(secondCol);
+            int size = m->getNumNames(secondCol);
             
                        names[firstCol] = secondCol;
             sizes[firstCol] = size;