vg
tools for working with variation graphs
|
#include <gapless_extender.hpp>
Public Types | |
typedef GaplessExtension::seed_type | seed_type |
typedef pair_hash_set< seed_type > | cluster_type |
Public Member Functions | |
GaplessExtender () | |
Create an empty GaplessExtender. More... | |
GaplessExtender (const gbwtgraph::GBWTGraph &graph, const Aligner &aligner) | |
Create a GaplessExtender using the given GBWTGraph and Aligner objects. More... | |
std::vector< GaplessExtension > | extend (cluster_type &cluster, const std::string &sequence, size_t max_mismatches=MAX_MISMATCHES, bool trim_extensions=true) const |
void | trim (std::vector< GaplessExtension > &extensions, size_t max_mismatches=MAX_MISMATCHES, const gbwt::CachedGBWT *cache=nullptr) const |
Static Public Member Functions | |
static seed_type | to_seed (pos_t pos, size_t read_offset) |
Convert (graph position, read offset) to a seed. More... | |
static pos_t | get_pos (seed_type seed) |
Get the graph position from a seed. More... | |
static handle_t | get_handle (seed_type seed) |
Get the handle from a seed. More... | |
static size_t | get_node_offset (seed_type seed) |
Get the node offset from a seed. More... | |
static size_t | get_read_offset (seed_type seed) |
Get the read offset from a seed. More... | |
Public Attributes | |
const gbwtgraph::GBWTGraph * | graph |
const Aligner * | aligner |
Static Public Attributes | |
constexpr static size_t | MAX_MISMATCHES = 4 |
The default value for the maximum number of mismatches. More... | |
A class that supports haplotype-consistent seed extension using GBWTGraph. Each seed is a pair of matching read/graph positions and each extension is a gapless alignment of an interval of the read to a haplotype. A cluster is an unordered set of distinct seeds. Seeds in the same node with the same (read_offset - node_offset) difference are considered equivalent. All seeds in a cluster should correspond to the same alignment or positions near it. GaplessExtender also needs an Aligner object for scoring the extension candidates.
vg::GaplessExtender::GaplessExtender | ( | ) |
Create an empty GaplessExtender.
|
explicit |
Create a GaplessExtender using the given GBWTGraph and Aligner objects.
std::vector< GaplessExtension > vg::GaplessExtender::extend | ( | cluster_type & | cluster, |
const std::string & | sequence, | ||
size_t | max_mismatches = MAX_MISMATCHES , |
||
bool | trim_extensions = true |
||
) | const |
Find two highest-scoring full-length alignments for the sequence within the cluster with at most max_mismatches mismatches. If that is not possible, find the set of highest-scoring maximal extensions of the seeds, allowing any number of mismatches in the seed node and max_mismatches / 2 mismatches on each flank. Flanks may have more mismatches if it does not bring the total beyond max_mismatches. Then call trim() if trim_extensions i set. The extensions are sorted by their coordinates in the sequence.
Get the handle from a seed.
|
inlinestatic |
Get the node offset from a seed.
Get the graph position from a seed.
|
inlinestatic |
Get the read offset from a seed.
Convert (graph position, read offset) to a seed.
void vg::GaplessExtender::trim | ( | std::vector< GaplessExtension > & | extensions, |
size_t | max_mismatches = MAX_MISMATCHES , |
||
const gbwt::CachedGBWT * | cache = nullptr |
||
) | const |
Try to improve the score of each extension by trimming mismatches from the flanks. Do not trim full-length alignments with <= max_mismatches mismatches. Use the provided CachedGBWT or allocate a new one. Note that extend() already calls this by default.
const Aligner* vg::GaplessExtender::aligner |
const gbwtgraph::GBWTGraph* vg::GaplessExtender::graph |
|
staticconstexpr |
The default value for the maximum number of mismatches.