if(gaps[i] == seqs.size()) { filterString[i] = '0'; numColRemoved++; }
else if (((a[i] < threshold) && (t[i] < threshold) && (g[i] < threshold) && (c[i] < threshold))) { filterString[i] = '0'; numColRemoved++; }
- cout << "a = " << a[i] << " t = " << t[i] << " g = " << g[i] << " c = " << c[i] << endl;
+ //cout << "a = " << a[i] << " t = " << t[i] << " g = " << g[i] << " c = " << c[i] << endl;
}
mothurOut("Filter removed " + toString(numColRemoved) + " columns."); mothurOutEndLine();
Chimera(string);
Chimera(string, bool, string);
Chimera(string, string);
- virtual ~Chimera(){};
+ virtual ~Chimera(){ for (int i = 0; i < templateSeqs.size(); i++) { delete templateSeqs[i]; } };
virtual void setFilter(bool f) { filter = f; }
virtual void setCorrection(bool c) { correction = c; }
virtual void setProcessors(int p) { processors = p; }
virtual void setMinBS(int b) { minBS = b; }
virtual void setMinSNP(int s) { minSNP = s; }
virtual void setIters(int i) { iters = i; }
- virtual void setTemplateSeqs(vector<Sequence*> t) { templateSeqs = t; }
virtual bool getUnaligned() { return unaligned; }
- virtual void setTemplateFile(string t) { templateFileName = t; }
+ virtual void setTemplateFile(string t) { templateFileName = t; templateSeqs = readSeqs(t); }
virtual int getLength() { return length; }
virtual void setCons(string){};
string accnosFileName = outputDir + getRootName(getSimpleName(fastafile)) + method + maskfile + ".accnos";
- vector<Sequence*> templateSeqs;
if ((method != "bellerophon") && (method != "chimeracheck")) {
- templateSeqs = chimera->readSeqs(templatefile);
if (chimera->getUnaligned()) {
mothurOut("Your template sequences are different lengths, please correct."); mothurOutEndLine();
- //free memory
- for (int i = 0; i < templateSeqs.size(); i++) { delete templateSeqs[i]; }
delete chimera;
return 0;
}
-
- //set options
- chimera->setTemplateSeqs(templateSeqs);
-
}else if (method == "bellerophon") {//run bellerophon separately since you need to read entire fastafile to run it
chimera->getChimeras();
remove(outputFileName.c_str());
rename(tempHeader.c_str(), outputFileName.c_str());
- for (int i = 0; i < templateSeqs.size(); i++) { delete templateSeqs[i]; }
delete chimera;
if (method == "chimeracheck") { remove(accnosFileName.c_str()); mothurOutEndLine(); mothurOut("This method does not determine if a sequence is chimeric, but allows you to make that determination based on the IS values."); mothurOutEndLine(); }
bool reRead = false;
//create filter if needed for later
if (filter) {
-
-cout << "filter" << endl;
//read in all query seqs
ifstream in;
//merge query seqs and template seqs
temp = templateSeqs;
for (int i = 0; i < tempQuerySeqs.size(); i++) { temp.push_back(tempQuerySeqs[i]); }
-cout << temp.size() << endl;
+
if (seqMask != "") {
reRead = true;
- cout << "masked " << seqMask << endl;
//mask templates
for (int i = 0; i < temp.size(); i++) {
decalc->runMask(temp[i]);
}
mergedFilterString = createFilter(temp, 0.5);
- cout << "here" << endl;
+
//reread template seqs
- //for (int i = 0; i < tempQuerySeqs.size(); i++) { delete tempQuerySeqs[i]; }
+ for (int i = 0; i < tempQuerySeqs.size(); i++) { delete tempQuerySeqs[i]; }
}
openOutputFile(outputMisMatchName, outMisMatch);
+ map<string, string> listNames;
+ map<string, string>::iterator itList;
+
//go through list and if group returns "not found" output it
for (int i = 0; i < SharedList->getNumBins(); i++) {
string name = names.substr(0,names.find_first_of(','));
names = names.substr(names.find_first_of(',')+1, names.length());
string group = groupMap->getGroup(name);
-
+
if(group == "not found") { outMisMatch << name << endl; }
+
+ itList = listNames.find(name);
+ if (itList != listNames.end()) { mothurOut(name + " is in your list file more than once. Sequence names must be unique. please correct."); mothurOutEndLine(); }
+ else { listNames[name] = name; }
}
//get last name
string group = groupMap->getGroup(names);
- if(group == "not found") { outMisMatch << names << endl; }
+ if(group == "not found") { outMisMatch << names << endl; }
+
+ itList = listNames.find(names);
+ if (itList != listNames.end()) { mothurOut(names + " is in your list file more than once. Sequence names must be unique. please correct."); mothurOutEndLine(); }
+ else { listNames[names] = names; }
+
}
outMisMatch.close();
mothurOut("For a list of names that are in your group file and not in your list file, please refer to " + outputMisMatchName + "."); mothurOutEndLine();
map<string, string> namesInList;
+ map<string, string>::iterator itList;
//go through listfile and get names
for (int i = 0; i < SharedList->getNumBins(); i++) {
string name = names.substr(0,names.find_first_of(','));
names = names.substr(names.find_first_of(',')+1, names.length());
+ itList = namesInList.find(name);
+ if (itList != namesInList.end()) { mothurOut(name + " is in your list file more than once. Sequence names must be unique. please correct."); mothurOutEndLine(); }
+
namesInList[name] = name;
+
}
+ itList = namesInList.find(names);
+ if (itList != namesInList.end()) { mothurOut(names + " is in your list file more than once. Sequence names must be unique. please correct."); mothurOutEndLine(); }
+
//get last name
namesInList[names] = names;
}