+
+ method = validParameter.validFile(parameters, "method", false); if (method == "not found") { method = "furthest"; }
+
+
+ if ((method == "furthest") || (method == "nearest") || (method == "average")) { }
+ else {cout << "Not a valid clustering method. Valid clustering algorithms are furthest, nearest or average." << endl; abort = true; }
+
+
+ if (abort == false) {
+
+ //get matrix, list and rabund for execute
+ if(globaldata->gSparseMatrix != NULL) { matrix = globaldata->gSparseMatrix; }
+
+ if(globaldata->gListVector != NULL){
+ list = globaldata->gListVector;
+ rabund = new RAbundVector(list->getRAbundVector());
+ }
+
+ //create cluster
+ if(method == "furthest") { cluster = new CompleteLinkage(rabund, list, matrix); tag = "fn"; }
+ else if(method == "nearest"){ cluster = new SingleLinkage(rabund, list, matrix); tag = "nn"; }
+ else if(method == "average"){ cluster = new AverageLinkage(rabund, list, matrix); tag = "an"; }
+ else { cout << "error - not recognized method" << endl; abort = true; }
+
+ fileroot = getRootName(globaldata->inputFileName);
+
+ openOutputFile(fileroot+ tag + ".sabund", sabundFile);
+ openOutputFile(fileroot+ tag + ".rabund", rabundFile);
+ openOutputFile(fileroot+ tag + ".list", listFile);
+
+
+ }
+