X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=shhhercommand.cpp;h=c40963999f953e2cfc534afcfdaec1a1e56b8c72;hb=01f8d2c7d982a6209211f5abbcf2a086fdf60d0a;hp=115e930969323ba4655e0b5ba5c2a8e1166a1397;hpb=d70a1c2d70c5a516e74880709e3b48cfc1ce0321;p=mothur.git diff --git a/shhhercommand.cpp b/shhhercommand.cpp index 115e930..c409639 100644 --- a/shhhercommand.cpp +++ b/shhhercommand.cpp @@ -802,7 +802,7 @@ string ShhherCommand::createNamesFile(){ duplicateNames[mapSeqToUnique[i]] += seqNameVector[i] + ','; } - string nameFileName = outputDir + m->getRootName(m->getSimpleName(flowFileName) + getOutputFileNameTag("name"); + string nameFileName = outputDir + m->getRootName(m->getSimpleName(flowFileName)) + getOutputFileNameTag("name"); ofstream nameFile; m->openOutputFile(nameFileName, nameFile); @@ -1039,7 +1039,12 @@ void ShhherCommand::getFlowData(){ float intensity; - flowFile >> numFlowCells; + string numFlowTest; + flowFile >> numFlowTest; + + if (!m->isContainingOnlyDigits(numFlowTest)) { m->mothurOut("[ERROR]: expected a number and got " + numFlowTest + ", quitting. Did you use the flow parameter instead of the file parameter?"); m->mothurOutEndLine(); exit(1); } + else { convert(numFlowTest, numFlowCells); } + int index = 0;//pcluster while(!flowFile.eof()){ @@ -1376,17 +1381,17 @@ string ShhherCommand::cluster(string distFileName, string namesFileName){ try { ReadMatrix* read = new ReadColumnMatrix(distFileName); - read->setCutoff(cutoff); - - NameAssignment* clusterNameMap = new NameAssignment(namesFileName); - clusterNameMap->readMap(); - read->read(clusterNameMap); - - ListVector* list = read->getListVector(); - SparseMatrix* matrix = read->getMatrix(); + read->setCutoff(cutoff); + + NameAssignment* clusterNameMap = new NameAssignment(namesFileName); + clusterNameMap->readMap(); + read->read(clusterNameMap); - delete read; - delete clusterNameMap; + ListVector* list = read->getListVector(); + SparseDistanceMatrix* matrix = read->getDMatrix(); + + delete read; + delete clusterNameMap; RAbundVector* rabund = new RAbundVector(list->getRAbundVector()); @@ -2029,7 +2034,7 @@ int ShhherCommand::createProcesses(vector filenames){ //Windows version shared memory, so be careful when passing variables through the shhhFlowsData struct. //Above fork() will clone, so memory is separate, but that's not the case with windows, ////////////////////////////////////////////////////////////////////////////////////////////////////// - + /* vector pDataArray; DWORD dwThreadIdArray[processors-1]; HANDLE hThreadArray[processors-1]; @@ -2060,7 +2065,7 @@ int ShhherCommand::createProcesses(vector filenames){ CloseHandle(hThreadArray[i]); delete pDataArray[i]; } - + */ #endif for (int i=0;i filenames, string thisCompositeFASTAFil if (m->control_pressed) { break; } vector otuCounts(numOTUs, 0); - for(int i=0;i& thisSeqNameVecto thisFlowDataIntI.clear(); thisNameMap.clear(); - flowFile >> numFlowCells; + string numFlowTest; + flowFile >> numFlowTest; + + if (!m->isContainingOnlyDigits(numFlowTest)) { m->mothurOut("[ERROR]: expected a number and got " + numFlowTest + ", quitting. Did you use the flow parameter instead of the file parameter?"); m->mothurOutEndLine(); exit(1); } + else { convert(numFlowTest, numFlowCells); } + if (m->debug) { m->mothurOut("[DEBUG]: numFlowCells = " + toString(numFlowCells) + ".\n"); } int index = 0;//pcluster while(!flowFile.eof()){ @@ -2632,7 +2642,7 @@ int ShhherCommand::cluster(string filename, string distFileName, string namesFil read->read(clusterNameMap); ListVector* list = read->getListVector(); - SparseMatrix* matrix = read->getMatrix(); + SparseDistanceMatrix* matrix = read->getDMatrix(); delete read; delete clusterNameMap;