File: wiggle.h

package info (click to toggle)
rsem 1.3.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 37,664 kB
  • sloc: cpp: 19,230; perl: 1,326; python: 1,245; ansic: 547; makefile: 186; sh: 154
file content (49 lines) | stat: -rw-r--r-- 1,010 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef WIGGLE_H_
#define WIGGLE_H_

#include <cstdio>
#include <string>
#include <vector>
#include <ostream>

extern bool no_fractional_weight; // if no_frac_weight == true, each alignment counts as weight 1

struct Wiggle {
    std::string name;
    std::vector<double> read_depth;
    size_t length;
};

class WiggleProcessor {
public:
    virtual ~WiggleProcessor() {}
    virtual void process(const Wiggle& wiggle) = 0;
};

class UCSCWiggleTrackWriter : public WiggleProcessor {
public:
    UCSCWiggleTrackWriter(const std::string& output_filename,
                          const std::string& track_name);
        
    ~UCSCWiggleTrackWriter();

    void process(const Wiggle& wiggle);

private:
    FILE *fo;
};

class ReadDepthWriter : public WiggleProcessor {
public:
    ReadDepthWriter(std::ostream& stream);

    void process(const Wiggle& wiggle);

private:
    std::ostream& stream_;
};

void build_wiggles(const std::string& bam_filename,
                   WiggleProcessor& processor);

#endif