7 typedef uint32 word_t;
\r
8 typedef uint16 wordcount_t;
\r
9 typedef uint32 arrsize_t;
\r
10 typedef uint16 seqcountperword_t;
\r
11 typedef uint32 seqindex_t;
\r
12 typedef uint16 commonwordcount_t;
\r
14 const uint32 WindexFileHdr_Magic1 = 0x312DE41;
\r
15 const uint32 WindexFileHdr_Magic2 = 0x312DE42;
\r
16 const uint32 WindexFileHdr_Magic3 = 0x312DE43;
\r
17 const uint32 WindexFileHdr_Magic4 = 0x312DE44;
\r
19 struct WindexFileHdr
\r
32 unsigned m_WordLength;
\r
33 unsigned m_AlphaSize;
\r
34 unsigned m_WordCount;
\r
36 unsigned m_CapacityInc;
\r
37 arrsize_t *m_Capacities;
\r
39 float *m_WordScores;
\r
40 seqindex_t **m_SeedIndexes;
\r
41 byte *m_UniqueCounts;
\r
42 unsigned m_CharToLetter[256];
\r
46 void ToFile(const string &FileName) const;
\r
47 void FromFile(const string &FileName);
\r
48 void FromSFasta(SFasta &SF);
\r
49 void FromSeqDB(const SeqDB &DB);
\r
50 void Clear(bool ctor = false);
\r
51 void AddWords(unsigned SeqIndex, const word_t *Words, unsigned N);
\r
52 void Init(bool Nucleo, unsigned WordLength);
\r
53 void Init2(bool Nucleo, unsigned TableSize);
\r
54 void InitRed(unsigned WordLength);
\r
55 void InitWordScores(const float *const *SubstMx);
\r
58 unsigned LogMemSize() const;
\r
59 void LogWordStats(unsigned TopWords = 10) const;
\r
60 const char *WordToStr(word_t Word) const;
\r
61 word_t SeqToWord(const byte *Seq) const;
\r
62 unsigned SeqToWords(const byte *Seq, unsigned L, word_t *Words) const;
\r
63 unsigned SeqToWordsStep(unsigned Step, const byte *Seq, unsigned L, word_t *Words) const;
\r
64 unsigned WordsToCounts(const word_t *Words, unsigned N,
\r
65 word_t *UniqueWords, seqcountperword_t *Counts) const;
\r
66 unsigned GetUniqueWords(const word_t *Words, unsigned N,
\r
67 word_t *UniqueWords) const;
\r
68 void LogSizeHisto() const;
\r