X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=getmetacommunitycommand.cpp;h=8f78ca2a45fce56f6ef8996c880b48677ae32357;hp=ad069d00745fd3627015c6166cd4101047f8284c;hb=050a3ff02473a3d4c0980964e1a9ebe52e55d6b8;hpb=2cfb747aa8f63bde9c1114001e6d2e81ccd26178 diff --git a/getmetacommunitycommand.cpp b/getmetacommunitycommand.cpp index ad069d0..8f78ca2 100644 --- a/getmetacommunitycommand.cpp +++ b/getmetacommunitycommand.cpp @@ -35,14 +35,14 @@ vector GetMetaCommunityCommand::setParameters(){ string GetMetaCommunityCommand::getHelpString(){ try { string helpString = ""; - helpString += "The get.metacommunity command parameters are shared, label, groups, minpartitions, maxpartitions, optimizegap and processors. The shared file is required. \n"; + helpString += "The get.communitytype command parameters are shared, label, groups, minpartitions, maxpartitions, optimizegap and processors. The shared file is required. \n"; helpString += "The label parameter is used to analyze specific labels in your input. labels are separated by dashes.\n"; helpString += "The groups parameter allows you to specify which of the groups in your shared file you would like analyzed. Group names are separated by dashes.\n"; helpString += "The minpartitions parameter is used to .... Default=5.\n"; helpString += "The maxpartitions parameter is used to .... Default=10.\n"; helpString += "The optimizegap parameter is used to .... Default=3.\n"; helpString += "The processors parameter allows you to specify number of processors to use. The default is 1.\n"; - helpString += "The get.metacommunity command should be in the following format: get.metacommunity(shared=yourSharedFile).\n"; + helpString += "The get.communitytype command should be in the following format: get.communitytype(shared=yourSharedFile).\n"; return helpString; } catch(exception& e) { @@ -324,7 +324,7 @@ int GetMetaCommunityCommand::createProcesses(vector& thislo } for (int i = 0; i < processors; i++) { //read from everyone elses, just write to yours - string tempDoneFile = toString(i) + ".done.temp"; + string tempDoneFile = m->getRootName(m->getSimpleName(sharedfile)) + toString(i) + ".done.temp"; doneFlags.push_back(tempDoneFile); ofstream out; m->openOutputFile(tempDoneFile, out); //clear out @@ -363,6 +363,7 @@ int GetMetaCommunityCommand::createProcesses(vector& thislo } //do my part + m->mothurOut("K\tNLE\t\tlogDet\tBIC\t\tAIC\t\tLaplace\n"); minPartition = processDriver(thislookup, dividedPartitions[0], outputFileName, rels[0], matrix[0], doneFlags, 0); //force parent to wait until all the processes are done @@ -486,10 +487,11 @@ int GetMetaCommunityCommand::createProcesses(vector& thislo delete pDataArray[i]; } */ //do my part + m->mothurOut("K\tNLE\t\tlogDet\tBIC\t\tAIC\t\tLaplace\n"); minPartition = processDriver(thislookup, dividedPartitions[0], outputFileName, rels[0], matrix[0], doneFlags, 0); #endif for (int i = 0; i < processors; i++) { //read from everyone elses, just write to yours - string tempDoneFile = toString(i) + ".done.temp"; + string tempDoneFile = m->getRootName(m->getSimpleName(sharedfile)) + toString(i) + ".done.temp"; m->mothurRemove(tempDoneFile); } @@ -524,9 +526,9 @@ int GetMetaCommunityCommand::processDriver(vector& thislook cout.setf(ios::showpoint); vector< vector > sharedMatrix; - for (int i = 0; i < thislookup.size(); i++) { sharedMatrix.push_back(thislookup[i]->getAbundances()); } + vector thisGroups; + for (int i = 0; i < thislookup.size(); i++) { sharedMatrix.push_back(thislookup[i]->getAbundances()); thisGroups.push_back(thislookup[i]->getGroup()); } - m->mothurOut("K\tNLE\t\tlogDet\tBIC\t\tAIC\t\tLaplace\n"); fitData << "K\tNLE\tlogDet\tBIC\tAIC\tLaplace" << endl; for(int i=0;i& thislook string matrixName = matrix[i]; outputNames.push_back(matrixName); outputTypes["matrix"].push_back(matrixName); - findQ.printZMatrix(matrixName, m->getGroups()); + findQ.printZMatrix(matrixName, thisGroups); findQ.printRelAbund(relabund, m->currentBinLabels); if(optimizegap != -1 && (numPartitions - minPartition) >= optimizegap && numPartitions >= minpartitions){ - string tempDoneFile = toString(processID) + ".done.temp"; + string tempDoneFile = m->getRootName(m->getSimpleName(sharedfile)) + toString(processID) + ".done.temp"; ofstream outDone; m->openOutputFile(tempDoneFile, outDone); outDone << minPartition << endl;