vg
tools for working with variation graphs
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static 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 : size_t {
  preset_default , preset_haploid , preset_diploid , preset_hifi ,
  preset_ont
}
 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...
 

Static Public Member Functions

static std::string preset_list (std::string_view separator)
 Returns the set of available presets as a string. More...
 
static std::optional< preset_t > parse_preset (std::string_view name)
 Parses a preset from its name. 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
 
size_t ignore_homopolymers = std::numeric_limits<size_t>::max()
 Ignore kmers containing homopolymers of at least this length. More...
 
bool haploid_scoring = false
 
bool diploid_sampling = false
 
bool include_reference = false
 
bool extra_fragments = false
 
double badness_threshold = BADNESS_THRESHOLD
 Badness threshold for subchains when using diploid sampling. More...
 
size_t min_gref_length = MIN_GREF_LENGTH
 Minimum length (in bp) for a piece of a gref fragment to be kept. More...
 
std::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
 

Static Public Attributes

static const std::vector< std::pair< preset_t, std::string > > PRESETS
 A list of presets and their names. More...
 

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.

preset_hifi 

Best practices for diploid sampling with HiFi reads.

preset_ont 

Best practices for diploid sampling with ONT reads.

◆ 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

◆ parse_preset()

std::optional< Recombinator::Parameters::preset_t > vg::Recombinator::Parameters::parse_preset ( std::string_view  name)
static

Parses a preset from its name.

◆ preset_list()

std::string vg::Recombinator::Parameters::preset_list ( std::string_view  separator)
static

Returns the set of available presets as a string.

◆ 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

std::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.

◆ ignore_homopolymers

size_t vg::Recombinator::Parameters::ignore_homopolymers = std::numeric_limits<size_t>::max()

Ignore kmers containing homopolymers of at least this length.

◆ include_reference

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

Include named and reference paths. Gref fragments are clipped to the sampled graph, as copying them would keep the whole gref cover.

◆ min_gref_length

size_t vg::Recombinator::Parameters::min_gref_length = MIN_GREF_LENGTH

Minimum length (in bp) for a piece of a gref fragment to be kept.

◆ 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.

◆ PRESETS

const std::vector< std::pair< Recombinator::Parameters::preset_t, std::string > > vg::Recombinator::Parameters::PRESETS
static
Initial value:
= {
}
@ preset_haploid
Best practices for haploid sampling.
Definition: recombinator.hpp:406
@ preset_diploid
Best practices for diploid sampling.
Definition: recombinator.hpp:408
@ preset_hifi
Best practices for diploid sampling with HiFi reads.
Definition: recombinator.hpp:410
@ preset_default
Default parameters.
Definition: recombinator.hpp:404
@ preset_ont
Best practices for diploid sampling with ONT reads.
Definition: recombinator.hpp:412

A list of presets and their names.

◆ 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: