File: ReadInterval.hpp

package info (click to toggle)
pbseqlib 5.3.5%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,020 kB
  • sloc: cpp: 77,250; python: 331; sh: 103; makefile: 41
file content (45 lines) | stat: -rw-r--r-- 1,028 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
#ifndef _BLASR_READ_INTERVAL_HPP_
#define _BLASR_READ_INTERVAL_HPP_

#include <pbdata/reads/RegionAnnotation.hpp>

class RegionAnnotation;

class ReadInterval
{
public:
    int start;
    int end;
    int score;

    ReadInterval(int s = 0, int e = 0, int sc = 0) : start(s), end(e), score(sc){};

    ReadInterval(const RegionAnnotation &ra)
        : start(ra.GetStart()), end(ra.GetEnd()), score(ra.GetScore())
    {
    }

    ReadInterval &operator=(const ReadInterval &rhs)
    {
        start = rhs.start;
        end = rhs.end;
        score = rhs.score;
        return *this;
    }

    bool operator==(const ReadInterval &rhs) const
    {
        return (start == rhs.start and end == rhs.end and score == rhs.score);
    }

    inline friend std::ostream &operator<<(std::ostream &, const ReadInterval &);

    int Length(void) const { return end - start; }
};

inline std::ostream &operator<<(std::ostream &ss, const ReadInterval &interval)
{
    ss << interval.start << "_" << interval.end;
    return ss;
}
#endif