//***************************************************************************************************************
-Ccode::Ccode(string filename, string temp) { fastafile = filename; templateFile = temp; }
+Ccode::Ccode(string filename, string temp, string o) { fastafile = filename; templateFile = temp; outputDir = o; }
//***************************************************************************************************************
Ccode::~Ccode() {
mothurOutEndLine();
- string mapInfo = getRootName(fastafile) + "mapinfo";
+ string mapInfo = outputDir + getRootName(getSimpleName(fastafile)) + "mapinfo";
ofstream out2;
openOutputFile(mapInfo, out2);
}
//***************************************************************************************************************
-void Ccode::getChimeras() {
+int Ccode::getChimeras() {
try {
//read in query sequences and subject sequences
int numSeqs = querySeqs.size();
+ if (unaligned) { mothurOut("Your sequences need to be aligned when you use the bellerophon ccode."); mothurOutEndLine(); return 1; }
+
closest.resize(numSeqs);
refCombo.resize(numSeqs, 0);
for (int i = 0; i < lines.size(); i++) { delete lines[i]; }
delete distCalc;
delete decalc;
-
+
+ return 0;
}
catch(exception& e) {
errorOut(e, "Ccode", "getChimeras");
it = trim[query].begin();
int length = it->second - it->first;
-
+
//default is wanted = 10% of total length
if (windowSizes[query] > length) {
mothurOut("You have slected a window larger than your sequence length after all filters, masks and trims have been done. I will use the default 10% of sequence length.");
windowSizes[query] = length / 10;
}else if (windowSizes[query] == 0) { windowSizes[query] = length / 10; }
- else if (windowSizes[query] > (length / 20)) {
+ else if (windowSizes[query] > (length * 0.20)) {
mothurOut("You have selected a window that is larger than 20% of your sequence length. This is not recommended, but I will continue anyway."); mothurOutEndLine();
- }else if (windowSizes[query] < (length / 5)) {
+ }else if (windowSizes[query] < (length * 0.05)) {
mothurOut("You have selected a window that is smaller than 5% of your sequence length. This is not recommended, but I will continue anyway."); mothurOutEndLine();
}
//find the averages for the query
for (int i = 0; i < querySeqs.size(); i++) {
- findVarianceQuery(i); //fills varQuery[i] and sdQuery[i] also sets minimum error rate to 0.001 to avoid divide by 0.
+ findVarianceQuery(i); //fills v arQuery[i] and sdQuery[i] also sets minimum error rate to 0.001 to avoid divide by 0.
}
#endif
}