|
vg
tools for working with variation graphs
|
#include <recombinator.hpp>
Classes | |
| struct | Statistics |
| Statistics on the generated haplotypes. More... | |
| struct | Parameters |
| Parameters for generate_haplotypes(). More... | |
| struct | LocalHaplotype |
| A local haplotype sequence within a single subchain. More... | |
Public Types | |
| enum | kmer_presence { absent , heterozygous , present , frequent } |
| Kmer classification. More... | |
| typedef Haplotypes::Verbosity | Verbosity |
| The amount of progress information that should be printed to stderr. | |
| typedef Haplotypes::sequence_type | sequence_type |
| A GBWT sequence as (sequence identifier, offset in a node). | |
Public Member Functions | |
| Recombinator (const gbwtgraph::GBZ &gbz, const Haplotypes &haplotypes, Verbosity verbosity) | |
| Creates a new Recombinator. | |
| gbwt::GBWT | generate_haplotypes (const std::string &kff_file, const Parameters ¶meters) const |
Public Attributes | |
| const gbwtgraph::GBZ & | gbz |
| const Haplotypes & | haplotypes |
| gbwt::FragmentMap | fragment_map |
| Verbosity | verbosity |
| std::vector< size_t > | jobs_for_cached_paths |
Static Public Attributes | |
| static constexpr size_t | NUM_HAPLOTYPES = 4 |
| Number of haplotypes to be generated. | |
| static constexpr size_t | NUM_CANDIDATES = 32 |
| A reasonable number of candidates for diploid sampling. | |
| static constexpr double | BADNESS_THRESHOLD = 4.0 |
| Badness threshold for subchains. | |
| static constexpr size_t | COVERAGE = 0 |
| Expected kmer coverage. Use 0 to estimate from kmer counts. | |
| static constexpr size_t | KFF_BLOCK_SIZE = 1000000 |
| Block size (in kmers) for reading KFF files. | |
| static constexpr double | PRESENT_DISCOUNT = 0.9 |
| static constexpr double | HET_ADJUSTMENT = 0.05 |
| static constexpr double | ABSENT_SCORE = 0.8 |
| static constexpr size_t | MIN_GREF_LENGTH = 50 |
Private Member Functions | |
| Statistics | generate_haplotypes (const Haplotypes::TopLevelChain &chain, const hash_map< Haplotypes::Subchain::kmer_type, size_t > &kmer_counts, gbwt::GBWTBuilder &builder, gbwtgraph::MetadataBuilder &metadata, const Parameters ¶meters, double coverage) const |
| Statistics | copy_chain (const Haplotypes::TopLevelChain &chain, gbwt::GBWTBuilder &builder, gbwtgraph::MetadataBuilder &metadata) const |
A class that creates synthetic haplotypes from a Haplotypes representation of local haplotypes.
A GBWT sequence as (sequence identifier, offset in a node).
The amount of progress information that should be printed to stderr.
| vg::Recombinator::Recombinator | ( | const gbwtgraph::GBZ & | gbz, |
| const Haplotypes & | haplotypes, | ||
| Verbosity | verbosity ) |
Creates a new Recombinator.
|
private |
|
private |
| gbwt::GBWT vg::Recombinator::generate_haplotypes | ( | const std::string & | kff_file, |
| const Parameters & | parameters ) const |
Generates haplotypes based on the kmer counts in the given KFF file.
Runs multiple GBWT construction jobs in parallel using OpenMP threads and generates the specified number of haplotypes in each top-level chain (component).
Each generated haplotype has a single source haplotype in each subchain. The source haplotype may consist of multiple fragments. Subchains are by unary paths. Suffix / prefix subchains in the middle of a chain create fragment breaks in every haplotype. If the chain starts without a prefix (ends without a suffix), the haplotype chosen for the first (last) subchain is used from the start (continued until the end).
Throws std::runtime_error on error in single-threaded parts and exits with std::exit(EXIT_FAILURE) in multi-threaded parts.
|
staticconstexpr |
Score for getting an absent kmer right/wrong. This should be less than 1, if we assume that having the right variants in the graph is more important than keeping wrong variants out.
|
staticconstexpr |
Badness threshold for subchains.
|
staticconstexpr |
Expected kmer coverage. Use 0 to estimate from kmer counts.
| gbwt::FragmentMap vg::Recombinator::fragment_map |
| const gbwtgraph::GBZ& vg::Recombinator::gbz |
| const Haplotypes& vg::Recombinator::haplotypes |
|
staticconstexpr |
Adjustment to the score of a heterozygous kmer every time a haplotype with (-) or without (+) that kmer is selected.
| std::vector<size_t> vg::Recombinator::jobs_for_cached_paths |
|
staticconstexpr |
Block size (in kmers) for reading KFF files.
|
staticconstexpr |
Minimum length (in bp) for a piece of a gref fragment to survive in the sampled graph. The same floor as vg paths --min-gref-len.
|
staticconstexpr |
A reasonable number of candidates for diploid sampling.
|
staticconstexpr |
Number of haplotypes to be generated.
|
staticconstexpr |
Multiplier to the score of a present kmer every time a haplotype with that kmer is selected.
| Verbosity vg::Recombinator::verbosity |
1.17.0