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

#include <mcmc_caller.hpp>

Inheritance diagram for vg::MCMCCaller:
vg::VCFOutputCaller

Public Member Functions

 MCMCCaller (const PathPositionHandleGraph *path_position_handle_graph, PhasedGenome &genome, SnarlManager &snarl_manager, const string &sample_name, const vector< string > &ref_paths, const vector< size_t > &ref_path_offsets, const vector< size_t > &ref_path_lengths, ostream &out_stream=cout)
 
virtual ~MCMCCaller ()
 
void call_top_level_snarls (bool recurse_on_fail=true)
 
virtual string vcf_header (const PathPositionHandleGraph &graph, const vector< string > &ref_paths, const vector< size_t > &contig_length_overrides) const
 print vcf header More...
 
- Public Member Functions inherited from vg::VCFOutputCaller
 VCFOutputCaller (const string &sample_name)
 
virtual ~VCFOutputCaller ()
 
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...
 
bool add_variant (vcflib::Variant &var) const
 
void write_variants (ostream &out_stream, const SnarlManager *snarl_manager=nullptr)
 
void vcf_fixup (vcflib::Variant &var) const
 Run vcffixup from vcflib. More...
 
void set_translation (const unordered_map< nid_t, pair< string, size_t >> *translation)
 Add a translation map. More...
 
void set_nested (bool nested)
 Assume writing nested snarls is enabled. More...
 

Public Attributes

PhasedGenomegenome
 
SnarlManagersnarl_manager
 
const string sample_name = "SAMPLE"
 
const vector< size_t > ref_path_offsets = {}
 
const vector< size_t > ref_path_lengths = {}
 
ostream & out_stream
 
const SnarlTraversal trav
 

Protected Member Functions

void update_vcf_info (const Snarl &snarl, const vector< SnarlTraversal > &traversals, const vector< int > &genotype, const string &sample_name, vcflib::Variant &variant) const
 Update INFO and FORMAT fields of the called variant. More...
 
void emit_variant (const Snarl &snarl, const vector< int > &genotype, SnarlTraversal ref_trav, const string &ref_path_name, const vector< SnarlTraversal > &haplo_travs) const
 print a vcf variant More...
 
bool call_snarl (const Snarl &snarl)
 Call a given snarl, and print the output to out_stream. More...
 
bool is_traversable (const Snarl &snarl)
 check if a site can be handled More...
 
pair< size_t, bool > get_ref_position (const Snarl &snarl, const string &ref_path_name) const
 get position of reference path More...
 
void flatten_common_allele_ends (vcflib::Variant &variant, bool backward) const
 clean up the alleles to not share common prefixes / suffixes More...
 
- Protected Member Functions inherited from vg::VCFOutputCaller
void add_allele_path_to_info (const HandleGraph *graph, vcflib::Variant &v, int allele, const Traversal &trav, bool reversed, bool one_based) const
 add a traversal to the VCF info field in the format of a GFA W-line or GAF path More...
 
void add_allele_path_to_info (vcflib::Variant &v, int allele, const SnarlTraversal &trav, bool reversed, bool one_based) const
 legacy version of above More...
 
string trav_string (const HandleGraph &graph, const SnarlTraversal &trav) const
 convert a traversal into an allele string More...
 
bool 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, int ploidy, function< string(const vector< SnarlTraversal > &, const vector< int > &, int, int, int)> trav_to_string=nullptr)
 
tuple< int64_t, int64_t, bool, step_handle_t, step_handle_tget_ref_interval (const PathPositionHandleGraph &graph, const Snarl &snarl, const string &ref_path_name) const
 
pair< string, int64_t > get_ref_position (const PathPositionHandleGraph &graph, const Snarl &snarl, const string &ref_path_name, int64_t ref_path_offset) const
 used for making gaf traversal names More...
 
void flatten_common_allele_ends (vcflib::Variant &variant, bool backward, size_t len_override) const
 
string print_snarl (const HandleGraph *grpah, const handle_t &snarl_start, const handle_t &snarl_end, bool in_brackets=false) const
 
string print_snarl (const Snarl &snarl, bool in_brackets=false) const
 legacy version of above More...
 
void scan_snarl (const string &allele_string, function< void(const string &, Snarl &)> callback) const
 
void update_nesting_info_tags (const SnarlManager *snarl_manager)
 

Protected Attributes

const PathPositionHandleGraphpath_position_handle_graph
 path position handle graph 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...
 
- Protected Attributes inherited from vg::VCFOutputCaller
vcflib::VariantCallFile output_vcf
 output vcf More...
 
string sample_name
 Sample name. More...
 
vector< vector< pair< pair< string, size_t >, string > > > output_variants
 
size_t max_uncalled_alleles = 5
 print up to this many uncalled alleles when doing ref-genotpes in -a mode More...
 
const unordered_map< nid_t, pair< string, size_t > > * translation
 
bool include_nested
 

Additional Inherited Members

- Static Protected Attributes inherited from vg::VCFOutputCaller
static const int64_t max_vcf_line_length = 2000000000
 

Constructor & Destructor Documentation

◆ MCMCCaller()

vg::MCMCCaller::MCMCCaller ( const PathPositionHandleGraph path_position_handle_graph,
PhasedGenome genome,
SnarlManager snarl_manager,
const string &  sample_name,
const vector< string > &  ref_paths,
const vector< size_t > &  ref_path_offsets,
const vector< size_t > &  ref_path_lengths,
ostream &  out_stream = cout 
)

MCMCCaller : Inherits from VCFOutputCaller

keep track of offsets in the reference paths

◆ ~MCMCCaller()

vg::MCMCCaller::~MCMCCaller ( )
virtual

Member Function Documentation

◆ call_snarl()

bool vg::MCMCCaller::call_snarl ( const Snarl snarl)
protected

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

◆ call_top_level_snarls()

void vg::MCMCCaller::call_top_level_snarls ( bool  recurse_on_fail = true)

Run call_snarl() on every top-level snarl in the manager. For any that return false, try the children, etc. (when recurse_on_fail true) Snarls are processed in parallel

◆ emit_variant()

void vg::MCMCCaller::emit_variant ( const Snarl snarl,
const vector< int > &  genotype,
SnarlTraversal  ref_trav,
const string &  ref_path_name,
const vector< SnarlTraversal > &  haplo_travs 
) const
protected

print a vcf variant

◆ flatten_common_allele_ends()

void vg::MCMCCaller::flatten_common_allele_ends ( vcflib::Variant &  variant,
bool  backward 
) const
protected

clean up the alleles to not share common prefixes / suffixes

◆ get_ref_position()

pair< size_t, bool > vg::MCMCCaller::get_ref_position ( const Snarl snarl,
const string &  ref_path_name 
) const
protected

get position of reference path

◆ is_traversable()

bool vg::MCMCCaller::is_traversable ( const Snarl snarl)
protected

check if a site can be handled

◆ update_vcf_info()

void vg::MCMCCaller::update_vcf_info ( const Snarl snarl,
const vector< SnarlTraversal > &  traversals,
const vector< int > &  genotype,
const string &  sample_name,
vcflib::Variant &  variant 
) const
protected

Update INFO and FORMAT fields of the called variant.

◆ vcf_header()

string vg::MCMCCaller::vcf_header ( const PathPositionHandleGraph graph,
const vector< string > &  ref_paths,
const vector< size_t > &  contig_length_overrides 
) const
virtual

print vcf header

Member Data Documentation

◆ genome

PhasedGenome& vg::MCMCCaller::genome

◆ out_stream

ostream& vg::MCMCCaller::out_stream

◆ path_position_handle_graph

const PathPositionHandleGraph* vg::MCMCCaller::path_position_handle_graph
protected

path position handle graph

◆ ref_offsets

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

keep track of offsets in the reference paths

◆ ref_path_lengths

const vector<size_t> vg::MCMCCaller::ref_path_lengths = {}

◆ ref_path_offsets

const vector<size_t> vg::MCMCCaller::ref_path_offsets = {}

◆ ref_paths

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

keep track of the reference paths

◆ sample_name

const string vg::MCMCCaller::sample_name = "SAMPLE"

◆ snarl_manager

SnarlManager& vg::MCMCCaller::snarl_manager

◆ trav

const SnarlTraversal vg::MCMCCaller::trav

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