string outputFileName = outputDir + getRootName(getSimpleName(fastaFileNames[i])) + "bellerophon.chimeras";
string accnosFileName = outputDir + getRootName(getSimpleName(fastaFileNames[i])) + "bellerophon.accnos";
- bool hasAccnos = true;
chimera->getChimeras();
if (m->control_pressed) { remove(accnosFileName.c_str()); remove(outputFileName.c_str()); for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } delete chimera; return 0; }
- //delete accnos file if its blank
- if (isBlank(accnosFileName)) { remove(accnosFileName.c_str()); hasAccnos = false; }
-
m->mothurOutEndLine(); m->mothurOut("It took " + toString(time(NULL) - start) + " secs to check " + toString(numSeqs) + " sequences."); m->mothurOutEndLine(); m->mothurOutEndLine();
outputNames.push_back(outputFileName);
- if (hasAccnos) { outputNames.push_back(accnosFileName); }
+ outputNames.push_back(accnosFileName);
delete chimera;
}
}
string mapInfo = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + "mapinfo";
- bool hasAccnos = true;
if (m->control_pressed) { delete chimera; for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } return 0; }
int pid, end, numSeqsPerProcessor;
int tag = 2001;
vector<long> MPIPos;
- MPIWroteAccnos = false;
-
+
MPI_Status status;
MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
MPI_Comm_size(MPI_COMM_WORLD, &processors);
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); MPI_File_close(&outMPIAccnos); remove(outputFileName.c_str()); remove(accnosFileName.c_str()); for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } delete chimera; return 0; }
- for (int i = 1; i < processors; i++) {
- bool tempResult;
- MPI_Recv(&tempResult, 1, MPI_INT, i, tag, MPI_COMM_WORLD, &status);
- if (tempResult != 0) { MPIWroteAccnos = true; }
- }
}else{ //you are a child process
MPI_Recv(&numSeqs, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);
MPIPos.resize(numSeqs+1);
driverMPI(startIndex, numSeqsPerProcessor, inMPI, outMPI, outMPIAccnos, MPIPos);
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); MPI_File_close(&outMPIAccnos); for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } delete chimera; return 0; }
-
- MPI_Send(&MPIWroteAccnos, 1, MPI_INT, 0, tag, MPI_COMM_WORLD);
}
//close files
MPI_File_close(&outMPIAccnos);
MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case
-
- //delete accnos file if blank
- if (pid == 0) {
- if (!MPIWroteAccnos) {
- hasAccnos = false;
- remove(accnosFileName.c_str());
- }
- }
#else
ofstream outHeader;
return 0;
}
- //delete accnos file if its blank
- if (isBlank(accnosFileName)) { remove(accnosFileName.c_str()); hasAccnos = false; }
-
}else{
vector<int> positions;
processIDS.resize(0);
createProcesses(outputFileName, fastaFileNames[s], accnosFileName);
rename((outputFileName + toString(processIDS[0]) + ".temp").c_str(), outputFileName.c_str());
+ rename((accnosFileName + toString(processIDS[0]) + ".temp").c_str(), accnosFileName.c_str());
//append output files
for(int i=1;i<processors;i++){
remove((outputFileName + toString(processIDS[i]) + ".temp").c_str());
}
- vector<string> nonBlankAccnosFiles;
- //delete blank accnos files generated with multiple processes
- for(int i=0;i<processors;i++){
- if (!(isBlank(accnosFileName + toString(processIDS[i]) + ".temp"))) {
- nonBlankAccnosFiles.push_back(accnosFileName + toString(processIDS[i]) + ".temp");
- }else { remove((accnosFileName + toString(processIDS[i]) + ".temp").c_str()); }
+ //append output files
+ for(int i=1;i<processors;i++){
+ appendFiles((accnosFileName + toString(processIDS[i]) + ".temp"), accnosFileName);
+ remove((accnosFileName + toString(processIDS[i]) + ".temp").c_str());
}
- //append accnos files
- if (nonBlankAccnosFiles.size() != 0) {
- rename(nonBlankAccnosFiles[0].c_str(), accnosFileName.c_str());
-
- for (int h=1; h < nonBlankAccnosFiles.size(); h++) {
- appendFiles(nonBlankAccnosFiles[h], accnosFileName);
- remove(nonBlankAccnosFiles[h].c_str());
- }
- }else{ hasAccnos = false; }
-
if (m->control_pressed) {
remove(outputFileName.c_str());
remove(accnosFileName.c_str());
return 0;
}
- //delete accnos file if its blank
- if (isBlank(accnosFileName)) { remove(accnosFileName.c_str()); hasAccnos = false; }
#endif
appendFiles(outputFileName, tempHeader);
outputNames.push_back(outputFileName);
outputNames.push_back(mapInfo);
- if (hasAccnos) { outputNames.push_back(accnosFileName); }
+ outputNames.push_back(accnosFileName);
for (int i = 0; i < lines.size(); i++) { delete lines[i]; } lines.clear();
//print results
bool isChimeric = chimera->print(outMPI, outAccMPI);
- if (isChimeric) { MPIWroteAccnos = true; }
}
}
delete candidateSeq;
int driverMPI(int, int, MPI_File&, MPI_File&, MPI_File&, vector<long>&);
#endif
- bool abort, filter, MPIWroteAccnos;
+ bool abort, filter;
string fastafile, templatefile, outputDir, maskfile;
int processors, window, numwanted, numSeqs, templateSeqsLength;
Chimera* chimera;
outputFileName = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + "pintail.chimeras";
accnosFileName = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + "pintail.accnos";
}
- bool hasAccnos = true;
if (m->control_pressed) { delete chimera; for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } return 0; }
int pid, end, numSeqsPerProcessor;
int tag = 2001;
vector<long> MPIPos;
- MPIWroteAccnos = false;
MPI_Status status;
MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); MPI_File_close(&outMPIAccnos); remove(outputFileName.c_str()); remove(accnosFileName.c_str()); for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } delete chimera; return 0; }
- for (int i = 1; i < processors; i++) {
- bool tempResult;
- MPI_Recv(&tempResult, 1, MPI_INT, i, tag, MPI_COMM_WORLD, &status);
- if (tempResult != 0) { MPIWroteAccnos = true; }
- }
}else{ //you are a child process
MPI_Recv(&numSeqs, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);
MPIPos.resize(numSeqs+1);
driverMPI(startIndex, numSeqsPerProcessor, inMPI, outMPI, outMPIAccnos, MPIPos);
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); MPI_File_close(&outMPIAccnos); for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } delete chimera; return 0; }
-
- MPI_Send(&MPIWroteAccnos, 1, MPI_INT, 0, tag, MPI_COMM_WORLD);
}
//close files
MPI_File_close(&outMPI);
MPI_File_close(&outMPIAccnos);
MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case
-
- //delete accnos file if blank
- if (pid == 0) {
- if (!MPIWroteAccnos) {
- hasAccnos = false;
- remove(accnosFileName.c_str());
- }
- }
-
#else
//break up file
return 0;
}
- //delete accnos file if its blank
- if (isBlank(accnosFileName)) { remove(accnosFileName.c_str()); hasAccnos = false; }
-
}else{
vector<int> positions;
processIDS.resize(0);
createProcesses(outputFileName, fastaFileNames[s], accnosFileName);
rename((outputFileName + toString(processIDS[0]) + ".temp").c_str(), outputFileName.c_str());
+ rename((accnosFileName + toString(processIDS[0]) + ".temp").c_str(), accnosFileName.c_str());
//append output files
for(int i=1;i<processors;i++){
remove((outputFileName + toString(processIDS[i]) + ".temp").c_str());
}
- vector<string> nonBlankAccnosFiles;
- //delete blank accnos files generated with multiple processes
- for(int i=0;i<processors;i++){
- if (!(isBlank(accnosFileName + toString(processIDS[i]) + ".temp"))) {
- nonBlankAccnosFiles.push_back(accnosFileName + toString(processIDS[i]) + ".temp");
- }else { remove((accnosFileName + toString(processIDS[i]) + ".temp").c_str()); }
+ //append output files
+ for(int i=1;i<processors;i++){
+ appendFiles((accnosFileName + toString(processIDS[i]) + ".temp"), accnosFileName);
+ remove((accnosFileName + toString(processIDS[i]) + ".temp").c_str());
}
-
- //append accnos files
- if (nonBlankAccnosFiles.size() != 0) {
- rename(nonBlankAccnosFiles[0].c_str(), accnosFileName.c_str());
-
- for (int h=1; h < nonBlankAccnosFiles.size(); h++) {
- appendFiles(nonBlankAccnosFiles[h], accnosFileName);
- remove(nonBlankAccnosFiles[h].c_str());
- }
- }else{ hasAccnos = false; }
-
+
if (m->control_pressed) {
remove(outputFileName.c_str());
remove(accnosFileName.c_str());
delete chimera;
return 0;
}
-
- //delete accnos file if its blank
- if (isBlank(accnosFileName)) { remove(accnosFileName.c_str()); hasAccnos = false; }
#endif
#endif
for (int i = 0; i < lines.size(); i++) { delete lines[i]; } lines.clear();
outputNames.push_back(outputFileName);
- if (hasAccnos) { outputNames.push_back(accnosFileName); }
+ outputNames.push_back(accnosFileName);
m->mothurOutEndLine();
m->mothurOutEndLine(); m->mothurOut("It took " + toString(time(NULL) - start) + " secs to check " + toString(numSeqs) + " sequences."); m->mothurOutEndLine();
//print results
bool isChimeric = chimera->print(outMPI, outAccMPI);
- if (isChimeric) { MPIWroteAccnos = true; }
}
}
delete candidateSeq;
int driverMPI(int, int, MPI_File&, MPI_File&, MPI_File&, vector<long>&);
#endif
- bool abort, filter, MPIWroteAccnos;
+ bool abort, filter;
string fastafile, templatefile, consfile, quanfile, maskfile, outputDir, inputDir;
int processors, window, increment, numSeqs, templateSeqsLength;
Chimera* chimera;
m->mothurOut("This command was modeled after the chimeraSlayer written by the Broad Institute.\n");
m->mothurOut("The chimera.slayer command parameters are fasta, template, processors, ksize, window, match, mismatch, divergence. minsim, mincov, minbs, minsnp, parents, search, iters, increment and numwanted.\n"); //realign,
m->mothurOut("The fasta parameter allows you to enter the fasta file containing your potentially chimeric sequences, and is required. \n");
- m->mothurOut("You may enter multiple fasta files by separating their names with dashes. ie. fasta=abrecovery.fasta-amzon.fasta \n");
+ m->mothurOut("You may enter multiple fasta files by separating their names with dashes. ie. fasta=abrecovery.fasta-amazon.fasta \n");
m->mothurOut("The template parameter allows you to enter a template file containing known non-chimeric sequences, and is required. \n");
m->mothurOut("The processors parameter allows you to specify how many processors you would like to use. The default is 1. \n");
#ifdef USE_MPI
string outputFileName = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + "slayer.chimeras";
string accnosFileName = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + "slayer.accnos";
- bool hasAccnos = true;
if (m->control_pressed) { delete chimera; for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } return 0; }
int pid, end, numSeqsPerProcessor;
int tag = 2001;
vector<long> MPIPos;
- MPIWroteAccnos = false;
MPI_Status status;
MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); MPI_File_close(&outMPIAccnos); for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } remove(outputFileName.c_str()); remove(accnosFileName.c_str()); delete chimera; return 0; }
- for (int i = 1; i < processors; i++) {
- bool tempResult;
- MPI_Recv(&tempResult, 1, MPI_INT, i, tag, MPI_COMM_WORLD, &status);
- if (tempResult != 0) { MPIWroteAccnos = true; }
- }
}else{ //you are a child process
MPI_Recv(&numSeqs, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);
MPIPos.resize(numSeqs+1);
driverMPI(startIndex, numSeqsPerProcessor, inMPI, outMPI, outMPIAccnos, MPIPos);
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); MPI_File_close(&outMPIAccnos); for (int j = 0; j < outputNames.size(); j++) { remove(outputNames[j].c_str()); } delete chimera; return 0; }
-
- MPI_Send(&MPIWroteAccnos, 1, MPI_INT, 0, tag, MPI_COMM_WORLD);
}
//close files
MPI_File_close(&outMPIAccnos);
MPI_Barrier(MPI_COMM_WORLD); //make everyone wait - just in case
- //delete accnos file if blank
- if (pid == 0) {
- if (!MPIWroteAccnos) {
- hasAccnos = false;
- remove(accnosFileName.c_str());
- }
- }
-
#else
ofstream outHeader;
string tempHeader = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + "slayer.chimeras.tempHeader";
return 0;
}
- //delete accnos file if its blank
- if (isBlank(accnosFileName)) { remove(accnosFileName.c_str()); hasAccnos = false; }
-
}else{
vector<int> positions;
processIDS.resize(0);
createProcesses(outputFileName, fastaFileNames[s], accnosFileName);
rename((outputFileName + toString(processIDS[0]) + ".temp").c_str(), outputFileName.c_str());
+ rename((accnosFileName + toString(processIDS[0]) + ".temp").c_str(), accnosFileName.c_str());
//append output files
for(int i=1;i<processors;i++){
remove((outputFileName + toString(processIDS[i]) + ".temp").c_str());
}
- vector<string> nonBlankAccnosFiles;
- //delete blank accnos files generated with multiple processes
- for(int i=0;i<processors;i++){
- if (!(isBlank(accnosFileName + toString(processIDS[i]) + ".temp"))) {
- nonBlankAccnosFiles.push_back(accnosFileName + toString(processIDS[i]) + ".temp");
- }else { remove((accnosFileName + toString(processIDS[i]) + ".temp").c_str()); }
+ //append output files
+ for(int i=1;i<processors;i++){
+ appendFiles((accnosFileName + toString(processIDS[i]) + ".temp"), accnosFileName);
+ remove((accnosFileName + toString(processIDS[i]) + ".temp").c_str());
}
- //append accnos files
- if (nonBlankAccnosFiles.size() != 0) {
- rename(nonBlankAccnosFiles[0].c_str(), accnosFileName.c_str());
-
- for (int h=1; h < nonBlankAccnosFiles.size(); h++) {
- appendFiles(nonBlankAccnosFiles[h], accnosFileName);
- remove(nonBlankAccnosFiles[h].c_str());
- }
- }else{ hasAccnos = false; }
-
if (m->control_pressed) {
remove(outputFileName.c_str());
remove(accnosFileName.c_str());
return 0;
}
- //delete accnos file if its blank
- if (isBlank(accnosFileName)) { remove(accnosFileName.c_str()); hasAccnos = false; }
#endif
appendFiles(outputFileName, tempHeader);
for (int i = 0; i < lines.size(); i++) { delete lines[i]; } lines.clear();
outputNames.push_back(outputFileName);
- if (hasAccnos) { outputNames.push_back(accnosFileName); }
+ outputNames.push_back(accnosFileName);
m->mothurOutEndLine(); m->mothurOut("It took " + toString(time(NULL) - start) + " secs to check " + toString(numSeqs) + " sequences."); m->mothurOutEndLine();
- }
+ }
m->mothurOutEndLine();
m->mothurOut("Output File Names: "); m->mothurOutEndLine();
//cout << "about to print" << endl;
//print results
bool isChimeric = chimera->print(outMPI, outAccMPI);
- if (isChimeric) { MPIWroteAccnos = true; }
-
}
}
delete candidateSeq;
int driverMPI(int, int, MPI_File&, MPI_File&, MPI_File&, vector<long>&);
#endif
- bool abort, realign, MPIWroteAccnos;
+ bool abort, realign;
string fastafile, templatefile, outputDir, search;
int processors, window, iters, increment, numwanted, ksize, match, mismatch, parents, minSimilarity, minCoverage, minBS, minSNP, numSeqs, templateSeqsLength;
float divR;
in.close();
out.close();
- if (wroteSomething == false) {
- m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine();
- remove(outputFileName.c_str());
- }else { outputNames.push_back(outputFileName); }
+ if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
+ outputNames.push_back(outputFileName);
return 0;
in.close();
out.close();
- if (wroteSomething == false) {
- m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine();
- remove(outputFileName.c_str());
- }else { outputNames.push_back(outputFileName); }
+ if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
+ outputNames.push_back(outputFileName);
return 0;
in.close();
out.close();
- if (wroteSomething == false) {
- m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine();
- remove(outputFileName.c_str());
- }else { outputNames.push_back(outputFileName); }
+ if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
+ outputNames.push_back(outputFileName);
return 0;
in.close();
out.close();
- if (wroteSomething == false) {
- m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine();
- remove(outputFileName.c_str());
- }else { outputNames.push_back(outputFileName); }
+ if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
+ outputNames.push_back(outputFileName);
return 0;
in.close();
out.close();
- if (wroteSomething == false) {
- m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine();
- remove(outputFileName.c_str());
- }else { outputNames.push_back(outputFileName); }
-
+ if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
+ outputNames.push_back(outputFileName);
+
return 0;
}
in.close();
out.close();
- if (wroteSomething == false) {
- m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine();
- remove(outputFileName.c_str());
- }else { outputNames.push_back(outputFileName); }
+ if (wroteSomething == false) { m->mothurOut("Your file does not contain any sequence from the .accnos file."); m->mothurOutEndLine(); }
+ outputNames.push_back(outputFileName);
return 0;
list = new ListVector(nameMap->getListVector());
RAbundVector* rabund = new RAbundVector(list->getRAbundVector());
+for (int i = 0; i < list->getNumBins(); i++) {
+string bin = list->get(i);
+if(bin == "") {
+cout << "bin " << i << " is blank."<< endl;
+}
+}
+cout << "after outputting blank bins." << endl;
if (m->control_pressed) { delete nameMap; delete read; delete list; delete rabund; return 0; }
listFile.close(); rabundFile.close(); sabundFile.close(); remove((fileroot+ tag + ".list").c_str()); remove((fileroot+ tag + ".rabund").c_str()); remove((fileroot+ tag + ".sabund").c_str());
return 0;
}
-
+ int count = 0;
//cluster using cluster classes
while (distMatrix->getSmallDist() < cutoff && distMatrix->getNNodes() > 0){
}else{
rndDist = roundDist(dist, precision);
}
-
+cout << "here " << count << '\t' << dist << endl;
if(previousDist <= 0.0000 && dist != previousDist){
oldList.setLabel("unique");
printData(&oldList);
+ Seq2Bin = cluster->getSeqtoBin();
}
else if(rndDist != rndPreviousDist){
if (merge) {
printData(&oldList);
}
}
-
+ //cout << "after merge " << count << '\t' << dist << endl;
+ count++;
previousDist = dist;
- cout << "prev distance = " << previousDist << " dist = " << dist << endl;
rndPreviousDist = rndDist;
oldList = *list;
oldSeq2Bin = Seq2Bin;
if(previousDist <= 0.0000){
oldList.setLabel("unique");
printData(&oldList);
+ Seq2Bin = cluster->getSeqtoBin();
}
else if(rndPreviousDist<cutoff){
if (merge) {
if((previousDist <= 0.0000) && (seqs[i].dist != previousDist)){
oldList.setLabel("unique");
printData(&oldList);
+ Seq2Bin = hcluster->getSeqtoBin();
}
else if((rndDist != rndPreviousDist)){
if (merge) {
}
delete hcluster;
- //remove(distFile.c_str());
- //remove(overlapFile.c_str());
+ remove(distFile.c_str());
+ remove(overlapFile.c_str());
}
delete list;
try {
//create new listvector so you don't overwrite the clustering
ListVector* newList = new ListVector(oldList);
+for (int i = 0; i < newList->getNumBins(); i++) {
+string bin = newList->get(i);
+if(bin == "") {
+cout << "bin " << i << " is blank."<< endl;
+for (map<string, int>::iterator itBin = binInfo.begin(); itBin != binInfo.end(); itBin++) {
+ if (itBin->second == i) { cout << itBin->first << " maps to an empty bin." << endl; }
+}
+}
+}
+cout << "after outputting blank bins." << endl;
+
bool done = false;
ifstream inOverlap;
int count = 0;
if(itBin1 == binInfo.end()){ cerr << "AAError: Sequence '" << name1 << "' does not have any bin info.\n"; exit(1); }
if(itBin2 == binInfo.end()){ cerr << "ABError: Sequence '" << name2 << "' does not have any bin info.\n"; exit(1); }
-
+cout << overlapNode.dist << '\t' << dist << endl;
int binKeep = itBin1->second;
int binRemove = itBin2->second;
-
+
//if not merge bins and update binInfo
if(binKeep != binRemove) {
-
+ cout << "bin keep = " << binKeep << " bin remove = " << binRemove << endl;
//save names in old bin
string names = newList->get(binRemove);
-
+ cout << names << endl << endl << endl;
+ cout << newList->get(binKeep) << endl << endl << endl;
//merge bins into name1s bin
newList->set(binKeep, newList->get(binRemove)+','+newList->get(binKeep));
newList->set(binRemove, "");
else {
//check for blank file
gobble(fileHandle);
- if (fileHandle.eof()) { cout << completeFileName << " is blank. Please correct." << endl; return 1; }
+ if (fileHandle.eof()) { cout << completeFileName << " is blank. Please correct." << endl; }
return 0;
}
//cout << (*this).size() << endl;
for(it = (*this).begin(); it!=(*this).end(); it++){
out << it->first << '\t' << it->second << endl; //prints out keys and values of the map this.
+ //out << it->first << '\t' << it->first << endl;
}
}
catch(exception& e) {
//if we have it then compare
if (itDist != dists[it->first].end()) {
- if (distance < 0.0) { cout << currentRow << '\t' << nameMap->get(it->first) << '\t' << "score = " << it->second << " refscore = " << refScore << " distance = " << distance << " distance = " << itDist->second << endl; }
-
+
//if you want the minimum blast score ratio, then pick max distance
if(minWanted) { distance = max(itDist->second, distance); }
else{ distance = min(itDist->second, distance); }
ifstream in;
openInputFile(blastfile, in);
- ofstream outName;
- openOutputFile("tempOutNames", outName);
+ //ofstream outName;
+ //openOutputFile((blastfile + ".tempOutNames"), outName);
//read first line
in >> prevName;
//openOutputFile(outNames, out);
//nameMap->print(out);
//out.close();
+
if (m->control_pressed) { return 0; }
m->mothurOut(toString(num) + " names read."); m->mothurOutEndLine();
in.close();
out.close();
- if (wroteSomething == false) {
- m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
- remove(outputFileName.c_str());
- }else { outputNames.push_back(outputFileName); }
+ if (wroteSomething == false) { m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine(); }
+ outputNames.push_back(outputFileName);
return 0;
in.close();
out.close();
- if (wroteSomething == false) {
- m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
- remove(outputFileName.c_str());
- }else { outputNames.push_back(outputFileName); }
-
+ if (wroteSomething == false) { m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine(); }
+ outputNames.push_back(outputFileName);
+
return 0;
}
in.close();
out.close();
- if (wroteSomething == false) {
- m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
- remove(outputFileName.c_str());
- }else { outputNames.push_back(outputFileName); }
-
+ if (wroteSomething == false) { m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine(); }
+ outputNames.push_back(outputFileName);
+
return 0;
}
catch(exception& e) {
in.close();
out.close();
- if (wroteSomething == false) {
- m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
- remove(outputFileName.c_str());
- }else { outputNames.push_back(outputFileName); }
+ if (wroteSomething == false) { m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine(); }
+ outputNames.push_back(outputFileName);
return 0;
}
in.close();
out.close();
- if (wroteSomething == false) {
- m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
- remove(outputFileName.c_str());
- }else { outputNames.push_back(outputFileName); }
+ if (wroteSomething == false) { m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine(); }
+ outputNames.push_back(outputFileName);
return 0;
}
in.close();
out.close();
- if (wroteSomething == false) {
- m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine();
- remove(outputFileName.c_str());
- }else { outputNames.push_back(outputFileName); }
+ if (wroteSomething == false) { m->mothurOut("Your file contains only sequences from the .accnos file."); m->mothurOutEndLine(); }
+ outputNames.push_back(outputFileName);
return 0;