]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.h
added trim.seqs command
[mothur.git] / mothur.h
index 670a32c8326a76da2cf894cac0d7ad10a9a10825..9c9e23cf5a7a09279af66848fe1b1e3d972d8055 100644 (file)
--- a/mothur.h
+++ b/mothur.h
@@ -40,6 +40,15 @@ using namespace std;
 #include <cmath>
 #include <math.h>
 #include <algorithm>
+#include <ctime>
+
+#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))
+#endif
+
 
 typedef unsigned long long ull;
 
@@ -139,6 +148,13 @@ inline void gobble(istream& f){
        f.putback(d);
        
 }
+/***********************************************************************/
+
+inline bool isTrue(string f){
+       
+       if ((f == "TRUE") || (f == "T") || (f == "true") || (f == "t")) {       return true;    }
+       else {  return false;  }
+}
 
 /***********************************************************************/
 
@@ -316,6 +332,16 @@ inline int openOutputFileAppend(string fileName, ofstream& fileHandle){
 }
 
 
+/***********************************************************************/
+
+inline int getNumSeqs(ifstream& file){
+       
+       int numSeqs = count(istreambuf_iterator<char>(file),istreambuf_iterator<char>(), '>');
+       file.seekg(0);
+       return numSeqs;
+
+}
+
 /***********************************************************************/
 
 //This function parses the estimator options and puts them in a vector