]> git.donarmstrong.com Git - mothur.git/blobdiff - readdistcommand.cpp
added list parameter to get.seqs and remove.seqs and added readline library for inter...
[mothur.git] / readdistcommand.cpp
index 579f848bdb75b10b1350d1eb61b589de8f543ee0..f6b41951962b7ce6b85ae50a9958bc0408c13835 100644 (file)
@@ -72,7 +72,7 @@ ReadDistCommand::ReadDistCommand(string option){
                        if (columnfile != "") {
                                if (namefile == "") {  cout << "You need to provide a namefile if you are going to use the column format." << endl; abort = true; }
                        }
-               
+                       
                        //check for optional parameter and set defaults
                        // ...at some point should added some additional type checking...
                        //get user cutoff and precision or use defaults
@@ -93,6 +93,7 @@ ReadDistCommand::ReadDistCommand(string option){
                                else if (format == "matrix") { 
                                        groupMap = new GroupMap(groupfile);
                                        groupMap->readMap();
+       
                                        if (globaldata->gGroupmap != NULL) { delete globaldata->gGroupmap;  }
                                        globaldata->gGroupmap = groupMap;
                                }
@@ -142,7 +143,10 @@ void ReadDistCommand::help(){
 
 ReadDistCommand::~ReadDistCommand(){
        if (abort == false) {
-               if (format != "matrix") { delete read; delete nameMap; }
+               if (format != "matrix") { 
+                       delete read; 
+                       delete nameMap; 
+               }
        }
 }
 
@@ -174,7 +178,7 @@ int ReadDistCommand::execute(){
                        if (globaldata->gSparseMatrix != NULL) { delete globaldata->gSparseMatrix;  }
                        globaldata->gSparseMatrix = read->getMatrix();
                        numDists = globaldata->gSparseMatrix->getNNodes();
+                       
       int lines = cutoff / (1.0/precision);
       vector<float> dist_cutoff(lines+1,0);
                        for (int i = 0; i <= lines;i++) {       
@@ -192,15 +196,15 @@ int ReadDistCommand::execute(){
         }
                        }
 
-      string dist_string = "Dist:";
-      string count_string = "Count: ";
-                       for (int i = 0; i <= lines;i++) {       
-       dist_string = dist_string.append("\t").append(toString(dist_cutoff[i]));
-       count_string = count_string.append("\t").append(toString(dist_count[i]));
-                       }
-      mothurOut(dist_string); mothurOutEndLine(); mothurOut(count_string); mothurOutEndLine();
+     // string dist_string = "Dist:";
+    //  string count_string = "Count: ";
+                       //for (int i = 0; i <= lines;i++) {     
+       //dist_string = dist_string.append("\t").append(toString(dist_cutoff[i]));
+      //       count_string = count_string.append("\t").append(toString(dist_count[i]));
+               //      }
+      //mothurOut(dist_string); mothurOutEndLine(); mothurOut(count_string); mothurOutEndLine();
                }
-               mothurOut("It took " + toString(time(NULL) - start) + " secs to read " + toString(numDists) + " distances (cutoff: " + toString(cutoff) + ")"); mothurOutEndLine();
+               mothurOut("It took " + toString(time(NULL) - start) + " secs to read "); mothurOutEndLine();
                return 0;
                
        }