]> git.donarmstrong.com Git - mothur.git/blobdiff - mothur.h
worked on hcluster. made .single command run using a sharedfile. and various other...
[mothur.git] / mothur.h
index cf6ae69dc85fc866c34588118575222772897dcf..8f9f94ff872aab355c6123f97e4cebb8e4dedb7f 100644 (file)
--- a/mothur.h
+++ b/mothur.h
@@ -109,6 +109,11 @@ struct seqDist {
        seqDist(int s1, int s2, float d) : seq1(s1), seq2(s2), dist(d) {}
        ~seqDist() {}
 };
+//********************************************************************************************************************
+//sorts lowest to highest
+inline bool compareSequenceDistance(seqDist left, seqDist right){
+       return (left.dist < right.dist);        
+} 
 /***********************************************************************/
 
 // snagged from http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.2
@@ -458,6 +463,22 @@ inline bool isBlank(string fileName){
 }
 /***********************************************************************/
 
+inline int openInputFile(string fileName, ifstream& fileHandle, string m){
+
+       fileHandle.open(fileName.c_str());
+       if(!fileHandle) {
+               mothurOut("Error: Could not open " + fileName);  mothurOutEndLine();
+               return 1;
+       }
+       else {
+               //check for blank file
+               gobble(fileHandle);
+               return 0;
+       }
+       
+}
+/***********************************************************************/
+
 inline int openInputFile(string fileName, ifstream& fileHandle){
 
        fileHandle.open(fileName.c_str());