Permalink
Browse files

Fixes bug with cluster method agc

Improper size notation was causing vsearch to ignore it
  • Loading branch information...
1 parent 96016f2 commit 00100151cedc3ba45f2f4550e227c3766915b733 @mothur-westcott mothur-westcott committed Jun 30, 2016
@@ -675,7 +675,7 @@ int ChimeraUchimeCommand::execute(){
if (error == 1) { for (int j = 0; j < outputNames.size(); j++) { m->mothurRemove(outputNames[j]); } return 0; }
if (seqs.size() != nameMapCount.size()) { m->mothurOut( "The number of sequences in your fastafile does not match the number of sequences in your namefile, aborting."); m->mothurOutEndLine(); for (int j = 0; j < outputNames.size(); j++) { m->mothurRemove(outputNames[j]); } return 0; }
- m->printVsearchFile(nameMapCount, newFasta, "ab");
+ m->printVsearchFile(nameMapCount, newFasta, "/ab=", "/");
fastaFileNames[s] = newFasta;
}
@@ -627,7 +627,7 @@ int ChimeraVsearchCommand::execute(){
if (error == 1) { for (int j = 0; j < outputNames.size(); j++) { m->mothurRemove(outputNames[j]); } return 0; }
if (seqs.size() != nameMapCount.size()) { m->mothurOut( "The number of sequences in your fastafile does not match the number of sequences in your namefile, aborting."); m->mothurOutEndLine(); for (int j = 0; j < outputNames.size(); j++) { m->mothurRemove(outputNames[j]); } return 0; }
- m->printVsearchFile(nameMapCount, newFasta);
+ m->printVsearchFile(nameMapCount, newFasta, ";size=", ";");
fastaFileNames[s] = newFasta;
}
@@ -563,6 +563,8 @@ int ClusterCommand::vsearchDriver(string inputFile, string ucClusteredFile, stri
for (int i = 0; i < vsearchParameters.size(); i++) { commandString += toString(vsearchParameters[i]) + " "; }
//cout << "commandString = " << commandString << endl;
+ //exit(1);
+
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
#else
commandString = "\"" + commandString + "\"";
View
@@ -4873,7 +4873,7 @@ int MothurOut::min(int A, int B){
}
}
//**********************************************************************************************************************
-int MothurOut::printVsearchFile(vector<seqPriorityNode>& nameMapCount, string filename, string tag){
+int MothurOut::printVsearchFile(vector<seqPriorityNode>& nameMapCount, string filename, string tag, string tag2){
try {
sort(nameMapCount.begin(), nameMapCount.end(), compareSeqPriorityNodes);
@@ -4884,7 +4884,7 @@ int MothurOut::printVsearchFile(vector<seqPriorityNode>& nameMapCount, string fi
//print new file in order of
for (int i = 0; i < nameMapCount.size(); i++) {
if (control_pressed) {break;}
- out << ">" << nameMapCount[i].name << "/" + tag + "=" << nameMapCount[i].numIdentical << "/" << endl << nameMapCount[i].seq << endl;
+ out << ">" << nameMapCount[i].name << tag << nameMapCount[i].numIdentical << tag2 << endl << nameMapCount[i].seq << endl;
}
out.close();
View
@@ -140,7 +140,7 @@ class MothurOut {
int readNames(string, map<string, vector<string> >&);
int readNames(string, vector<seqPriorityNode>&, map<string, string>&);
int mothurRemove(string);
- int printVsearchFile(vector<seqPriorityNode>&, string, string); //sorts and prints by abundance adding /ab=xxx/
+ int printVsearchFile(vector<seqPriorityNode>&, string, string, string); //sorts and prints by abundance adding /ab=xxx/
bool mothurConvert(char, int&); //use for converting user inputs. Sets commandInputsConvertError to true if error occurs. Engines check this.
bool mothurConvert(string, int&); //use for converting user inputs. Sets commandInputsConvertError to true if error occurs. Engines check this.
bool mothurConvert(string, intDist&); //use for converting user inputs. Sets commandInputsConvertError to true if error occurs. Engines check this.
@@ -111,7 +111,7 @@ string VsearchFileParser::createVsearchFasta(string inputFile){
}
in.close();
- m->printVsearchFile(seqs, vsearchFasta, "size");
+ m->printVsearchFile(seqs, vsearchFasta, ";size=", ";");
return vsearchFasta;
}
@@ -226,7 +226,7 @@ int VsearchFileParser::createListFile(string inputFile, string listFile, string
string VsearchFileParser::removeAbundances(string seqName){
try {
- int pos = seqName.find_last_of("/", seqName.length()-2); //don't look at the last /
+ int pos = seqName.find_last_of(";", seqName.length()-2); //don't look at the last /
if (pos != string::npos) { seqName = seqName.substr(0, pos); }
return seqName;

0 comments on commit 0010015

Please sign in to comment.