--- /dev/null
+#ifndef windex_h\r
+#define windex_h\r
+\r
+class SFasta;\r
+struct SeqDB;\r
+\r
+typedef uint32 word_t;\r
+typedef uint16 wordcount_t;\r
+typedef uint32 arrsize_t;\r
+typedef uint16 seqcountperword_t;\r
+typedef uint32 seqindex_t;\r
+typedef uint16 commonwordcount_t;\r
+\r
+const uint32 WindexFileHdr_Magic1 = 0x312DE41;\r
+const uint32 WindexFileHdr_Magic2 = 0x312DE42;\r
+const uint32 WindexFileHdr_Magic3 = 0x312DE43;\r
+const uint32 WindexFileHdr_Magic4 = 0x312DE44;\r
+\r
+struct WindexFileHdr\r
+ {\r
+ uint32 Magic1;\r
+ uint32 IsNucleo;\r
+ uint32 WordLength;\r
+ uint32 Magic2;\r
+ };\r
+\r
+class Windex\r
+ {\r
+public:\r
+ bool m_Nucleo;\r
+ bool m_RedAlpha;\r
+ unsigned m_WordLength;\r
+ unsigned m_AlphaSize;\r
+ unsigned m_WordCount;\r
+ unsigned m_Hi;\r
+ unsigned m_CapacityInc;\r
+ arrsize_t *m_Capacities;\r
+ arrsize_t *m_Sizes;\r
+ float *m_WordScores;\r
+ seqindex_t **m_SeedIndexes;\r
+ byte *m_UniqueCounts;\r
+ unsigned m_CharToLetter[256];\r
+\r
+public:\r
+ Windex();\r
+ void ToFile(const string &FileName) const;\r
+ void FromFile(const string &FileName);\r
+ void FromSFasta(SFasta &SF);\r
+ void FromSeqDB(const SeqDB &DB);\r
+ void Clear(bool ctor = false);\r
+ void AddWords(unsigned SeqIndex, const word_t *Words, unsigned N);\r
+ void Init(bool Nucleo, unsigned WordLength);\r
+ void Init2(bool Nucleo, unsigned TableSize);\r
+ void InitRed(unsigned WordLength);\r
+ void InitWordScores(const float *const *SubstMx);\r
+ void Reset();\r
+ void LogMe() const;\r
+ unsigned LogMemSize() const;\r
+ void LogWordStats(unsigned TopWords = 10) const;\r
+ const char *WordToStr(word_t Word) const;\r
+ word_t SeqToWord(const byte *Seq) const;\r
+ unsigned SeqToWords(const byte *Seq, unsigned L, word_t *Words) const;\r
+ unsigned SeqToWordsStep(unsigned Step, const byte *Seq, unsigned L, word_t *Words) const;\r
+ unsigned WordsToCounts(const word_t *Words, unsigned N,\r
+ word_t *UniqueWords, seqcountperword_t *Counts) const;\r
+ unsigned GetUniqueWords(const word_t *Words, unsigned N,\r
+ word_t *UniqueWords) const;\r
+ void LogSizeHisto() const;\r
+ };\r
+\r
+#endif // windex_h\r