]> git.donarmstrong.com Git - mothur.git/blobdiff - clustercommand.cpp
fixed parsimony bug
[mothur.git] / clustercommand.cpp
index 79728164fcde1cbe0e8f528e6826825dfbb4a752..f0ef51f05b846797a42c8e71cacce326db06f4bb 100644 (file)
@@ -106,9 +106,18 @@ int ClusterCommand::execute(){
                else if(rndPreviousDist<cutoff){
                        printData(toString(rndPreviousDist, length-1));
                }
-       
+               
+               //delete globaldata's copy of the sparsematrix and listvector to free up memory
+               SparseMatrix* clearM = NULL;
+               globaldata->setSparseMatrix(clearM);
+               ListVector* clearL = NULL;
+               globaldata->setListVector(clearL);
+
+               
                //saves .list file so you can do the collect, rarefaction and summary commands without doing a read.list
-               globaldata->setDistFile("");
+               if (globaldata->getFormat() == "phylip") { globaldata->setPhylipFile(""); }
+               else if (globaldata->getFormat() == "column") { globaldata->setColumnFile(""); }
+               
                globaldata->setListFile(fileroot+ tag + ".list");
                globaldata->setNameFile("");
                globaldata->setFormat("list");