if (large) { splitDistanceLarge(); }
else { splitDistanceRAM(); }
+
+ return 0;
}
catch(exception& e) {
set<string> names;
for (int i = 0; i < numGroups; i++) { //remove old temp files, just in case
- remove((fastafile + "." + toString(i) + ".temp").c_str());
+ m->mothurRemove((fastafile + "." + toString(i) + ".temp"));
}
ifstream in;
for (int i = 0; i < numGroups; i++) {
string options = "fasta=" + (fastafile + "." + toString(i) + ".temp") + ", processors=" + toString(processors) + ", cutoff=" + toString(distCutoff);
+ if (outputDir != "") { options += ", outputdir=" + outputDir; }
Command* command = new DistanceCommand(options);
command->execute();
delete command;
- remove((fastafile + "." + toString(i) + ".temp").c_str());
+ m->mothurRemove((fastafile + "." + toString(i) + ".temp"));
//remove old names files just in case
- remove((namefile + "." + toString(i) + ".temp").c_str());
+ m->mothurRemove((namefile + "." + toString(i) + ".temp"));
}
singleton = namefile + ".extra.temp";
remainingNames << name << '\t' << nameList << endl;
}
in.close();
- remove(tempNameFile.c_str());
+ m->mothurRemove(tempNameFile);
}
}
fileHandle.close();
remainingNames.close();
if (!wroteExtra) {
- remove(singleton.c_str());
+ m->mothurRemove(singleton);
singleton = "none";
}
- if (m->control_pressed) { for (int i = 0; i < dists.size(); i++) { remove((dists[i].begin()->first).c_str()); remove((dists[i].begin()->second).c_str()); } dists.clear(); }
+ if (m->control_pressed) { for (int i = 0; i < dists.size(); i++) { m->mothurRemove((dists[i].begin()->first)); m->mothurRemove((dists[i].begin()->second)); } dists.clear(); }
return 0;
}
ofstream outFile;
for (int i = 0; i < numGroups; i++) { //remove old temp files, just in case
- remove((distFile + "." + toString(i) + ".temp").c_str());
+ m->mothurRemove((distFile + "." + toString(i) + ".temp"));
}
//for buffering the io to improve speed
string seqA, seqB;
float dist;
- if (m->control_pressed) { dFile.close(); for (int i = 0; i < numGroups; i++) { remove((distFile + "." + toString(i) + ".temp").c_str()); } }
+ if (m->control_pressed) { dFile.close(); for (int i = 0; i < numGroups; i++) { m->mothurRemove((distFile + "." + toString(i) + ".temp")); } }
dFile >> seqA >> seqB >> dist; m->gobble(dFile);
dFile.close();
for (int i = 0; i < numGroups; i++) { //remove old temp files, just in case
- remove((namefile + "." + toString(i) + ".temp").c_str());
+ m->mothurRemove((namefile + "." + toString(i) + ".temp"));
//write out any remaining buffers
if (numOutputs[i] > 0) {
remainingNames << name << '\t' << nameList << endl;
}
in.close();
- remove(tempNameFile.c_str());
+ m->mothurRemove(tempNameFile);
}
}
remainingNames.close();
if (!wroteExtra) {
- remove(singleton.c_str());
+ m->mothurRemove(singleton);
singleton = "none";
}
if (m->control_pressed) {
for (int i = 0; i < dists.size(); i++) {
- remove((dists[i].begin()->first).c_str());
- remove((dists[i].begin()->second).c_str());
+ m->mothurRemove((dists[i].begin()->first));
+ m->mothurRemove((dists[i].begin()->second));
}
dists.clear();
}
dFile >> seqA >> seqB >> dist;
- if (m->control_pressed) { dFile.close(); for(int i=0;i<numGroups;i++){ if(groups[i].size() > 0){ remove((distFile + "." + toString(i) + ".temp").c_str()); } } return 0; }
+ if (m->control_pressed) { dFile.close(); for(int i=0;i<numGroups;i++){ if(groups[i].size() > 0){ m->mothurRemove((distFile + "." + toString(i) + ".temp")); } } return 0; }
if(dist < cutoff){
//cout << "in cutoff: " << dist << endl;
delete memblock;
fileB.close();
- remove(fileName2.c_str());
+ m->mothurRemove(fileName2);
//write out the merged memory
if (numOutputs[groupID] > 60) {
delete memblock;
fileB.close();
- remove(fileName2.c_str());
+ m->mothurRemove(fileName2);
//write out the merged memory
if (numOutputs[groupID] > 60) {
if (m->control_pressed) {
for (int i = 0; i < dists.size(); i++) {
- remove((dists[i].begin()->first).c_str());
- remove((dists[i].begin()->second).c_str());
+ m->mothurRemove((dists[i].begin()->first));
+ m->mothurRemove((dists[i].begin()->second));
}
dists.clear();
}
dFile >> seqA >> seqB >> dist;
- if (m->control_pressed) { dFile.close(); for(int i=0;i<numGroups;i++){ if(groups[i].size() > 0){ remove((distFile + "." + toString(i) + ".temp").c_str()); } } return 0; }
+ if (m->control_pressed) { dFile.close(); for(int i=0;i<numGroups;i++){ if(groups[i].size() > 0){ m->mothurRemove((distFile + "." + toString(i) + ".temp")); } } return 0; }
if(dist < cutoff){
//cout << "in cutoff: " << dist << endl;