]> git.donarmstrong.com Git - rsem.git/blob - wiggle.h
Added posterior standard deviation of counts as output if either '--calc-pme' or...
[rsem.git] / wiggle.h
1 #ifndef WIGGLE_H_
2 #define WIGGLE_H_
3
4 #include <cstdio>
5 #include <string>
6 #include <vector>
7 #include <ostream>
8
9 extern bool no_fractional_weight; // if no_frac_weight == true, each alignment counts as weight 1
10
11 struct Wiggle {
12     std::string name;
13     std::vector<double> read_depth;
14     size_t length;
15 };
16
17 class WiggleProcessor {
18 public:
19     virtual ~WiggleProcessor() {}
20     virtual void process(const Wiggle& wiggle) = 0;
21 };
22
23 class UCSCWiggleTrackWriter : public WiggleProcessor {
24 public:
25     UCSCWiggleTrackWriter(const std::string& output_filename,
26                           const std::string& track_name);
27         
28     ~UCSCWiggleTrackWriter();
29
30     void process(const Wiggle& wiggle);
31
32 private:
33     FILE *fo;
34 };
35
36 class ReadDepthWriter : public WiggleProcessor {
37 public:
38     ReadDepthWriter(std::ostream& stream);
39
40     void process(const Wiggle& wiggle);
41
42 private:
43     std::ostream& stream_;
44 };
45
46 void build_wiggles(const std::string& bam_filename,
47                    WiggleProcessor& processor);
48
49 #endif