vg
tools for working with variation graphs
|
#include <graph_caller.hpp>
Public Member Functions | |
LegacyCaller (const PathPositionHandleGraph &graph, SupportBasedSnarlCaller &snarl_caller, SnarlManager &snarl_manager, const string &sample_name, const vector< string > &ref_paths={}, const vector< size_t > &ref_path_offsets={}) | |
virtual | ~LegacyCaller () |
virtual bool | call_snarl (const Snarl &snarl, int ploidy) |
Call a given snarl, and print the output to out_stream. More... | |
virtual string | vcf_header (const PathHandleGraph &graph, const vector< string > &contigs, const vector< size_t > &contig_length_overrides={}) const |
Write the vcf header (version and contigs and basic info) More... | |
![]() | |
GraphCaller (SnarlCaller &snarl_caller, SnarlManager &snarl_manager) | |
virtual | ~GraphCaller () |
virtual void | call_top_level_snarls (const HandleGraph &graph, int ploidy, bool recurse_on_fail=true) |
virtual void | call_top_level_chains (const HandleGraph &graph, int ploidy, size_t max_edges, size_t max_trivial, bool recurse_on_fail=true) |
![]() | |
VCFOutputCaller (const string &sample_name) | |
virtual | ~VCFOutputCaller () |
void | add_variant (vcflib::Variant &var) const |
Add a variant to our buffer. More... | |
void | write_variants (ostream &out_stream) const |
Sort then write variants in the buffer. More... | |
Protected Member Functions | |
pair< vector< SnarlTraversal >, vector< int > > | top_down_genotype (const Snarl &snarl, TraversalFinder &trav_finder, int ploidy, const string &ref_path_name, pair< size_t, size_t > ref_interval) const |
SnarlTraversal | get_reference_traversal (const Snarl &snarl, TraversalFinder &trav_finder) const |
we need the reference traversal for VCF, but if the ref is not called, the above method won't find it. More... | |
tuple< vector< SnarlTraversal >, vector< int >, unique_ptr< SnarlCaller::CallInfo > > | re_genotype (const Snarl &snarl, TraversalFinder &trav_finder, const vector< SnarlTraversal > &in_traversals, const vector< int > &in_genotype, int ploidy, const string &ref_path_name, pair< size_t, size_t > ref_interval) const |
bool | is_traversable (const Snarl &snarl) |
check if a site can be handled by the RepresentativeTraversalFinder More... | |
pair< string, PathIndex * > | find_index (const Snarl &snarl, const vector< PathIndex * > path_indexes) const |
look up a path index for a site and return its name too More... | |
![]() | |
vector< Chain > | break_chain (const HandleGraph &graph, const Chain &chain, size_t max_edges, size_t max_trivial) |
Break up a chain into bits that we want to call using size heuristics. More... | |
![]() | |
void | emit_variant (const PathPositionHandleGraph &graph, SnarlCaller &snarl_caller, const Snarl &snarl, const vector< SnarlTraversal > &called_traversals, const vector< int > &genotype, int ref_trav_idx, const unique_ptr< SnarlCaller::CallInfo > &call_info, const string &ref_path_name, int ref_offset, bool genotype_snarls) const |
print a vcf variant More... | |
tuple< size_t, size_t, bool, step_handle_t, step_handle_t > | get_ref_interval (const PathPositionHandleGraph &graph, const Snarl &snarl, const string &ref_path_name) const |
void | flatten_common_allele_ends (vcflib::Variant &variant, bool backward, size_t len_override) const |
Protected Attributes | |
const PathPositionHandleGraph & | graph |
the graph More... | |
bool | is_vg |
RepresentativeTraversalFinder * | traversal_finder |
vector< PathIndex * > | path_indexes |
Needed by above (only used when working on vg inputs – generated on the fly otherwise) More... | |
vector< string > | ref_paths |
keep track of the reference paths More... | |
map< string, size_t > | ref_offsets |
keep track of offsets in the reference paths More... | |
int | max_search_depth = 1000 |
Tuning. More... | |
int | max_search_width = 1000 |
size_t | max_bubble_paths = 100 |
![]() | |
SnarlCaller & | snarl_caller |
Our Genotyper. More... | |
SnarlManager & | snarl_manager |
Our snarls. More... | |
![]() | |
vcflib::VariantCallFile | output_vcf |
output vcf More... | |
string | sample_name |
Sample name. More... | |
vector< vector< vcflib::Variant > > | output_variants |
output buffers (1/thread) (for sorting) More... | |
size_t | max_uncalled_alleles = 5 |
print up to this many uncalled alleles when doing ref-genotpes in -a mode More... | |
LegacyCaller : Preserves (most of) the old vg call logic by using the RepresentativeTraversalFinder to recursively find traversals through arbitrary sites.
vg::LegacyCaller::LegacyCaller | ( | const PathPositionHandleGraph & | graph, |
SupportBasedSnarlCaller & | snarl_caller, | ||
SnarlManager & | snarl_manager, | ||
const string & | sample_name, | ||
const vector< string > & | ref_paths = {} , |
||
const vector< size_t > & | ref_path_offsets = {} |
||
) |
|
virtual |
|
virtual |
Call a given snarl, and print the output to out_stream.
Implements vg::GraphCaller.
|
protected |
look up a path index for a site and return its name too
|
protected |
we need the reference traversal for VCF, but if the ref is not called, the above method won't find it.
|
protected |
check if a site can be handled by the RepresentativeTraversalFinder
|
protected |
re-genotype output of top_down_genotype. it may give slightly different results as it's working with fully-defined traversals and can exactly determine lengths and supports it will also make sure the reference traversal is in the beginning of the output
|
protected |
recursively genotype a snarl todo: can this be pushed to a more generic class?
|
virtual |
Write the vcf header (version and contigs and basic info)
Reimplemented from vg::VCFOutputCaller.
|
protected |
the graph
|
protected |
non-vg inputs are converted into vg as-needed, at least until we get the traversal finding ported
|
protected |
What's the maximum number of bubble path combinations we can explore while finding one with maximum support?
|
protected |
Tuning.
How many nodes should we be willing to look at on our path back to the primary path? Keep in mind we need to look at all valid paths (and all combinations thereof) until we find a valid pair.
|
protected |
How many search states should we allow on the DFS stack when searching for traversals?
|
protected |
Needed by above (only used when working on vg inputs – generated on the fly otherwise)
|
protected |
keep track of offsets in the reference paths
|
protected |
keep track of the reference paths
|
protected |