X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=readcluster.cpp;h=af71cbc96f1cca200bb8e5f66258703917f6ac53;hb=2a07f8664a7fd1ef0d572b88e8b5bede24cc0b3c;hp=acbebaeece94faf995cd9d1a26112e40185314b8;hpb=aa9238c0a9e6e7aa0ed8b8b606b08ad4fd7dcfe3;p=mothur.git diff --git a/readcluster.cpp b/readcluster.cpp index acbebae..af71cbc 100644 --- a/readcluster.cpp +++ b/readcluster.cpp @@ -11,11 +11,14 @@ /***********************************************************************/ -ReadCluster::ReadCluster(string distfile, float c){ +ReadCluster::ReadCluster(string distfile, float c, string o, bool s){ globaldata = GlobalData::getInstance(); m = MothurOut::getInstance(); distFile = distfile; cutoff = c; + outputDir = o; + sortWanted = s; + list = NULL; } /***********************************************************************/ @@ -28,7 +31,8 @@ int ReadCluster::read(NameAssignment* nameMap){ if (m->control_pressed) { return 0; } - OutPutFile = sortFile(distFile); + if (sortWanted) { OutPutFile = sortFile(distFile, outputDir); } + else { OutPutFile = distFile; } //for use by clusters splitMatrix to convert a phylip matrix to column return 0; @@ -50,7 +54,7 @@ int ReadCluster::convertPhylip2Column(NameAssignment* nameMap){ ofstream out; string tempFile = distFile + ".column.temp"; - openInputFile(distFile, in); + openInputFile(distFile, in); gobble(in); openOutputFile(tempFile, out); float distance; @@ -173,7 +177,7 @@ int ReadCluster::convertPhylip2Column(NameAssignment* nameMap){ list->setLabel("0"); in.close(); out.close(); - + if(nameMap == NULL){ nameMap = new NameAssignment(); for(int i=0;icontrol_pressed) { remove(outputFile.c_str()); } return 0;