+#endif
+
+ //if user gave a phylip file convert to column file
+ if (format == "phylip") {
+ estart = time(NULL);
+ m->mothurOut("Converting to column format..."); m->mothurOutEndLine();
+
+ ReadCluster* convert = new ReadCluster(distfile, cutoff, outputDir, false);
+
+ NameAssignment* nameMap = NULL;
+ convert->setFormat("phylip");
+ convert->read(nameMap);
+
+ if (m->control_pressed) { delete convert; return 0; }
+
+ distfile = convert->getOutputFile();
+
+ //if no names file given with phylip file, create it
+ ListVector* listToMakeNameFile = convert->getListVector();
+ if ((namefile == "") && (countfile == "")) { //you need to make a namefile for split matrix
+ ofstream out;
+ namefile = phylipfile + ".names";
+ m->openOutputFile(namefile, out);
+ for (int i = 0; i < listToMakeNameFile->getNumBins(); i++) {
+ string bin = listToMakeNameFile->get(i);
+ out << bin << '\t' << bin << endl;
+ }
+ out.close();
+ }
+ delete listToMakeNameFile;
+ delete convert;
+
+ m->mothurOut("It took " + toString(time(NULL) - estart) + " seconds to convert the distance file."); m->mothurOutEndLine();
+ }
+ if (m->control_pressed) { return 0; }
+
+ estart = time(NULL);
+ m->mothurOut("Splitting the file..."); m->mothurOutEndLine();
+
+ //split matrix into non-overlapping groups
+ SplitMatrix* split;
+ if (splitmethod == "distance") { split = new SplitMatrix(distfile, namefile, countfile, taxFile, cutoff, splitmethod, large); }
+ else if (splitmethod == "classify") { split = new SplitMatrix(distfile, namefile, countfile, taxFile, taxLevelCutoff, splitmethod, large); }
+ else if (splitmethod == "fasta") { split = new SplitMatrix(fastafile, namefile, countfile, taxFile, taxLevelCutoff, cutoff, splitmethod, processors, classic, outputDir); }
+ else { m->mothurOut("Not a valid splitting method. Valid splitting algorithms are distance, classify or fasta."); m->mothurOutEndLine(); return 0; }
+
+ split->split();
+
+ if (m->control_pressed) { delete split; return 0; }
+
+ singletonName = split->getSingletonNames();
+ distName = split->getDistanceFiles(); //returns map of distance files -> namefile sorted by distance file size
+ delete split;
+
+ if (m->debug) { m->mothurOut("[DEBUG]: distName.size() = " + toString(distName.size()) + ".\n"); }
+
+ //output a merged distance file
+ //if (splitmethod == "fasta") { createMergedDistanceFile(distName); }