X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothur.h;h=f8ec32363516bcc6543569b57f313505796acef7;hb=fc1ed1ae1b022719176910ab71993bd6535810ad;hp=b0ad51e6736159e738d83d08a418f6cdecaac767;hpb=a5af3313f0221a8b41aa362d72eadb60a4dd6e27;p=mothur.git diff --git a/mothur.h b/mothur.h index b0ad51e..f8ec323 100644 --- a/mothur.h +++ b/mothur.h @@ -57,6 +57,7 @@ #include #include #include + #include #include #include @@ -70,6 +71,8 @@ #include //get cwd #include #include + #include + #include #endif @@ -125,6 +128,37 @@ struct distlinePair { }; /************************************************************/ +struct seqPriorityNode { + int numIdentical; + string seq; + string name; + seqPriorityNode() {} + seqPriorityNode(int n, string s, string nm) : numIdentical(n), seq(s), name(nm) {} + ~seqPriorityNode() {} +}; +/***************************************************************/ +struct spearmanRank { + string name; + float score; + + spearmanRank(string n, float s) : name(n), score(s) {} +}; +//******************************************************************************************************************** +//sorts highest to lowest +inline bool compareSpearman(spearmanRank left, spearmanRank right){ + return (left.score > right.score); +} +//******************************************************************************************************************** +//sorts highest to lowest +inline bool compareSeqPriorityNodes(seqPriorityNode left, seqPriorityNode right){ + return (left.numIdentical > right.numIdentical); +} +//******************************************************************************************************************** +//sorts lowest to highest +inline bool compareSpearmanReverse(spearmanRank left, spearmanRank right){ + return (left.score < right.score); +} +/************************************************************/ //sorts lowest to highest inline bool compareDistLinePairs(distlinePair left, distlinePair right){ return (left.end < right.end); @@ -221,5 +255,15 @@ string toString(const T&x, int i){ } //********************************************************************************************************************** +template +T fromString(const string& s){ + istringstream stream (s); + T t; + stream >> t; + return t; +} + +//********************************************************************************************************************** + #endif