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

#include <vcf_genotyper.hpp>

Inheritance diagram for vg::VCFGenotyper:
vg::GraphCaller vg::GAFOutputCaller

Public Member Functions

 VCFGenotyper (const PathHandleGraph &graph, SnarlCaller &snarl_caller, SnarlManager &snarl_manager, vcflib::VariantCallFile &variant_file, const string &sample_name, const vector< string > &ref_paths, const vector< int > &ref_path_ploidies, FastaReference *ref_fasta, FastaReference *ins_fasta, AlignmentEmitter *aln_emitter, bool traversals_only, bool gaf_output, size_t trav_padding)
 
virtual ~VCFGenotyper ()
 
virtual bool call_snarl (const Snarl &snarl)
 Call a given snarl, and print the output to out_stream. More...
 
vector< size_t > contig_lengths (const vector< string > &contigs) const
 
- 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 Member Functions inherited from vg::GAFOutputCaller
 GAFOutputCaller (AlignmentEmitter *emitter, const string &sample_name, const vector< string > &ref_paths, size_t trav_padding)
 The emitter object is created and owned by external forces. More...
 
virtual ~GAFOutputCaller ()
 
void emit_gaf_traversals (const PathHandleGraph &graph, const string &snarl_name, const vector< SnarlTraversal > &travs, int64_t ref_trav_idx, const string &ref_path_name, int64_t ref_path_position, const TraversalSupportFinder *support_finder=nullptr)
 print the GAF traversals More...
 
void emit_gaf_variant (const PathHandleGraph &graph, const string &snarl_name, const vector< SnarlTraversal > &travs, const vector< int > &genotype, int64_t ref_trav_idx, const string &ref_path_name, int64_t ref_path_position, const TraversalSupportFinder *support_finder=nullptr)
 print the GAF genotype More...
 
SnarlTraversal pad_traversal (const PathHandleGraph &graph, const SnarlTraversal &trav) const
 pad a traversal with (first found) reference path, adding up to trav_padding to each side More...
 

Public Attributes

SortedVCFWriter vcf_writer
 The sorted VCF the records go to. More...
 

Protected Member Functions

tuple< string, size_t, size_t > get_ref_positions (const vector< vcflib::Variant * > &variants) const
 get path positions bounding a set of variants More...
 
virtual unordered_map< string, size_t > scan_contig_lengths () const
 munge out the contig lengths from the VCF header 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 PathHandleGraph & graph
 the graph More...
 
vcflib::VariantCallFile & input_vcf
 input VCF to genotype, must have been loaded etc elsewhere More...
 
VCFTraversalFinder traversal_finder
 
bool traversals_only
 toggle whether to genotype or just output the traversals More...
 
bool gaf_output
 toggle whether to output vcf or gaf More...
 
unordered_map< string, int > path_to_ploidy
 the ploidies More...
 
- 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...
 
- Protected Attributes inherited from vg::GAFOutputCaller
AlignmentEmitter * emitter
 
string gaf_sample_name
 Sample name. More...
 
size_t trav_padding = 0
 
unordered_set< string > ref_paths
 Reference paths are used to pad out traversals. If there are none, then first path found is used. 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

VCFGenotyper : Genotype variants in a given VCF file

Constructor & Destructor Documentation

◆ VCFGenotyper()

vg::VCFGenotyper::VCFGenotyper ( const PathHandleGraph &  graph,
SnarlCaller &  snarl_caller,
SnarlManager &  snarl_manager,
vcflib::VariantCallFile &  variant_file,
const string &  sample_name,
const vector< string > &  ref_paths,
const vector< int > &  ref_path_ploidies,
FastaReference *  ref_fasta,
FastaReference *  ins_fasta,
AlignmentEmitter *  aln_emitter,
bool  traversals_only,
bool  gaf_output,
size_t  trav_padding 
)

◆ ~VCFGenotyper()

vg::VCFGenotyper::~VCFGenotyper ( )
virtual

Member Function Documentation

◆ call_snarl()

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

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

Implements vg::GraphCaller.

◆ contig_lengths()

vector< size_t > vg::VCFGenotyper::contig_lengths ( const vector< string > &  contigs) const

Return the length of each of contigs that the header of the input VCF gives, or 0 for a contig it does not give.

◆ get_ref_positions()

tuple< string, size_t, size_t > vg::VCFGenotyper::get_ref_positions ( const vector< vcflib::Variant * > &  variants) const
protected

get path positions bounding a set of variants

◆ scan_contig_lengths()

unordered_map< string, size_t > vg::VCFGenotyper::scan_contig_lengths ( ) const
protectedvirtual

munge out the contig lengths from the VCF header

Member Data Documentation

◆ gaf_output

bool vg::VCFGenotyper::gaf_output
protected

toggle whether to output vcf or gaf

◆ graph

const PathHandleGraph& vg::VCFGenotyper::graph
protected

the graph

◆ input_vcf

vcflib::VariantCallFile& vg::VCFGenotyper::input_vcf
protected

input VCF to genotype, must have been loaded etc elsewhere

◆ path_to_ploidy

unordered_map<string, int> vg::VCFGenotyper::path_to_ploidy
protected

the ploidies

◆ traversal_finder

VCFTraversalFinder vg::VCFGenotyper::traversal_finder
protected

traversal finder uses alt paths to map VCF alleles from input_vcf back to traversals in the snarl

◆ traversals_only

bool vg::VCFGenotyper::traversals_only
protected

toggle whether to genotype or just output the traversals

◆ vcf_writer

SortedVCFWriter vg::VCFGenotyper::vcf_writer

The sorted VCF the records go to.


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