vg
tools for working with variation graphs
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
vg::LegacyCaller Class Reference

#include <legacy_caller.hpp>

Inheritance diagram for vg::LegacyCaller:
vg::GraphCaller

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={}, const vector< int > &ref_path_ploidies={})
 
virtual ~LegacyCaller ()
 
virtual bool call_snarl (const Snarl &snarl)
 Call a given snarl, and print the output to out_stream. More...
 
- Public Member Functions inherited from vg::GraphCaller
 GraphCaller (SnarlCaller &snarl_caller, SnarlManager &snarl_manager)
 
virtual ~GraphCaller ()
 
virtual void call_top_level_snarls (const HandleGraph &graph, RecurseType recurse_type=RecurseOnFail)
 
virtual void call_top_level_chains (const HandleGraph &graph, size_t max_edges, size_t max_trivial, RecurseType recurise_type=RecurseOnFail)
 
void set_show_progress (bool show_progress)
 toggle progress messages More...
 
void set_snarl_batching (size_t window_size)
 
void set_ploidy_regions (PloidyRegions regions)
 

Public Attributes

SortedVCFWriter vcf_writer
 The sorted VCF the records go to. More...
 
SiteEmitter site_emitter
 Writes the record of each called site into vcf_writer. 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...
 
- Protected Member Functions inherited from vg::GraphCaller
vector< Chain > break_chain (const HandleGraph &graph, const Chain &chain, size_t max_edges, size_t max_trivial) const
 Break up a chain into bits that we want to call using size heuristics. More...
 

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...
 
map< string, int > ref_ploidies
 keep track of ploidies in the reference paths More...
 
int max_search_depth = 1000
 Tuning. More...
 
int max_search_width = 1000
 
size_t max_bubble_paths = 100
 
- Protected Attributes inherited from vg::GraphCaller
SnarlCaller & snarl_caller
 Our Genotyper. More...
 
SnarlManager & snarl_manager
 Our snarls. More...
 
size_t snarl_batch_window = 0
 
bool show_progress
 Toggle progress messages. More...
 
PloidyRegions ploidy_regions
 The ploidy of regions of the reference, which overrides the ploidy of their paths. More...
 

Additional Inherited Members

- Public Types inherited from vg::GraphCaller
using RecurseType = vg::RecurseType
 
- Static Public Attributes inherited from vg::GraphCaller
static constexpr RecurseType RecurseOnFail = RecurseType::OnFail
 
static constexpr RecurseType RecurseAlways = RecurseType::Always
 
static constexpr RecurseType RecurseNever = RecurseType::Never
 

Detailed Description

LegacyCaller : Preserves (most of) the old vg call logic by using the RepresentativeTraversalFinder to recursively find traversals through arbitrary sites.

Constructor & Destructor Documentation

◆ LegacyCaller()

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 = {},
const vector< int > &  ref_path_ploidies = {} 
)

◆ ~LegacyCaller()

vg::LegacyCaller::~LegacyCaller ( )
virtual

Member Function Documentation

◆ call_snarl()

bool vg::LegacyCaller::call_snarl ( const Snarl &  snarl)
virtual

Call a given snarl, and print the output to out_stream.

Implements vg::GraphCaller.

◆ find_index()

pair< string, PathIndex * > vg::LegacyCaller::find_index ( const Snarl &  snarl,
const vector< PathIndex * >  path_indexes 
) const
protected

look up a path index for a site and return its name too

◆ get_reference_traversal()

SnarlTraversal vg::LegacyCaller::get_reference_traversal ( const Snarl &  snarl,
TraversalFinder &  trav_finder 
) const
protected

we need the reference traversal for VCF, but if the ref is not called, the above method won't find it.

◆ is_traversable()

bool vg::LegacyCaller::is_traversable ( const Snarl &  snarl)
protected

check if a site can be handled by the RepresentativeTraversalFinder

◆ re_genotype()

tuple< vector< SnarlTraversal >, vector< int >, unique_ptr< SnarlCaller::CallInfo > > vg::LegacyCaller::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
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

◆ top_down_genotype()

pair< vector< SnarlTraversal >, vector< int > > vg::LegacyCaller::top_down_genotype ( const Snarl &  snarl,
TraversalFinder &  trav_finder,
int  ploidy,
const string &  ref_path_name,
pair< size_t, size_t >  ref_interval 
) const
protected

recursively genotype a snarl todo: can this be pushed to a more generic class?

Member Data Documentation

◆ graph

const PathPositionHandleGraph& vg::LegacyCaller::graph
protected

the graph

◆ is_vg

bool vg::LegacyCaller::is_vg
protected

non-vg inputs are converted into vg as-needed, at least until we get the traversal finding ported

◆ max_bubble_paths

size_t vg::LegacyCaller::max_bubble_paths = 100
protected

What's the maximum number of bubble path combinations we can explore while finding one with maximum support?

◆ max_search_depth

int vg::LegacyCaller::max_search_depth = 1000
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.

◆ max_search_width

int vg::LegacyCaller::max_search_width = 1000
protected

How many search states should we allow on the DFS stack when searching for traversals?

◆ path_indexes

vector<PathIndex*> vg::LegacyCaller::path_indexes
protected

Needed by above (only used when working on vg inputs – generated on the fly otherwise)

◆ ref_offsets

map<string, size_t> vg::LegacyCaller::ref_offsets
protected

keep track of offsets in the reference paths

◆ ref_paths

vector<string> vg::LegacyCaller::ref_paths
protected

keep track of the reference paths

◆ ref_ploidies

map<string, int> vg::LegacyCaller::ref_ploidies
protected

keep track of ploidies in the reference paths

◆ site_emitter

SiteEmitter vg::LegacyCaller::site_emitter

Writes the record of each called site into vcf_writer.

◆ traversal_finder

RepresentativeTraversalFinder* vg::LegacyCaller::traversal_finder
protected

The old vg call traversal finder. It is fairly efficient but daunting to maintain. We keep it around until a better replacement is implemented. It is not compatible with the Handle Graph API because it relise on PathIndex. We convert to VG as needed in order to use it.

◆ vcf_writer

SortedVCFWriter vg::LegacyCaller::vcf_writer

The sorted VCF the records go to.


The documentation for this class was generated from the following files: