StochHMM  v0.34
Flexible Hidden Markov Model C++ Library and Application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sequenceStream.h
Go to the documentation of this file.
1 //
2 // sequenceStream.h
3 // StochHMM
4 //
5 // Created by Ken Yu on 7/17/12.
6 // Copyright 2012 University of California, Davis. All rights reserved.
7 //
8 #ifndef sequenceStream_H
9 #define sequenceStream_H
10 
11 #include "sequence.h"
12 #include "track.h"
13 #include <iostream>
14 #include <fstream>
15 #include <string>
16 
17 namespace StochHMM {
18 
19  class sequenceStream: public sequence {
20  public:
21 
23  sequenceStream(bool); //True if Real number track, False if alpha
24  sequenceStream(std::vector<double>*,track*);
25  sequenceStream(char* , track*);
26  sequenceStream(std::string&, track*);
27 
28 
29  sequenceStream(size_t, size_t);
30  sequenceStream(size_t, size_t, bool); //True if Real number track, False if alpha
31  sequenceStream(size_t, size_t, std::vector<double>*,track*);
32  sequenceStream(size_t, size_t, std::string&, track*);
33  sequenceStream(size_t, size_t, char* , track*);
34 
35  //~sequenceStream();
36 
37  bool getFasta(std::ifstream&, track*);
38 
39  inline void setBuffer (size_t buff) { bufferSize = buff; }
40  inline void setRetain (size_t ret) { retainSize = ret; }
41 
42  private:
43  size_t bufferSize;
44  size_t retainSize;
45 
46  //!What is left in "getline" after the buffer has been filled
47  std::string previousSeq;
48 
49  //!The retain sequence
50  std::string retain;
51 
52  //!Keeps track of whether the sequence under the same header is being read
54 
55  //!Reset seq or realseq each time getfasta is called
56  void resetSeq ();
57  };
58 }
59 #endif /*sequenceStream_H*/