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
|