GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"MOTHUR_FILES=\"\\\"../release\\\"\"",
- "VERSION=\"\\\"1.15.0\\\"\"",
- "RELEASE_DATE=\"\\\"12/10/2010\\\"\"",
+ "VERSION=\"\\\"1.16.0\\\"\"",
+ "RELEASE_DATE=\"\\\"1/26/2010\\\"\"",
);
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
if (alignSeqs[j].active) { //this sequence has not been merged yet
string jBases = alignSeqs[j].seq.getUnaligned();
-
+
if (isFragment(iBases, jBases)) {
//merge
alignSeqs[i].names += ',' + alignSeqs[j].names;
int percentDiff = floor((seq2.length() * (percent / 100.0)));
if (percentDiff < totalDiffs) { totalDiffs = percentDiff; }
}
-
+
Alignment* alignment = new NeedlemanOverlap(-1.0, 1.0, -1.0, (seq1.length()+totalDiffs+1));
//use needleman to align
}
if (numDiffs <= totalDiffs) { fragment = true; }
+
}
return fragment;
int openParen = taxon.find_first_of('(');
int closeParen = taxon.find_last_of(')');
- string newtaxon = taxon.substr(0, openParen); //rip off confidence
- string confidence = taxon.substr((openParen+1), (closeParen-openParen-1));
+ string newtaxon, confidence;
+ if ((openParen != string::npos) && (closeParen != string::npos)) {
+ newtaxon = taxon.substr(0, openParen); //rip off confidence
+ confidence = taxon.substr((openParen+1), (closeParen-openParen-1));
+ }else{
+ newtaxon = taxon;
+ confidence = "0";
+ }
int con = 0;
convert(confidence, con);
double denom = (sqrt(denomTerm1) * sqrt(denomTerm2));
double r = numerator / denom;
+ //divide by zero error
+ if (isnan(r) || isinf(r)) { r = 0.0; }
+
return r;
}
}
#endif
-#endif
\ No newline at end of file
+#endif
+
+
+
int Bij = shared[1]->getAbundance(i);
sumNum += abs(Aij - Bij);
- sumDenom += Aij + Bij;
+ sumDenom += (Aij + Bij);
}
data[0] = sumNum / sumDenom;
exit(1);
}
}
-//**********************************************************************************************************************
\ No newline at end of file
+//**********************************************************************************************************************
+
+
+
//if the users file contains confidence scores we want to ignore them when searching for the taxons, unless the taxon has them
if (!taxonsHasConfidence) {
+
int hasConfidences = tax.find_first_of('(');
if (hasConfidences != string::npos) {
newtax = removeConfidences(tax);
}else{//if taxons has them and you don't them remove taxons
int hasConfidences = tax.find_first_of('(');
if (hasConfidences == string::npos) {
-
+
int pos = newtax.find(noConfidenceTaxons);
if (pos == string::npos) {
}
}else { //both have confidences so we want to make sure the users confidences are greater then or equal to the taxons
//first remove confidences from both and see if the taxonomy exists
-
+
string noNewTax = tax;
int hasConfidences = tax.find_first_of('(');
if (hasConfidences != string::npos) {
int openParen = taxon.find_first_of('(');
int closeParen = taxon.find_last_of(')');
- string newtaxon = taxon.substr(0, openParen); //rip off confidence
- string confidence = taxon.substr((openParen+1), (closeParen-openParen-1));
+ string newtaxon, confidence;
+ if ((openParen != string::npos) && (closeParen != string::npos)) {
+ newtaxon = taxon.substr(0, openParen); //rip off confidence
+ confidence = taxon.substr((openParen+1), (closeParen-openParen-1));
+ }else{
+ newtaxon = taxon;
+ confidence = "0";
+ }
int con = 0;
convert(confidence, con);