if (abort == true) { return 0; }
time_t estart = time(NULL);
- int ndist = matrix->getNNodes();
+ //int ndist = matrix->getNNodes();
float previousDist = 0.00000;
float rndPreviousDist = 0.00000;
oldRAbund = *rabund;
sabundFile.close();
rabundFile.close();
listFile.close();
- if (isTrue(timing)) {
- mothurOut("It took " + toString(time(NULL) - estart) + " seconds to cluster " + toString(ndist) + " distances"); mothurOutEndLine();
- }
+ //if (isTrue(timing)) {
+ mothurOut("It took " + toString(time(NULL) - estart) + " seconds to cluster"); mothurOutEndLine();
+ //}
return 0;
}
catch(exception& e) {
}
cout << endl;
for (int i = 0; i < linkTable.size(); i++) {
+ cout << i << '\t';
for (it = linkTable[i].begin(); it != linkTable[i].end(); it++) {
- cout << it->first << '\t' << it->second << '\t' << '\t';
+ cout << it->first << '-' << it->second << '\t';
}
cout << endl;
}
activeLinks.erase(smallCol);
if(rowSpot>colSpot) { activeLinks[size] = colSpot; }
- else{ activeLinks[size] = colSpot-1; }
+ else{ activeLinks[size] = colSpot; }
//adjust everybody elses spot since you deleted - time vs. space
for (it = activeLinks.begin(); it != activeLinks.end(); it++) {
if (it->second > rowSpot) { activeLinks[it->first]--; }
}
-
//cout << "here4" << endl;
}
//find upmost parent of row and col
smallRow = getUpmostParent(smallRow);
smallCol = getUpmostParent(smallCol);
- //cout << "smallRow = " << smallRow << " smallCol = " << smallCol << endl;
+ //cout << "row = " << row << " smallRow = " << smallRow << " col = " << col << " smallCol = " << smallCol << " dist = " << distance << endl;
//are they active in the link table
int linkValue = makeActive(); //after this point this nodes info is active in linkTable
//cout << "linkValue = " << linkValue << " times = " << (clusterArray[smallRow].numSeq * clusterArray[smallCol].numSeq) << endl;
//can we cluster???
if (linkValue == (clusterArray[smallRow].numSeq * clusterArray[smallCol].numSeq)) {
+ //printInfo();
updateArrayandLinkTable();
clusterBins();
clusterNames();
//printInfo();
}
-
+ //printInfo();
return clustered;
}
catch(exception& e) {
struct clusterNode {
int numSeq;
int parent;
- int smallChild; //used to make linkTable work with list and rabund
+ int smallChild; //used to make linkTable work with list and rabund. represents bin number of this cluster node
clusterNode(int num, int par, int kid) : numSeq(num), parent(par), smallChild(kid) {};
};
globaldata->nameMap = NULL;
}
+ time_t estart = time(NULL);
+
if (!sorted) {
read = new ReadCluster(distfile, cutoff);
read->setFormat(format);
list = new ListVector(globaldata->nameMap->getListVector());
}
+ mothurOut("It took " + toString(time(NULL) - estart) + " seconds to sort. "); mothurOutEndLine();
+ estart = time(NULL);
+
//list vector made by read contains all sequence names
if(list != NULL){
rabund = new RAbundVector(list->getRAbundVector());
sabundFile.close();
rabundFile.close();
listFile.close();
- if (isTrue(timing)) {
- //mothurOut("It took " + toString(time(NULL) - estart) + " seconds to cluster " + toString(ndist) + " distances"); mothurOutEndLine();
- }
+
+ //if (isTrue(timing)) {
+ mothurOut("It took " + toString(time(NULL) - estart) + " seconds to cluster. "); mothurOutEndLine();
+ //}
return 0;
}
catch(exception& e) {
if (abort == true) { return 0; }
- //time_t start = time(NULL);
+ time_t start = time(NULL);
size_t numDists = 0;
if (format == "matrix") {
// }
//mothurOut(dist_string); mothurOutEndLine(); mothurOut(count_string); mothurOutEndLine();
}
- //mothurOut("It took " + toString(time(NULL) - start) + " secs to read " + toString(numDists) + " distances (cutoff: " + toString(cutoff) + ")"); mothurOutEndLine();
+ mothurOut("It took " + toString(time(NULL) - start) + " secs to read "); mothurOutEndLine();
return 0;
}
else {
//valid paramters for this command
- string Array[] = {"list","order","shared", "label","group","sabund", "rabund"};
+ string Array[] = {"list","order","shared", "label","group","sabund", "rabund","groups"};
vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
OptionParser parser(option);
groupMap->readMap();
globaldata->gGroupmap = groupMap;
}
+
+ groups = validParameter.validFile(parameters, "groups", false);
+ if (groups == "not found") { groups = ""; }
+ else {
+ splitAtDash(groups, Groups);
+ globaldata->Groups = Groups;
+ }
//you are doing a list and group shared
if ((listfile != "") && (groupfile != "")) { globaldata->setFormat("shared"); }
InputData* input;
Command* shared;
GroupMap* groupMap;
- string filename, listfile, orderfile, sharedfile, label, groupfile, sabundfile, rabundfile, format;
+ string filename, listfile, orderfile, sharedfile, label, groupfile, sabundfile, rabundfile, format, groups;
+ vector<string> Groups;
bool abort, allLines;
set<string> labels; //holds labels to be used