vg
tools for working with variation graphs
Public Types | Public Member Functions | Public Attributes | List of all members
vg::Recombinator::Parameters Struct Reference

Parameters for generate_haplotypes(). More...

#include <recombinator.hpp>

Public Types

enum  scoring_model_t { standard_scoring , high_coverage_scoring , half_coverage_scoring }
 Kmer scoring model used for a chain. More...
 
enum  preset_t { preset_default , preset_haploid , preset_diploid }
 Preset parameters for common use cases. More...
 

Public Member Functions

 Parameters (preset_t preset=preset_default)
 
void print (std::ostream &out) const
 Print a description of the parameters. More...
 

Public Attributes

size_t num_haplotypes = NUM_HAPLOTYPES
 
size_t coverage = COVERAGE
 Kmer coverage. Use 0 to estimate from kmer counts. More...
 
gbwt::size_type buffer_size = gbwt::DynamicGBWT::INSERT_BATCH_SIZE
 Buffer size (in nodes) for GBWT construction. More...
 
double present_discount = PRESENT_DISCOUNT
 
double het_adjustment = HET_ADJUSTMENT
 
double absent_score = ABSENT_SCORE
 
bool haploid_scoring = false
 
bool diploid_sampling = false
 
bool extra_fragments = false
 
double badness_threshold = BADNESS_THRESHOLD
 Badness threshold for subchains when using diploid sampling. More...
 
bool include_reference = false
 Include named and reference paths. More...
 
unordered_set< std::string > banned_samples
 Samples whose haplotypes shouldn't be used, even if they score well. More...
 
scoring_model_t scoring_model = standard_scoring
 
std::unordered_set< size_t > high_coverage_chains
 Top-level chains (by offset) to sample using the high-coverage model. More...
 
size_t high_coverage_num_haplotypes = NUM_HAPLOTYPES
 Number of haplotypes to generate for high-coverage chains. More...
 
std::unordered_set< size_t > half_coverage_chains
 Top-level chains (by offset) to sample using the half-coverage model. More...
 
size_t half_coverage_num_haplotypes = 2
 Number of haplotypes to generate for half-coverage chains. More...
 
std::unordered_set< size_t > excluded_chains
 
std::unordered_set< std::string > wrap_contigs
 

Detailed Description

Parameters for generate_haplotypes().

Member Enumeration Documentation

◆ preset_t

Preset parameters for common use cases.

Enumerator
preset_default 

Default parameters.

preset_haploid 

Best practices for haploid sampling.

preset_diploid 

Best practices for diploid sampling.

◆ scoring_model_t

Kmer scoring model used for a chain.

Enumerator
standard_scoring 

Standard model: absent, heterozygous, present, and frequent bands are scored according to the diploid/haploid coverage expectation.

high_coverage_scoring 

High-coverage model. Kmers in the frequent category (count above the homozygous threshold) contribute the present score, while all other kmers contribute the absent score. This is intended for contigs such as chrM, where the true signal is in the frequent component and the haploid/diploid peaks are contamination (e.g. NuMTs or recurrent errors).

half_coverage_scoring 

Half-coverage model for heterogametic allosomes. The single true copy sits at ~cov/2, which the standard model labels heterozygous, so that band is rewarded as present. There is no real heterozygous component outside the PAR; the homozygous (~cov) band is paralog / contamination in the body and non-discriminative backbone in the PAR, so it is treated as uninformative (like the frequent band).

Constructor & Destructor Documentation

◆ Parameters()

vg::Recombinator::Parameters::Parameters ( preset_t  preset = preset_default)
explicit

Member Function Documentation

◆ print()

void vg::Recombinator::Parameters::print ( std::ostream &  out) const

Print a description of the parameters.

Member Data Documentation

◆ absent_score

double vg::Recombinator::Parameters::absent_score = ABSENT_SCORE

Score for absent kmers. This should be less than 1 if we assume that having the right variants in the graph is more important than keeping the wrong variants out.

◆ badness_threshold

double vg::Recombinator::Parameters::badness_threshold = BADNESS_THRESHOLD

Badness threshold for subchains when using diploid sampling.

◆ banned_samples

unordered_set<std::string> vg::Recombinator::Parameters::banned_samples

Samples whose haplotypes shouldn't be used, even if they score well.

◆ buffer_size

gbwt::size_type vg::Recombinator::Parameters::buffer_size = gbwt::DynamicGBWT::INSERT_BATCH_SIZE

Buffer size (in nodes) for GBWT construction.

◆ coverage

size_t vg::Recombinator::Parameters::coverage = COVERAGE

Kmer coverage. Use 0 to estimate from kmer counts.

◆ diploid_sampling

bool vg::Recombinator::Parameters::diploid_sampling = false

After selecting the initial num_haplotypes haplotypes, choose the highest-scoring pair out of them.

◆ excluded_chains

std::unordered_set<size_t> vg::Recombinator::Parameters::excluded_chains

Top-level chains (by offset) to copy through verbatim instead of personalizing. The reference/generic path and all haplotypes in the chain are preserved.

◆ extra_fragments

bool vg::Recombinator::Parameters::extra_fragments = false

When using diploid sampling, include the remaining candidates as additional fragments in bad subchains.

◆ half_coverage_chains

std::unordered_set<size_t> vg::Recombinator::Parameters::half_coverage_chains

Top-level chains (by offset) to sample using the half-coverage model.

◆ half_coverage_num_haplotypes

size_t vg::Recombinator::Parameters::half_coverage_num_haplotypes = 2

Number of haplotypes to generate for half-coverage chains.

◆ haploid_scoring

bool vg::Recombinator::Parameters::haploid_scoring = false

Use the haploid scoring model. The most common kmer count is used as the coverage estimate. Kmers that would be classified as heterozygous are treated as homozygous.

◆ het_adjustment

double vg::Recombinator::Parameters::het_adjustment = HET_ADJUSTMENT

Additive term for adjusting the scores for heterozygous kmers after each haplotype to encourage even sampling of haplotypes with and without that kmer.

◆ high_coverage_chains

std::unordered_set<size_t> vg::Recombinator::Parameters::high_coverage_chains

Top-level chains (by offset) to sample using the high-coverage model.

◆ high_coverage_num_haplotypes

size_t vg::Recombinator::Parameters::high_coverage_num_haplotypes = NUM_HAPLOTYPES

Number of haplotypes to generate for high-coverage chains.

◆ include_reference

bool vg::Recombinator::Parameters::include_reference = false

Include named and reference paths.

◆ num_haplotypes

size_t vg::Recombinator::Parameters::num_haplotypes = NUM_HAPLOTYPES

Number of haplotypes to be generated, or the number of candidates for diploid sampling.

◆ present_discount

double vg::Recombinator::Parameters::present_discount = PRESENT_DISCOUNT

Multiplicative factor for discounting the scores for present kmers after selecting a haplotype with that kmer.

◆ scoring_model

scoring_model_t vg::Recombinator::Parameters::scoring_model = standard_scoring

Scoring model for the chain currently being processed. Set per chain from high_coverage_chains / half_coverage_chains before scoring. Diploid sampling is not used with the non-standard models.

◆ wrap_contigs

std::unordered_set<std::string> vg::Recombinator::Parameters::wrap_contigs

Contig names whose origin (first) fragment of every generated haplotype should be doubled, creating a self-loop that wraps the end of the sequence back onto its start. Intended for circular contigs such as chrM. Matched against the top-level chain contig name.


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