X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=mothur.h;h=b4fc3ce1c41171c0cde75a83f6365e12873984bc;hp=32f4778a7c1ee19db25eeb4e1eafaf74fabcd617;hb=fefd5ee1517abd3bc38b469cb2dffc85a1571c7e;hpb=03fae12080951ea1d889da5187386abc236cc334 diff --git a/mothur.h b/mothur.h index 32f4778..b4fc3ce 100644 --- a/mothur.h +++ b/mothur.h @@ -120,6 +120,52 @@ struct diffPair { reverseProb = rp; } }; + +/**********************************************************/ +struct CommonHeader { + unsigned int magicNumber; + string version; + unsigned long long indexOffset; + unsigned int indexLength; + unsigned int numReads; + unsigned short headerLength; + unsigned short keyLength; + unsigned short numFlowsPerRead; + int flogramFormatCode; + string flowChars; //length depends on number flow reads + string keySequence; //length depends on key length + + CommonHeader(){ magicNumber=0; indexOffset=0; indexLength=0; numReads=0; headerLength=0; keyLength=0; numFlowsPerRead=0; flogramFormatCode='s'; } + ~CommonHeader() { } +}; +/**********************************************************/ +struct Header { + unsigned short headerLength; + unsigned short nameLength; + unsigned int numBases; + unsigned short clipQualLeft; + unsigned short clipQualRight; + unsigned short clipAdapterLeft; + unsigned short clipAdapterRight; + string name; //length depends on nameLength + string timestamp; + string region; + string xy; + + Header() { headerLength=0; nameLength=0; numBases=0; clipQualLeft=0; clipQualRight=0; clipAdapterLeft=0; clipAdapterRight=0; } + ~Header() { } +}; +/**********************************************************/ +struct seqRead { + vector flowgram; + vector flowIndex; + string bases; + vector qualScores; + + seqRead() { } + ~seqRead() { } +}; + /***********************************************************************/ struct PDistCell{ ull index; @@ -164,6 +210,16 @@ struct distlinePair { int end; }; +/************************************************************/ +struct oligosPair { + string forward; + string reverse; + + oligosPair() { forward = ""; reverse = ""; } + oligosPair(string f, string r) : forward(f), reverse(r) {} + ~oligosPair() {} +}; + /************************************************************/ struct seqPriorityNode { int numIdentical; @@ -196,7 +252,24 @@ inline bool compareIndexes(PDistCell left, PDistCell right){ //******************************************************************************************************************** inline bool compareSpearman(spearmanRank left, spearmanRank right){ return (left.score < right.score); -} +} +//******************************************************************************************************************** +inline double max(double left, double right){ + if (left > right) { return left; } + else { return right; } +} +//******************************************************************************************************************** +inline double max(int left, double right){ + double value = left; + if (left > right) { return value; } + else { return right; } +} +//******************************************************************************************************************** +inline double max(double left, int right){ + double value = right; + if (left > value) { return left; } + else { return value; } +} //******************************************************************************************************************** //sorts highest to lowest inline bool compareSeqPriorityNodes(seqPriorityNode left, seqPriorityNode right){