1 #ifndef gamgee__interval__guard
2 #define gamgee__interval__guard
86 inline uint32_t
size()
const {
return m_stop - m_start + 1; }
98 std::vector<Interval>
tile_left(
const uint32_t tile_size,
99 const uint32_t spacing
112 std::vector<Interval>
tile_right(
const uint32_t tile_size,
113 const uint32_t spacing
127 std::vector<Interval>
tsca_tiling(
const uint32_t spacing,
128 const uint32_t insert_size,
129 const uint32_t flanking
132 std::string
str()
const;
134 std::string
chr()
const {
return m_chr; }
135 uint32_t
start()
const {
return m_start; }
136 uint32_t
stop()
const {
return m_stop; }
158 std::vector<Interval>
read_intervals(
const std::string& intervals_file);
IntervalType output_type() const
Definition: interval.h:137
Utility class to store an genomic location (Interval).
Definition: interval.h:19
std::vector< Interval > tile_left(const uint32_t tile_size, const uint32_t spacing) const
Tiles an Interval with smaller Intervals anchoring (starting) on the left side (start) of the Interva...
Definition: interval.cpp:65
std::string chr() const
Definition: interval.h:134
bool operator==(const Interval &rhs) const
Checks two Intervals for equality.
Definition: interval.cpp:81
std::ostream & operator<<(std::ostream &, const gamgee::Interval &)
outputs the interval in the outputtype format
Definition: interval.cpp:94
void set_stop(const uint32_t stop)
Definition: interval.h:140
IntervalType
supported output formats for an Interval
Definition: interval.h:23
Interval()
creates an interval with standard values
Definition: interval.h:34
bool operator!=(const Interval &rhs) const
Checks two intervals for inequality.
Definition: interval.h:79
void set_output_type(const IntervalType output_type)
Definition: interval.h:141
Interval & operator=(const Interval &)=default
PICARD format – chr [tab] start [tab] stop [tab] strand [tab] comments.
void set_start(const uint32_t start)
Definition: interval.h:139
std::string str() const
returns a string representation of the interval
Definition: interval.cpp:85
GATK format – chr:start-stop.
std::vector< Interval > tile_right(const uint32_t tile_size, const uint32_t spacing) const
Tiles an Interval with smaller Intervals anchoring (starting) on the right side (stop) of the Interva...
Definition: interval.cpp:73
vector< Interval > read_intervals(const string &intervals_file)
Definition: interval.cpp:39
Definition: exceptions.h:9
BED format – chr [tab] start [tab] stop.
uint32_t size() const
calculates the number of loci in the Intervals
Definition: interval.h:86
uint32_t start() const
Definition: interval.h:135
void set_chr(const std::string &chr)
Definition: interval.h:138
std::vector< Interval > tsca_tiling(const uint32_t spacing, const uint32_t insert_size, const uint32_t flanking) const
creates tiling TSCA baits (small intervals with an insert in between) that tile across the entire Int...
Definition: interval.cpp:53
Interval(const std::string &chr, const uint32_t start, const uint32_t stop, const IntervalType output_type=IntervalType::GATK)
creates an interval with all parameters
Definition: interval.h:49
uint32_t stop() const
Definition: interval.h:136