|
vg
tools for working with variation graphs
|
#include <flow_caller.hpp>
Public Member Functions | |
| FlowCaller (const PathPositionHandleGraph &graph, SupportBasedSnarlCaller &snarl_caller, SnarlManager &snarl_manager, const string &sample_name, TraversalFinder &traversal_finder, const vector< string > &ref_paths, const vector< size_t > &ref_path_offsets, const vector< int > &ref_path_ploidies, AlignmentEmitter *aln_emitter, bool traversals_only, bool gaf_output, size_t trav_padding, bool genotype_snarls, const pair< size_t, size_t > &allele_length_range) | |
| Original constructor for non-nested mode. More... | |
| FlowCaller (const PathPositionHandleGraph &graph, SupportBasedSnarlCaller &snarl_caller, SnarlManager &snarl_manager, const string &sample_name, TraversalFinder &traversal_finder, const vector< string > &ref_paths, const vector< size_t > &ref_path_offsets, const vector< int > &ref_path_ploidies, AlignmentEmitter *aln_emitter, bool traversals_only, bool gaf_output, size_t trav_padding, bool genotype_snarls, const pair< size_t, size_t > &allele_length_range, bool nested, bool star_allele) | |
| Extended constructor for nested mode with star alleles. More... | |
| virtual | ~FlowCaller () |
| bool | call_snarl (const Snarl &snarl) override |
| Call a given snarl, and print the output to out_stream. More... | |
| void | set_max_snarl_edges (size_t edges) |
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... | |
| SiteEmitter | site_emitter |
Writes the record of each called site into vcf_writer. More... | |
Protected Member Functions | |
| bool | call_snarl_internal (const Snarl &snarl, const string &parent_ref_path_name, pair< size_t, size_t > parent_ref_interval, const vector< TraversalSet > *parent_child_trav_sets=nullptr) |
| vector< int > | genotype_from_parent_sets (CandidateFinder::Site &site, const vector< TraversalSet > &parent_sets, unique_ptr< SnarlCaller::CallInfo > &call_info) |
| bool | emit_site (const CandidateFinder::Site &site, const vector< int > &genotype, const unique_ptr< SnarlCaller::CallInfo > &call_info, int ploidy) |
| void | call_children (const CandidateFinder::Site &site, const vector< int > &genotype) |
| vector< TraversalSet > | child_traversal_sets (const CandidateFinder::Site &site, const vector< int > &genotype, const Snarl &child) const |
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 PathPositionHandleGraph & | graph |
| the graph More... | |
| TraversalFinder & | traversal_finder |
| the traversal finder More... | |
| vector< string > | ref_paths |
| keep track of the reference paths More... | |
| unordered_set< string > | ref_path_set |
| map< string, size_t > | ref_offsets |
| keep track of offsets in the reference paths More... | |
| map< string, int > | ref_ploidies |
| keep traco of the ploidies (todo: just one map for all path stuff!!) More... | |
| AlignmentEmitter * | alignment_emitter |
| bool | traversals_only |
| toggle whether to genotype or just output the traversals More... | |
| bool | gaf_output |
| toggle whether to output vcf or gaf More... | |
| bool | genotype_snarls |
| pair< size_t, size_t > | allele_length_range |
| bool | nested = false |
| — Nested mode members — More... | |
| bool | star_allele = false |
| use * alleles for spanning haplotypes that don't traverse nested sites More... | |
| CandidateFinder | candidates |
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 |
FlowCaller : Uses any traversals finder (ex, FlowTraversalFinder) to find traversals, and calls those based on how much support they have. Should work on any graph but will not report cyclic traversals. Supports nested calling when enabled with the nested flag, recursively processing child snarls. Designed to replace LegacyCaller, as it should miss fewer obviously good traversals, and is not dependent on old protobuf-based structures.
| vg::FlowCaller::FlowCaller | ( | const PathPositionHandleGraph & | graph, |
| SupportBasedSnarlCaller & | snarl_caller, | ||
| SnarlManager & | snarl_manager, | ||
| const string & | sample_name, | ||
| TraversalFinder & | traversal_finder, | ||
| const vector< string > & | ref_paths, | ||
| const vector< size_t > & | ref_path_offsets, | ||
| const vector< int > & | ref_path_ploidies, | ||
| AlignmentEmitter * | aln_emitter, | ||
| bool | traversals_only, | ||
| bool | gaf_output, | ||
| size_t | trav_padding, | ||
| bool | genotype_snarls, | ||
| const pair< size_t, size_t > & | allele_length_range | ||
| ) |
Original constructor for non-nested mode.
| vg::FlowCaller::FlowCaller | ( | const PathPositionHandleGraph & | graph, |
| SupportBasedSnarlCaller & | snarl_caller, | ||
| SnarlManager & | snarl_manager, | ||
| const string & | sample_name, | ||
| TraversalFinder & | traversal_finder, | ||
| const vector< string > & | ref_paths, | ||
| const vector< size_t > & | ref_path_offsets, | ||
| const vector< int > & | ref_path_ploidies, | ||
| AlignmentEmitter * | aln_emitter, | ||
| bool | traversals_only, | ||
| bool | gaf_output, | ||
| size_t | trav_padding, | ||
| bool | genotype_snarls, | ||
| const pair< size_t, size_t > & | allele_length_range, | ||
| bool | nested, | ||
| bool | star_allele | ||
| ) |
Extended constructor for nested mode with star alleles.
|
virtual |
|
protected |
Call each child of a genotyped site that an allele of the genotype visits, from the traversals of the alleles.
|
overridevirtual |
Call a given snarl, and print the output to out_stream.
Implements vg::GraphCaller.
|
protected |
Internal implementation of call_snarl that accepts parent context for nested mode When nested=true, this recursively calls children after processing the current snarl
| parent_ref_path_name | Reference path from parent (for off-reference snarls) |
| parent_ref_interval | Reference interval from parent |
| parent_child_trav_sets | If non-null, contains one TraversalSet per parent allele. Each set contains all traversals through this child that are consistent with that parent allele. The child genotypes by picking the best pair (one from each set) based on read support. |
|
protected |
Return, for each strand of the genotype of a site, the traversals of child that agree with the traversal of its allele. A star or missing allele gets an empty set.
|
protected |
Write the record of a genotyped site, as VCF or as GAF.
|
protected |
Genotype a nested site from the traversal sets that its parent's genotype gives it.
We add the traversals of the sets to the candidates of the site, and genotype the strands whose set is not empty. The other strands get a star allele, or a missing one without star_allele.
| parent_sets | One traversal set per strand of the parent's genotype. |
| call_info | Set to the snarl caller's information about the call, if it was asked for one. |
| void vg::FlowCaller::set_max_snarl_edges | ( | size_t | edges | ) |
Skip snarls with more edges than this, counting those of nested snarls.
call_top_level_snarls then calls the children of a skipped snarl as if they were top-level snarls. Zero, the default, removes the limit.
|
protected |
alignment emitter. if not null, traversals will be output here and no genotyping will be done
|
protected |
clamp calling to alleles of a given length range more specifically, a snarl is only called if 1) its largest allele is >= allele_length_range.first and 2) all alleles are < allele_length_range.second
|
protected |
Finds the reference path and candidate traversals of each site. It is declared after the members it reads, so that they are built first.
|
protected |
toggle whether to output vcf or gaf
|
protected |
toggle whether to genotype every snarl (by default, uncalled snarls are skipped, and coordinates are flattened out to minimize variant size – this turns all that off)
|
protected |
the graph
|
protected |
— Nested mode members —
enable recursive calling of child snarls
|
protected |
keep track of offsets in the reference paths
|
protected |
|
protected |
keep track of the reference paths
|
protected |
keep traco of the ploidies (todo: just one map for all path stuff!!)
| SiteEmitter vg::FlowCaller::site_emitter |
Writes the record of each called site into vcf_writer.
|
protected |
use * alleles for spanning haplotypes that don't traverse nested sites
|
protected |
the traversal finder
|
protected |
toggle whether to genotype or just output the traversals
| SortedVCFWriter vg::FlowCaller::vcf_writer |
The sorted VCF the records go to.
1.9.1