]> git.donarmstrong.com Git - rsem.git/blob - wiggle.h
add new files
[rsem.git] / wiggle.h
1 #include <cstdio>
2 #include <string>
3 #include <vector>
4 #include <ostream>
5
6 struct Wiggle {
7     std::string name;
8     std::vector<float> read_depth;
9     size_t length;
10 };
11
12 class WiggleProcessor {
13 public:
14     virtual ~WiggleProcessor() {}
15     virtual void process(const Wiggle& wiggle) = 0;
16 };
17
18 class UCSCWiggleTrackWriter : public WiggleProcessor {
19 public:
20     UCSCWiggleTrackWriter(const std::string& output_filename,
21                           const std::string& track_name);
22         
23     ~UCSCWiggleTrackWriter();
24
25     void process(const Wiggle& wiggle);
26
27 private:
28     FILE *fo;
29 };
30
31 class ReadDepthWriter : public WiggleProcessor {
32 public:
33     ReadDepthWriter(std::ostream& stream);
34
35     void process(const Wiggle& wiggle);
36
37 private:
38     std::ostream& stream_;
39 };
40
41 void build_wiggles(const std::string& bam_filename,
42                    WiggleProcessor& processor);