CommandParameter pprecision("precision", "Number", "", "100", "", "", "","",false,false); parameters.push_back(pprecision);
CommandParameter plabel("label", "String", "", "", "", "", "","",false,false); parameters.push_back(plabel);
CommandParameter pgroups("groups", "String", "", "", "", "", "","",false,false); parameters.push_back(pgroups);
- CommandParameter pcalc("calc", "Multiple", "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan-kstest-sharednseqs-ochiai-anderberg-kulczynski-kulczynskicody-lennon-morisitahorn-braycurtis-whittaker-odum-canberra-structeuclidean-structchord-hellinger-manhattan-structpearson-soergel-spearman-structkulczynski-speciesprofile-hamming-structchi2-gower-memchi2-memchord-memeuclidean-mempearson", "jclass-thetayc", "", "", "","",true,false,true); parameters.push_back(pcalc);
+ CommandParameter pcalc("calc", "Multiple", "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan-kstest-sharednseqs-ochiai-anderberg-kulczynski-kulczynskicody-lennon-morisitahorn-braycurtis-whittaker-odum-canberra-structeuclidean-structchord-hellinger-manhattan-structpearson-soergel-spearman-structkulczynski-speciesprofile-hamming-structchi2-gower-memchi2-memchord-memeuclidean-mempearson-jsd-rjsd", "jclass-thetayc", "", "", "","",true,false,true); parameters.push_back(pcalc);
CommandParameter pprocessors("processors", "Number", "", "1", "", "", "","",false,false,true); parameters.push_back(pprocessors);
//CommandParameter poutput("output", "Multiple", "lt-square", "lt", "", "", "",false,false); parameters.push_back(poutput);
treeCalculators.push_back(new MemEuclidean());
}else if (Estimators[i] == "mempearson") {
treeCalculators.push_back(new MemPearson());
- }
+ }else if (Estimators[i] == "jsd") {
+ treeCalculators.push_back(new JSD());
+ }else if (Estimators[i] == "rjsd") {
+ treeCalculators.push_back(new RJSD());
+ }
+
}
}
readMatrix->read(nameMap);
}else if (countfile != "") {
ct = new CountTable();
- ct->readTable(countfile);
+ ct->readTable(countfile, true, false);
readMatrix->read(ct);
}else {
readMatrix->read(nameMap);
if (lookup.size() < 2) { m->mothurOut("You have not provided enough valid groups. I cannot run the command."); m->mothurOutEndLine(); m->control_pressed = true; return 0; }
}
-
numGroups = lookup.size();
+
+ //sanity check to make sure processors < numComparisions
+ int numDists = 0;
+ for(int i=0;i<numGroups;i++){
+ for(int j=0;j<i;j++){
+ numDists++;
+ if (numDists > processors) { break; }
+ }
+ }
+ if (numDists < processors) { processors = numDists; }
+
lines.resize(processors);
for (int i = 0; i < processors; i++) {
lines[i].start = int (sqrt(float(i)/float(processors)) * numGroups);
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
//loop through and create all the processes you want
while (process != processors) {
- int pid = fork();
+ pid_t pid = fork();
if (pid > 0) {
processIDS.push_back(pid);
driver(thisItersLookup, lines[process].start, lines[process].end, calcDists);
- string tempdistFileName = m->getRootName(m->getSimpleName(sharedfile)) + toString(getpid()) + ".dist";
+ string tempdistFileName = m->getRootName(m->getSimpleName(sharedfile)) + m->mothurGetpid(process) + ".dist";
ofstream outtemp;
m->openOutputFile(tempdistFileName, outtemp);
thisItersLookup.clear();
for (int i = 0; i < calcDists.size(); i++) { calcDists[i].clear(); }
}
+
+ if (m->debug) { m->mothurOut("[DEBUG]: iter = " + toString(thisIter) + ".\n"); }
}
if (m->debug) { m->mothurOut("[DEBUG]: done with iters.\n"); }