string temp;
temp = validParameter.validFile(parameters, "lookup", true);
if (temp == "not found") {
- lookupFileName = "LookUp_Titanium.pat";
+ string path = m->argv;
+ string tempPath = path;
+ for (int i = 0; i < path.length(); i++) { tempPath[i] = tolower(path[i]); }
+ path = path.substr(0, (tempPath.find_last_of('m')));
+
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
+ path += "lookupFiles/";
+#else
+ path += "lookupFiles\\";
+#endif
+ lookupFileName = m->getFullPathName(path) + "LookUp_Titanium.pat";
int ableToOpen;
ifstream in;
//if you can't open it, try input location
if (ableToOpen == 1) {
if (inputDir != "") { //default path is set
- string tryPath = inputDir + lookupFileName;
+ string tryPath = inputDir + m->getSimpleName(lookupFileName);
m->mothurOut("Unable to open " + lookupFileName + ". Trying input directory " + tryPath); m->mothurOutEndLine();
ifstream in2;
ableToOpen = m->openInputFile(tryPath, in2, "noerror");
for (int i = 0; i < exepath.length(); i++) { tempPath[i] = tolower(exepath[i]); }
exepath = exepath.substr(0, (tempPath.find_last_of('m')));
- string tryPath = m->getFullPathName(exepath) + lookupFileName;
+ string tryPath = m->getFullPathName(exepath) + m->getSimpleName(lookupFileName);
m->mothurOut("Unable to open " + lookupFileName + ". Trying mothur's executable location " + tryPath); m->mothurOutEndLine();
ifstream in2;
int ableToOpen = m->openInputFile(tryPath, in2, "noerror");
RAbundVector* rabund = new RAbundVector(list->getRAbundVector());
- Cluster* cluster = new CompleteLinkage(rabund, list, matrix, cutoff, "furthest");
+ float adjust = -1.0;
+ Cluster* cluster = new CompleteLinkage(rabund, list, matrix, cutoff, "furthest", adjust);
string tag = cluster->getTag();
double clusterCutoff = cutoff;
if (m->control_pressed) { break; }
int index = 0;
- int base = 0;
if(nSeqsPerOTU[i] > 0){
- qualities[i].assign(1024, -1);
while(index < numFlowCells){
double maxPrValue = 1e8;
value = (int)floor(temp);
if(value > 100){ value = 100; }
- qualities[i][base] = (int)value;
- base++;
+ qualities[i].push_back((int)value);
}
}
if(otuCounts[i] > 0){
qualityFile << '>' << seqNameVector[mapUniqueToSeq[i]] << endl;
-
- int j=4; //need to get past the first four bases
- while(qualities[i][j] != -1){
- qualityFile << qualities[i][j] << ' ';
- j++;
- }
+ for (int j = 4; j < qualities[i].size(); j++) { qualityFile << qualities[i][j] << ' '; }
qualityFile << endl;
}
}
m->mothurOut("\nFinalizing...\n");
fill(numOTUs, seqNumber, seqIndex, cumNumSeqs, nSeqsPerOTU, aaP, aaI);
+ if (m->debug) { m->mothurOut("[DEBUG]: done fill().\n"); }
+
if (m->control_pressed) { break; }
setOTUs(numOTUs, numSeqs, seqNumber, seqIndex, cumNumSeqs, nSeqsPerOTU, otuData, singleTau, dist, aaP, aaI);
+ if (m->debug) { m->mothurOut("[DEBUG]: done setOTUs().\n"); }
+
if (m->control_pressed) { break; }
vector<int> otuCounts(numOTUs, 0);
for(int j=0;j<numSeqs;j++) { otuCounts[otuData[j]]++; }
- calcCentroidsDriver(numOTUs, cumNumSeqs, nSeqsPerOTU, seqIndex, change, centroids, singleTau, mapSeqToUnique, uniqueFlowgrams, flowDataIntI, lengths, numFlowCells, seqNumber);
+ calcCentroidsDriver(numOTUs, cumNumSeqs, nSeqsPerOTU, seqIndex, change, centroids, singleTau, mapSeqToUnique, uniqueFlowgrams, flowDataIntI, lengths, numFlowCells, seqNumber);
+
+ if (m->debug) { m->mothurOut("[DEBUG]: done calcCentroidsDriver().\n"); }
if (m->control_pressed) { break; }
if (m->control_pressed) { break; }
int index = 0;
- int base = 0;
-
+
if(nSeqsPerOTU[i] > 0){
- qualities[i].assign(1024, -1);
while(index < numFlowCells){
+
double maxPrValue = 1e8;
short maxPrIndex = -1;
double count = 0.0000;
pr[s] += tauValue * singleLookUp[s * NUMBINS + intensity];
}
}
-
+
maxPrIndex = uniqueFlowgrams[centroids[i] * numFlowCells + index];
maxPrValue = pr[maxPrIndex];
for(int s=0;s<HOMOPS;s++){
norm += exp(-(pr[s] - maxPrValue));
}
-
+
for(int s=1;s<=maxPrIndex;s++){
int value = 0;
double temp = 0.0000;
value = (int)floor(temp);
if(value > 100){ value = 100; }
- qualities[i][base] = (int)value;
- base++;
+ qualities[i].push_back((int)value);
}
- }
+ }//end if
index++;
- }
- }
-
+
+ }//end while
+
+ }//end if
+
if(otuCounts[i] > 0){
qualityFile << '>' << seqNameVector[mapUniqueToSeq[i]] << endl;
-
- int j=4; //need to get past the first four bases
- while(qualities[i][j] != -1){
- qualityFile << qualities[i][j] << ' ';
- if (j > qualities[i].size()) { break; }
- j++;
- }
+ //need to get past the first four bases
+ for (int j = 4; j < qualities[i].size(); j++) { qualityFile << qualities[i][j] << ' '; }
qualityFile << endl;
}
- }
+ }//end for
qualityFile.close();
outputNames.push_back(qualityFileName); outputTypes["qfile"].push_back(qualityFileName);