375AA1360F9E433D008EF9B8 /* readotu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readotu.h; sourceTree = SOURCE_ROOT; };
375AA1370F9E433D008EF9B8 /* readphylip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = readphylip.cpp; sourceTree = SOURCE_ROOT; };
375AA1380F9E433D008EF9B8 /* readphylip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = readphylip.h; sourceTree = SOURCE_ROOT; };
- 377326630FAF16E0007ABB8B /* consensuscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = consensuscommand.cpp; sourceTree = "<group>"; };
- 377326640FAF16E0007ABB8B /* consensuscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = consensuscommand.h; sourceTree = "<group>"; };
+ 377326630FAF16E0007ABB8B /* consensuscommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = consensuscommand.cpp; sourceTree = SOURCE_ROOT; };
+ 377326640FAF16E0007ABB8B /* consensuscommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = consensuscommand.h; sourceTree = SOURCE_ROOT; };
378598640FDD497000EF9D03 /* heatmapsimcommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = heatmapsimcommand.h; sourceTree = SOURCE_ROOT; };
378598650FDD497000EF9D03 /* heatmapsimcommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = heatmapsimcommand.cpp; sourceTree = SOURCE_ROOT; };
378598720FDD4C1500EF9D03 /* heatmapsim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = heatmapsim.h; sourceTree = SOURCE_ROOT; };
mothurOutEndLine();
alignment = new NeedlemanOverlap(gapOpen, match, misMatch, longestBase);
}
+ mothurOut("Aligning sequences...");
+ mothurOutEndLine();
string alignFileName = candidateFileName.substr(0,candidateFileName.find_last_of(".")+1) + "align";
string reportFileName = candidateFileName.substr(0,candidateFileName.find_last_of(".")+1) + "align.report";
report.setAlignmentParameters(align, alignment);
report.setNastParameters(nast);
-
+
alignmentFile << '>' << candidateSeq->getName() << '\n' << candidateSeq->getAligned() << endl;
report.print();
vector<int> prevRow = it->second;
it++;
- for(it;it!=allDistances.end();it++){
+ for(;it!=allDistances.end();it++){
for(int i=0;i<it->second.size();i++){
it->second[i] += prevRow[i];
}
#include <cerrno>
#include <ctime>
#include <limits>
+#include <sys/wait.h>
+#include <unistd.h>
using namespace std;
-#ifdef _WIN32
- #define exp(x) (exp((double) x))
- #define sqrt(x) (sqrt((double) x))
- #define log10(x) (log10((double) x))
- #define log2(x) (log10(x)/log10(2))
- #define isnan(x) ((x) != (x))
- #define isinf(x) (fabs(x) == std::numeric_limits<double>::infinity())
-#else
- #include <sys/wait.h>
- #include <unistd.h>
-#endif
+#define exp(x) (exp((double) x))
+#define sqrt(x) (sqrt((double) x))
+#define log10(x) (log10((double) x))
+#define log2(x) (log10(x)/log10(2))
+#define isnan(x) ((x) != (x))
+#define isinf(x) (fabs(x) == std::numeric_limits<double>::infinity())
typedef unsigned long ull;
if (!(i >> x) || (failIfLeftoverChars && i.get(c)))
throw BadConversion(s);
}
+
//**********************************************************************************************************************
template<typename T>
}
else{
-
if(tempAln[0] == '-'){
int pairwiseAlignmentLength = tempAln.length(); // we need to make sure that the candidate sequence alignment
for(int i=0;i<pairwiseAlignmentLength;i++){ // starts where the template sequence alignment starts, if it
}
}
}
-
int pairwiseAlignmentLength = tempAln.length();
if(tempAln[pairwiseAlignmentLength-1] == '-'){ // we need to make sure that the candidate sequence alignment
for(int i=pairwiseAlignmentLength-1; i>=0; i--){// ends where the template sequence alignment ends, if it runs
break;
}
}
-
-
+
for(rightIndex=i+1;rightIndex<longAlignmentLength-1;rightIndex++){
if(!isalpha(candAln[rightIndex])){
rightRoom = 1; //count how far it is to the nearest gap on the RIGHT side of the anomaly
errorOut(e, "Nast", "removeExtraGaps");
exit(1);
}
-
}
/**************************************************************************************************/
newTemplateAlign += tempAln[fullAlignIndex];// pairwise sequences
fullAlignIndex++;
}
-
+
string lastLoop = "";
while(pairwiseAlignIndex<pairwiseLength){
//calculate chao1, (numleaves-1) because numleaves contains the ++ values.
bool bias;
for(int i=0;i<numLeaves;i++){
- if ((f2leaves[i]->lvalue == 0) || (f2leaves[i]->rvalue == 0)) { bias = true; }// break;}
+ if (f2leaves[i]->lvalue == 0 || f2leaves[i]->rvalue == 0) { bias = true;}// break;}
}
if(bias){
double ci = 0;
double maxRank = (double)rank->getMaxRank();
- int sampled = rank->getNumSeqs();
- int sobs = rank->getNumBins();
+ double sampled = (double)rank->getNumSeqs();
+ double sobs = (double)rank->getNumBins();
double firstTerm = 0;
double secondTerm = 0;
for(int i=1;i<=maxRank;i++){
simnum += (double)(rank->get(i)*i*(i-1));
}
-
- simpson = simnum / (double)(sampled*(sampled-1));
+
+ simpson = simnum / (sampled*(sampled-1));
for(int i=1;i<=maxRank;i++){
double piI = (double) i / (double)sampled;
secondTerm += rank->get(i) * pow(piI, 2);
}
- double var = (4.0 / (double)sampled) * (firstTerm - secondTerm*secondTerm);
+ double var = (4.0 / sampled) * (firstTerm - secondTerm*secondTerm);
ci = 1.95 * pow(var, 0.5);
}
if(qThreshold != 0) { success = stripQualThreshold(currSeq, qFile); }
else if(qAverage != 0) { success = cullQualAverage(currSeq, qFile); }
if(!success) { trashCode += 'q'; }
- qFile.close();
}
if(barcodes.size() != 0){
success = stripBarcode(currSeq, group);
outFASTA.close();
scrapFASTA.close();
outGroups.close();
+ if(qFileName != "") { qFile.close(); }
for(int i=0;i<fastaFileNames.size();i++){
fastaFileNames[i]->close();
string name;
qFile >> name;
- if (name.length() != 0) { if(name.substr(1) != seq.getName()) { mothurOut("sequence name mismatch btwn fasta and qual file"); mothurOutEndLine(); } }
+ if (name[0] == '>') { if(name.substr(1) != seq.getName()) { mothurOut("sequence name mismatch btwn fasta: " + seq.getName() + " and qual file: " + name); mothurOutEndLine(); } }
+
while (!qFile.eof()) { char c = qFile.get(); if (c == 10 || c == 13){ break; } }
float score;
average += score;
}
average /= seqLength;
-
+
if(average >= qAverage) { success = 1; }
else { success = 0; }
}
//***************************************************************************************************************
-
-