7 typedef void (*ON_START_XSEQ)(const SeqData &SD);
\r
8 typedef void (*ON_END_XSEQ)(const SeqData &SD);
\r
10 // Sequential reader for FASTA file format.
\r
11 // Serves sequences in file order to save memory.
\r
12 // Caches biggish chunks to compromise memory vs. speed.
\r
22 // Position to start next read
\r
28 // Bytes allocated to m_Buffer
\r
29 unsigned m_BufferSize;
\r
31 // Current position in buffer, normally points to '>'
\r
32 unsigned m_BufferOffset;
\r
34 // File data in buffer <= m_BufferSize
\r
35 unsigned m_BufferBytes;
\r
38 // Points into m_Buffer, not a separate buffer.
\r
41 // Current sequence length
\r
42 unsigned m_SeqLength;
\r
44 // Current seq index
\r
45 unsigned m_SeqIndex;
\r
47 unsigned m_ShortestLength;
\r
48 unsigned m_LongestLength;
\r
49 unsigned m_TooShortCount;
\r
50 unsigned m_TooLongCount;
\r
51 unsigned m_TooPolyCount;
\r
62 void Open(const string &FileName);
\r
65 bool GetIsNucleo() const { asserta(m_IsNucleoSet); return m_IsNucleo; };
\r
67 // Get next sequence.
\r
68 // Returns zero on end-of-file
\r
69 const byte *GetNextSeq();
\r
71 // Get next sequence as SeqData object, return false on end-of-file.
\r
72 bool GetNextSD(SeqData &SD);
\r
74 // Length of most recent sequence returned by GetNextSeq().
\r
75 unsigned GetSeqLength() const { return m_SeqLength; }
\r
77 // Label of most recent sequence returned by GetNextSeq().
\r
78 const char *GetLabel() const { return m_Label; }
\r
80 // Index of most recent sequence returned by GetNextSeq().
\r
81 unsigned GetSeqIndex() const { return m_SeqIndex; }
\r
83 unsigned GetPctDoneX10() const;
\r
84 double GetPctDone() const;
\r
90 const byte *GetNextSeqLo();
\r