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

#include <snarl_caller.hpp>

Inheritance diagram for vg::RatioSupportSnarlCaller:
vg::SupportBasedSnarlCaller vg::SnarlCaller

Public Member Functions

 RatioSupportSnarlCaller (const PathHandleGraph &graph, SnarlManager &snarl_manager, TraversalSupportFinder &support_finder)
 
virtual ~RatioSupportSnarlCaller ()
 
void set_het_bias (double het_bias, double ref_het_bias=0.)
 Set some of the parameters. More...
 
virtual pair< vector< int >, unique_ptr< CallInfo > > genotype (const Snarl &snarl, const vector< SnarlTraversal > &traversals, int ref_trav_idx, int ploidy, const string &ref_path_name, pair< size_t, size_t > ref_range)
 Get the genotype of a site. More...
 
virtual void update_vcf_info (const Snarl &snarl, const vector< SnarlTraversal > &traversals, const vector< int > &genotype, const unique_ptr< CallInfo > &call_info, const string &sample_name, vcflib::Variant &variant)
 Update INFO and FORMAT fields of the called variant. More...
 
virtual void update_vcf_header (string &header) const
 Define any header fields needed by the above. More...
 
- Public Member Functions inherited from vg::SupportBasedSnarlCaller
 SupportBasedSnarlCaller (const PathHandleGraph &graph, SnarlManager &snarl_manager, TraversalSupportFinder &support_finder)
 
virtual ~SupportBasedSnarlCaller ()
 
void set_min_supports (double min_mad_for_call, double min_support_for_call, double min_site_support)
 Set some of the parameters. More...
 
TraversalSupportFinderget_support_finder () const
 Get the traversal support finder. More...
 
virtual int get_min_total_support_for_call () const
 Get the minimum total support for call. More...
 
virtual function< bool(const SnarlTraversal &, int iteration)> get_skip_allele_fn () const
 Use min_alt_path_support threshold as cutoff. More...
 
- Public Member Functions inherited from vg::SnarlCaller
virtual ~SnarlCaller ()
 

Protected Member Functions

double get_bias (const vector< int > &traversal_sizes, int best_trav, int second_best_trav, int ref_trav_idx) const
 
unordered_map< id_t, size_t > get_ref_offsets (const SnarlTraversal &ref_trav) const
 

Protected Attributes

double max_het_bias = 6
 Tuning. More...
 
double max_ref_het_bias = 6
 Like above, but applied to ref / alt ratio (instead of alt / ref) More...
 
double max_indel_het_bias = 6
 Like the max het bias, but applies to novel indels. More...
 
double max_ma_bias = 0
 
double min_ad_log_likelihood_for_filter = -9
 what's the min log likelihood for allele depth assignments to PASS? More...
 
- Protected Attributes inherited from vg::SupportBasedSnarlCaller
const PathHandleGraphgraph
 
SnarlManagersnarl_manager
 
TraversalSupportFindersupport_finder
 Get support from traversals. More...
 
int min_total_support_for_call = 2
 
size_t min_mad_for_filter = 1
 
size_t min_site_depth = 4
 
double min_alt_path_support = 0.5
 

Additional Inherited Members

- Static Protected Member Functions inherited from vg::SupportBasedSnarlCaller
static int get_best_support (const vector< Support > &supports, const vector< int > &skips)
 Get the best support out of a list of supports, ignoring skips. More...
 
static double support_val (const Support &support)
 Relic from old code. More...
 

Detailed Description

Find the genotype of some traversals in a site using read support and a bias ratio to tell heterozygous from homozygous

Constructor & Destructor Documentation

◆ RatioSupportSnarlCaller()

vg::RatioSupportSnarlCaller::RatioSupportSnarlCaller ( const PathHandleGraph graph,
SnarlManager snarl_manager,
TraversalSupportFinder support_finder 
)

◆ ~RatioSupportSnarlCaller()

vg::RatioSupportSnarlCaller::~RatioSupportSnarlCaller ( )
virtual

Member Function Documentation

◆ genotype()

pair< vector< int >, unique_ptr< SnarlCaller::CallInfo > > vg::RatioSupportSnarlCaller::genotype ( const Snarl snarl,
const vector< SnarlTraversal > &  traversals,
int  ref_trav_idx,
int  ploidy,
const string &  ref_path_name,
pair< size_t, size_t >  ref_range 
)
virtual

Get the genotype of a site.

Implements vg::SnarlCaller.

◆ get_bias()

double vg::RatioSupportSnarlCaller::get_bias ( const vector< int > &  traversal_sizes,
int  best_trav,
int  second_best_trav,
int  ref_trav_idx 
) const
protected

Get the bias used to for comparing two traversals (It differrs heuristically depending whether they are alt/ref/het/hom/snp/indel see tuning parameters below)

◆ get_ref_offsets()

unordered_map<id_t, size_t> vg::RatioSupportSnarlCaller::get_ref_offsets ( const SnarlTraversal ref_trav) const
protected

get a map of the beginning of a node (in forward orientation) on a traversal used for up-weighting large deletion edges in complex snarls with average support

◆ set_het_bias()

void vg::RatioSupportSnarlCaller::set_het_bias ( double  het_bias,
double  ref_het_bias = 0. 
)

Set some of the parameters.

◆ update_vcf_header()

void vg::RatioSupportSnarlCaller::update_vcf_header ( string &  header) const
virtual

Define any header fields needed by the above.

Implements vg::SnarlCaller.

◆ update_vcf_info()

void vg::RatioSupportSnarlCaller::update_vcf_info ( const Snarl snarl,
const vector< SnarlTraversal > &  traversals,
const vector< int > &  genotype,
const unique_ptr< CallInfo > &  call_info,
const string &  sample_name,
vcflib::Variant &  variant 
)
virtual

Update INFO and FORMAT fields of the called variant.

Reimplemented from vg::SupportBasedSnarlCaller.

Member Data Documentation

◆ max_het_bias

double vg::RatioSupportSnarlCaller::max_het_bias = 6
protected

Tuning.

What fraction of the reads supporting an alt are we willing to discount? At 2, if twice the reads support one allele as the other, we'll call homozygous instead of heterozygous. At infinity, every call will be heterozygous if even one read supports each allele.

◆ max_indel_het_bias

double vg::RatioSupportSnarlCaller::max_indel_het_bias = 6
protected

Like the max het bias, but applies to novel indels.

◆ max_ma_bias

double vg::RatioSupportSnarlCaller::max_ma_bias = 0
protected

Used for calling 1/2 calls. If both alts (times this bias) are greater than the reference, the call is made. set to 0 to deactivate.

◆ max_ref_het_bias

double vg::RatioSupportSnarlCaller::max_ref_het_bias = 6
protected

Like above, but applied to ref / alt ratio (instead of alt / ref)

◆ min_ad_log_likelihood_for_filter

double vg::RatioSupportSnarlCaller::min_ad_log_likelihood_for_filter = -9
protected

what's the min log likelihood for allele depth assignments to PASS?


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