Gamgee
You miserable little maggot. I'll stove your head in!
|
Utility class to store an genomic location (Interval). More...
#include <interval.h>
Public Types | |
enum | IntervalType { IntervalType::GATK, IntervalType::PICARD, IntervalType::BED } |
supported output formats for an Interval More... | |
Public Member Functions | |
Interval () | |
creates an interval with standard values More... | |
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 More... | |
Interval (const Interval &)=default | |
Interval (Interval &&)=default | |
Interval & | operator= (const Interval &)=default |
Interval & | operator= (Interval &&)=default |
bool | operator== (const Interval &rhs) const |
Checks two Intervals for equality. More... | |
bool | operator!= (const Interval &rhs) const |
Checks two intervals for inequality. More... | |
uint32_t | size () const |
calculates the number of loci in the Intervals More... | |
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 Interval. More... | |
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 Interval. More... | |
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 Interval with overlaps More... | |
std::string | str () const |
returns a string representation of the interval More... | |
std::string | chr () const |
uint32_t | start () const |
uint32_t | stop () const |
IntervalType | output_type () const |
void | set_chr (const std::string &chr) |
void | set_start (const uint32_t start) |
void | set_stop (const uint32_t stop) |
void | set_output_type (const IntervalType output_type) |
Utility class to store an genomic location (Interval).
An Interval can be of one or many consecutive bases in a chromosome (contig). We represent Intervals with chromosome, start and stop. A one base Interval has start == stop. No Interval can go beyond a chromosome boundary.
The Interval can be output to any output stream (e.g. stdout, file, ...) in any of the supported interval formats.
|
strong |
supported output formats for an Interval
Enumerator | |
---|---|
GATK |
GATK format – chr:start-stop. |
PICARD |
PICARD format – chr [tab] start [tab] stop [tab] strand [tab] comments. |
BED |
BED format – chr [tab] start [tab] stop. |
|
inline |
creates an interval with standard values
chromosome, start and stop are all set to 0. Output type is IntervalType::GATK.
|
inlineexplicit |
creates an interval with all parameters
chr | chromosome |
start | start location (inclusive) |
stop | stop location (inclusive) |
output_type | desired output format (only used if Interval is sent to output stream) |
|
default |
|
default |
|
inline |
|
inline |
Checks two intervals for inequality.
Implementation is the negation of operator==
bool gamgee::Interval::operator== | ( | const Interval & | rhs | ) | const |
Checks two Intervals for equality.
rhs | the other Interval to compare to |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
std::string gamgee::Interval::str | ( | ) | const |
returns a string representation of the interval
vector< Interval > gamgee::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 Interval.
Warning: by design, the Interval may or may not be covered on the right (stop) side depending on the length of the original Interval and the parameters passed.
tile_size | size of the tiles (small Intervals) to be generated |
spacing | how many loci to leave in between the tiles (small Intervals) |
vector< Interval > gamgee::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 Interval.
Warning: by design, the Interval may or may not be covered on the left (start) side depending on the length of the original Interval and the parameters passed.
tile_size | size of the tiles (small Intervals) to be generated |
spacing | how many loci to leave in between the tiles (small Intervals) |
vector< Interval > gamgee::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 Interval with overlaps
This tiling procedure will guarantee that the entire Interval is covered (tiled) by creating a list of overlapping tiles that can be used as baits if the design of the overlapping baits is split between the forward and reverse strands of the reference genome. The overlapping bait will always be centered in the spacing between the two baits in the opposite strand.
spacing | number of loci in between the tiles |
insert_size | insert size intended to be used with these baits |
flanking | region before and after the target to include in the tiling |