}else{ nameMap = NULL; }
readMatrix->read(nameMap);
+
+ if (m->control_pressed) { delete readMatrix; delete groupMap; return 0; }
//get matrix
if (globaldata->gListVector != NULL) { delete globaldata->gListVector; }
// via the index of a sequence in the distance matrix
seqVec = vector<SeqMap>(globaldata->gListVector->size());
for (MatData currentCell = matrix->begin(); currentCell != matrix->end(); currentCell++) {
+ if (m->control_pressed) { delete readMatrix; delete groupMap; return 0; }
seqVec[currentCell->row][currentCell->column] = currentCell->dist;
}
delete matrix;
delete readMatrix;
+
+ if (m->control_pressed) { delete groupMap; return 0; }
}else {
//process file and set up indexes
if (format == "column") { formatMatrix = new FormatColumnMatrix(distFile); }
}else{ nameMap = NULL; }
formatMatrix->read(nameMap);
+
+ if (m->control_pressed) { delete formatMatrix; delete groupMap; return 0; }
//get matrix
if (globaldata->gListVector != NULL) { delete globaldata->gListVector; }
//openfile for getMap to use
openInputFile(distFile, inRow);
+
+ if (m->control_pressed) { inRow.close(); remove(distFile.c_str()); delete groupMap; return 0; }
}
+
//globaldata->gListVector bin 0 = first name read in distance matrix, globaldata->gListVector bin 1 = second name read in distance matrix
if (globaldata->gListVector != NULL) {
vector<string> names;
//read fastafile
fasta->readFastaFile(fastafile);
+
+ if (m->control_pressed) {
+ if (large) { inRow.close(); remove(distFile.c_str()); }
+ delete groupMap; delete fasta; return 0;
+ }
//if user gave a namesfile then use it
if (namefile != "") { readNamesFile(); }
//if the users enters label "0.06" and there is no "0.06" in their file use the next lowest label.
set<string> processedLabels;
set<string> userLabels = labels;
+
+ if (m->control_pressed) {
+ if (large) { inRow.close(); remove(distFile.c_str()); }
+ delete groupMap; delete fasta; delete read; delete input; delete list; globaldata->gListVector = NULL; return 0;
+ }
while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
error = process(list);
if (error == 1) { return 0; } //there is an error in hte input files, abort command
+ if (m->control_pressed) {
+ if (large) { inRow.close(); remove(distFile.c_str()); }
+ if (groupfile != "") { delete groupMap; globaldata->gGroupmap = NULL; }
+ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
+ delete fasta; delete read; delete input; delete list; globaldata->gListVector = NULL; return 0;
+ }
+
processedLabels.insert(list->getLabel());
userLabels.erase(list->getLabel());
}
error = process(list);
if (error == 1) { return 0; } //there is an error in hte input files, abort command
+ if (m->control_pressed) {
+ if (large) { inRow.close(); remove(distFile.c_str()); }
+ if (groupfile != "") { delete groupMap; globaldata->gGroupmap = NULL; }
+ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
+ delete fasta; delete read; delete input; delete list; globaldata->gListVector = NULL; return 0;
+ }
+
processedLabels.insert(list->getLabel());
userLabels.erase(list->getLabel());
error = process(list);
delete list;
if (error == 1) { return 0; } //there is an error in hte input files, abort command
+
+ if (m->control_pressed) {
+ if (large) { inRow.close(); remove(distFile.c_str()); }
+ if (groupfile != "") { delete groupMap; globaldata->gGroupmap = NULL; }
+ for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); }
+ delete fasta; delete read; delete input; delete list; globaldata->gListVector = NULL; return 0;
+ }
}
//close and remove formatted matrix file
delete groupMap; globaldata->gGroupmap = NULL;
}
+ if (m->control_pressed) { return 0; }
+
m->mothurOutEndLine();
m->mothurOut("Output File Names: "); m->mothurOutEndLine();
for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
SeqMap::iterator it;
SeqMap currMap;
for (size_t i=0; i < seqIndex.size(); i++) {
+ if (m->control_pressed) { return "control"; }
if (!large) { currMap = seqVec[seqIndex[i]]; }
else { currMap = getMap(seqIndex[i]); }
float min = 10000;
int minIndex;
for (size_t i=0; i < max_dist.size(); i++) {
+ if (m->control_pressed) { return "control"; }
if (max_dist[i] < min) {
min = max_dist[i];
minIndex = i;
for (int i = 0; i < processList->size(); i++) {
string groups;
int binsize;
+
+ if (m->control_pressed) { out.close(); newNamesOutput.close(); return 0; }
+
nameRep = findRep(i, groups, processList, binsize);
+ if (m->control_pressed) { out.close(); newNamesOutput.close(); return 0; }
+
//output to new names file
newNamesOutput << nameRep << '\t' << processList->get(i) << endl;