|
vg
tools for working with variation graphs
|
#include <surjector.hpp>
Public Types | |
| using | path_chunk_t = pair< pair< string::const_iterator, string::const_iterator >, path_t > |
Public Member Functions | |
| Surjector (const PathPositionHandleGraph *graph) | |
| virtual void | set_alignment_scores (const int8_t *score_matrix, int8_t gap_open, int8_t gap_extend, int8_t full_length_bonus) |
| vector< Alignment > | surject (const Alignment &source, const unordered_set< path_handle_t > &paths, vector< tuple< string, int64_t, bool >> &positions_out, bool allow_negative_scores=false, bool preserve_deletions=false) const |
| vector< Alignment > | surject (const Alignment &source, const unordered_set< path_handle_t > &paths, bool allow_negative_scores=false, bool preserve_deletions=false) const |
| vector< multipath_alignment_t > | surject (const multipath_alignment_t &source, const unordered_set< path_handle_t > &paths, vector< tuple< string, int64_t, bool >> &positions_out, bool allow_negative_scores=false, bool preserve_deletions=false) const |
| template<class AlnType > | |
| void | surject_in_place (vector< AlnType > &alns, const unordered_set< path_handle_t > &paths, bool allow_negative_scores=false, bool preserve_deletions=false) const |
| template<class AlnType > | |
| void | surject_in_place (vector< AlnType > &alns, vector< tuple< string, int64_t, bool >> &positions_out, const unordered_set< path_handle_t > &paths, bool allow_negative_scores=false, bool preserve_deletions=false) const |
| template<class AlnType > | |
| void | surject_paired_in_place (vector< AlnType > &alns1, vector< AlnType > &alns2, vector< AlnType > &supplementary_alns1_out, vector< AlnType > &supplementary_alns2_out, const unordered_set< path_handle_t > &paths, bool allow_negative_scores=false, bool preserve_deletions=false) const |
| template<class AlnType > | |
| void | surject_paired_in_place (vector< AlnType > &alns1, vector< AlnType > &alns2, vector< tuple< string, int64_t, bool >> &positions1_out, vector< tuple< string, int64_t, bool >> &positions2_out, vector< AlnType > &supplementary_alns1_out, vector< AlnType > &supplementary_alns2_out, vector< tuple< string, int64_t, bool >> &supplementary_positions1_out, vector< tuple< string, int64_t, bool >> &supplementary_positions2_out, const unordered_set< path_handle_t > &paths, bool allow_negative_scores=false, bool preserve_deletions=false) const |
| void | set_refpos (vector< Alignment > &alns, const vector< tuple< string, int64_t, bool >> &positions) const |
| template<> | |
| int32_t | get_score (const Alignment &aln) |
| template<> | |
| int32_t | get_score (const multipath_alignment_t &mp_aln) |
| template<> | |
| size_t | count_mismatches (const Alignment &aln) |
| template<> | |
| size_t | count_mismatches (const multipath_alignment_t &mp_aln) |
| template<> | |
| vector< pair< int, char > > | get_cigar (const Alignment &surjected, const tuple< string, int64_t, bool > &position, const PathPositionHandleGraph &graph, bool spliced) const |
| template<> | |
| vector< pair< int, char > > | get_cigar (const multipath_alignment_t &surjected, const tuple< string, int64_t, bool > &position, const PathPositionHandleGraph &graph, bool spliced) const |
| template<> | |
| void | set_is_secondary (Alignment &aln, bool value) |
| template<> | |
| void | set_is_secondary (multipath_alignment_t &aln, bool value) |
| template<> | |
| bool | get_is_secondary (const Alignment &aln) |
| template<> | |
| bool | get_is_secondary (const multipath_alignment_t &aln) |
Public Member Functions inherited from vg::AlignerClient | |
| virtual void | set_alignment_scores (int8_t match, int8_t mismatch, int8_t gap_open, int8_t gap_extend, int8_t full_length_bonus) |
| Set all the aligner scoring parameters and create the stored aligner instances. More... | |
| virtual void | set_alignment_scores (std::istream &matrix_stream, int8_t gap_open, int8_t gap_extend, int8_t full_length_bonus) |
Public Attributes | |
| std::unique_ptr< Aligner > | dp_aligner |
| int8_t | dp_score_scale = 10 |
| int8_t | dp_gap_open_extra_cost = 0 |
| int64_t | min_splice_length = 20 |
| int64_t | dominated_path_chunk_diff = 10 |
| int64_t | min_splice_repair_length = 250 |
| the minimum length apparent intron that we will try to repair More... | |
| size_t | max_tail_length = 10000 |
| the maximum length of a tail that we will try to align More... | |
| uint64_t | max_band_cells = 8000000000 |
| double | max_subgraph_bases_per_read_base = DEFAULT_SUBGRAPH_LIMIT |
| How big of a graph (in graph bases per read base) should we ever try to align against for realigning surjection? More... | |
| int64_t | min_absolute_align_size_to_refuse = 1024 |
| Don't refuse to align (graph size) * (read size) is at least this size (overrides max_subgraph_bases_per_read_base) More... | |
| int64_t | min_fold_coverage_for_downsample = 8 |
| in spliced surject, downsample if the base-wise average coverage by chunks is this high More... | |
| int64_t | downsample_coverage = 16 |
| while downsampling, try to get down to this coverage on each base More... | |
| int64_t | min_shift_for_prune = 32 * 1024 |
| int64_t | shift_prune_diff = 16 * 1024 |
| atomic_flag | warned_about_subgraph_size = ATOMIC_FLAG_INIT |
| And have we complained about hitting it? More... | |
| bool | prune_suspicious_anchors = false |
| int64_t | max_tail_anchor_prune = 4 |
| int64_t | max_slide = DEFAULT_MAX_SLIDE |
| double | low_complexity_p_value = .0075 |
| int64_t | max_low_complexity_anchor_prune = 40 |
| int64_t | max_low_complexity_anchor_trim = 65 |
| int64_t | pad_suspicious_anchors_to_length = 12 |
| bool | multimap_to_all_paths = false |
| Return alignments to overlapping paths as secondaries instead of just the best one. More... | |
| std::function< size_t(const Alignment &, const HandleGraph &)> | choose_band_padding |
| bool | left_align = false |
| Attempt to left-align indels relative to the forward strand of the surjection path. More... | |
| size_t | max_anchors = std::numeric_limits<size_t>::max() |
| bool | report_supplementary = true |
| Should we report supplementary alignments? More... | |
| double | read_length_prop_disjoint_gap = 1.0 |
| What fraction of a read length separation should we expect before separating into supplementaries? More... | |
| size_t | max_disjoint_gap = 10000 |
| The maximum gap size before we always separate into supplementary alignments. More... | |
| size_t | min_disjoint_gap = 50 |
| The minimum gap size we should never separate into supplementary alignments. More... | |
| int64_t | disjoint_interval_allowable_overlap = 4 |
| The max size overlap on the read between supplementaries before we designate them as non-colinear. More... | |
| bool | annotate_with_all_path_scores = false |
| bool | annotate_with_graph_alignment = false |
| bool | annotate_off_reference_pos = false |
| Annotate reads whose alignments are lost during surjection with the nearest reference position. More... | |
| size_t | off_reference_pos_search_limit = 20000 |
| How far we will traverse the graph in search of a reference position? More... | |
Public Attributes inherited from vg::AlignerClient | |
| bool | adjust_alignments_for_base_quality = false |
Static Public Attributes | |
| static constexpr double | SPLICED_DEFAULT_SUBGRAPH_LIMIT = 16 * 1024 * 1024 / 125.0 |
| We have a different default max_subgraph_bases_per_read_base to use for spliced alignment. More... | |
| static constexpr double | DEFAULT_SUBGRAPH_LIMIT = 100 * 1024 / 125.0 |
| And an accessible default max_subgraph_bases_per_read_base for normal alignment. More... | |
| static constexpr int64_t | DEFAULT_MAX_SLIDE = 6 |
Protected Member Functions | |
| void | set_dp_alignment_scores (const int8_t *score_matrix, int8_t gap_open, int8_t gap_extend, int8_t full_length_bonus) |
| Do the extra score setup for the DP-only Aligner. More... | |
| void | surject_internal (const Alignment *source_aln, const multipath_alignment_t *source_mp_aln, vector< Alignment > *alns_out, vector< multipath_alignment_t > *mp_alns_out, const unordered_set< path_handle_t > &paths, vector< tuple< string, int64_t, bool >> &positions_out, bool allow_negative_scores, bool preserve_deletions) const |
| vector< pair< Alignment, pair< step_handle_t, step_handle_t > > > | realigning_surject (const PathPositionHandleGraph *graph, const Alignment &source, const path_handle_t &path_handle, bool rev_strand, const vector< path_chunk_t > &path_chunks, const vector< pair< step_handle_t, step_handle_t >> &ref_chunks, bool allow_negative_scores, bool preserve_N_alignments=false, bool sinks_are_anchors=false, bool sources_are_anchors=false, vector< vector< pair< step_handle_t, step_handle_t >>> *all_path_ranges_out=nullptr, size_t override_read_length=0) const |
| vector< pair< multipath_alignment_t, pair< step_handle_t, step_handle_t > > > | spliced_surject (const PathPositionHandleGraph *path_position_graph, const string &src_sequence, const string &src_quality, const int32_t src_mapping_quality, const path_handle_t &path_handle, bool rev_strand, vector< path_chunk_t > &path_chunks, vector< pair< step_handle_t, step_handle_t >> &ref_chunks, vector< tuple< size_t, size_t, int32_t >> &connections, bool allow_negative_scores, bool deletions_as_splices) const |
| unordered_map< pair< path_handle_t, bool >, pair< vector< path_chunk_t >, vector< pair< step_handle_t, step_handle_t > > > > | extract_overlapping_paths (const PathPositionHandleGraph *graph, const Alignment &source, const unordered_set< path_handle_t > &surjection_paths) const |
| get the chunks of the alignment path that follow the given reference paths More... | |
| unordered_map< pair< path_handle_t, bool >, pair< vector< path_chunk_t >, vector< pair< step_handle_t, step_handle_t > > > > | extract_overlapping_paths (const PathPositionHandleGraph *graph, const multipath_alignment_t &source, const unordered_set< path_handle_t > &surjection_paths, unordered_map< pair< path_handle_t, bool >, vector< tuple< size_t, size_t, int32_t >>> &connections_out) const |
| same semantics except for a multipath alignment More... | |
| void | filter_redundant_path_chunks (bool path_rev, vector< path_chunk_t > &path_chunks, vector< pair< step_handle_t, step_handle_t >> &ref_chunks, vector< tuple< size_t, size_t, int32_t >> &connections) const |
| void | prune_and_trim_anchors (const string &sequence, vector< path_chunk_t > &path_chunks, vector< pair< step_handle_t, step_handle_t >> &step_ranges) const |
| pair< size_t, size_t > | compute_path_interval (const PathPositionHandleGraph *graph, const Alignment &source, path_handle_t path_handle, bool rev_strand, const vector< path_chunk_t > &path_chunks, const vector< pair< step_handle_t, step_handle_t >> &ref_chunks, bool no_left_expansion, bool no_right_expansion) const |
| vector< tuple< size_t, size_t, vector< size_t > > > | compute_disjoint_path_intervals (const PathPositionHandleGraph *graph, const Alignment &source, path_handle_t path_handle, bool rev_strand, const vector< path_chunk_t > &path_chunks, const vector< pair< step_handle_t, step_handle_t >> &ref_chunks, bool no_left_expansion, bool no_right_expansion, size_t max_gap) const |
| void | set_path_position (const PathPositionHandleGraph *graph, const pos_t &init_surj_pos, const pos_t &final_surj_pos, const step_handle_t &range_begin, const step_handle_t &range_end, bool rev_strand, string &path_name_out, int64_t &path_pos_out, bool &path_rev_out) const |
| use the graph position bounds and the path range bounds to assign a path position to a surjected read More... | |
| tuple< string, int64_t, bool, size_t, bool > | nearest_ref_pos (const Alignment &source, const PathPositionHandleGraph *graph, const unordered_set< path_handle_t > &paths) const |
| tuple< string, int64_t, bool, size_t, bool > | nearest_ref_pos (const multipath_alignment_t &source, const PathPositionHandleGraph *graph, const unordered_set< path_handle_t > &paths) const |
| template<class AlnType > | |
| string | path_score_annotations (const unordered_map< pair< path_handle_t, bool >, vector< pair< AlnType, pair< step_handle_t, step_handle_t >>>> &surjections) const |
| template<class AlnType > | |
| void | choose_primary_internal (vector< pair< AlnType, pair< step_handle_t, step_handle_t >>> &surjections, const function< void(AlnType &)> &annotate_supplementary) const |
| void | choose_primary (vector< pair< Alignment, pair< step_handle_t, step_handle_t >>> &surjections) const |
| void | choose_primary (vector< pair< multipath_alignment_t, pair< step_handle_t, step_handle_t >>> &surjections) const |
| vector< tuple< Alignment, size_t, size_t > > | generate_hard_clipped_alignments (const Alignment &source) const |
| void | restore_hard_clips (vector< Alignment > &clipped_surjected, const Alignment &source, size_t subseq_begin, size_t subseq_end) const |
| template<class AlnType > | |
| void | add_SA_tag_internal (vector< AlnType > &surjected, const vector< tuple< string, int64_t, bool >> &positions, const PathPositionHandleGraph &graph, bool spliced, const function< void(AlnType &, const string &)> &update_sa) const |
| void | add_SA_tag (vector< Alignment > &surjected, const vector< tuple< string, int64_t, bool >> &positions, const PathPositionHandleGraph &graph, bool spliced) const |
| void | add_SA_tag (vector< multipath_alignment_t > &surjected, const vector< tuple< string, int64_t, bool >> &positions, const PathPositionHandleGraph &graph, bool spliced) const |
| template<class AlnType > | |
| int64_t | total_overlap (const vector< pair< AlnType, pair< step_handle_t, step_handle_t >>> &surjections) const |
| template<class AlnType > | |
| vector< pair< path_handle_t, bool > > | supplementary_cover (const unordered_map< pair< path_handle_t, bool >, vector< pair< AlnType, pair< step_handle_t, step_handle_t >>>> &surjections) const |
| template<class AlnType > | |
| pair< path_handle_t, bool > | choose_primary_strand (const unordered_map< pair< path_handle_t, bool >, vector< pair< AlnType, pair< step_handle_t, step_handle_t >>>> &surjections, const unordered_set< pair< path_handle_t, bool >> *among_strands=nullptr) const |
| vector< vector< size_t > > | reverse_adjacencies (const vector< vector< size_t >> &adj) const |
| reverses an adjacency list More... | |
| vector< size_t > | connected_components (const vector< vector< size_t >> &adj, const vector< vector< size_t >> &rev_adj, size_t *num_comps_out) const |
| vector< vector< size_t > > | transitive_reduction (const vector< vector< size_t >> &adj) const |
| returns the transitive reduction of a topologically sorted DAG's adjacency list More... | |
| vector< vector< size_t > > | remove_dominated_chunks (const string &src_sequence, const vector< vector< size_t >> &adj, vector< path_chunk_t > &path_chunks, vector< pair< step_handle_t, step_handle_t >> &ref_chunks, vector< tuple< size_t, size_t, int32_t >> &connections) const |
| eliminate any path chunks that have the exact same colinearities as another but are much shorter More... | |
| void | cut_anchors (bool rev_strand, vector< path_chunk_t > &path_chunks, vector< pair< step_handle_t, step_handle_t >> &ref_chunks, vector< tuple< size_t, size_t, int32_t >> &connections) const |
| if any anchors overlap each other, cut the second at the implied overlap position More... | |
| void | downsample_chunks (const string &src_sequence, vector< path_chunk_t > &path_chunks, vector< pair< step_handle_t, step_handle_t >> &ref_chunks, vector< tuple< size_t, size_t, int32_t >> &connections) const |
| if there are too many chunks, downsample to a given level More... | |
| vector< pair< vector< size_t >, vector< size_t > > > | find_constriction_bicliques (const vector< vector< size_t >> &adj, const string &src_sequence, const string &src_quality, vector< path_chunk_t > &path_chunks, vector< pair< step_handle_t, step_handle_t >> &ref_chunks, const vector< tuple< size_t, size_t, int32_t >> &connections) const |
| void | prune_unconnectable (vector< vector< size_t >> &adj, vector< vector< tuple< size_t, int32_t, bool >>> &splice_adj, vector< size_t > &component, vector< vector< size_t >> &comp_groups, vector< path_chunk_t > &path_chunks, vector< pair< step_handle_t, step_handle_t >> &ref_chunks) const |
| pair< string, size_t > | nearest_ref_pos (const Alignment &source, const PathPositionHandleGraph *graph) const |
| void | annotate_graph_cigar (vector< Alignment > &surjections, const Alignment &source, const vector< tuple< string, int64_t, bool >> &positions) const |
| void | annotate_graph_cigar (vector< multipath_alignment_t > &surjections, const multipath_alignment_t &source, const vector< tuple< string, int64_t, bool >> &positions) const |
| template<class AlnType > | |
| vector< pair< int, char > > | get_cigar (const AlnType &surjected, const tuple< string, int64_t, bool > &position, const PathPositionHandleGraph &graph, bool spliced) const |
Protected Member Functions inherited from vg::AlignerClient | |
| AlignerClient (double gc_content_estimate=vg::default_gc_content) | |
| const GSSWAligner * | get_aligner (bool have_qualities=true) const |
| const QualAdjAligner * | get_qual_adj_aligner () const |
| const Aligner * | get_regular_aligner () const |
Static Protected Member Functions | |
| static string | update_tag_string_for_SA (const string &tags, const string &sa_val) |
| static Alignment | make_null_alignment (const Alignment &source) |
| make a sentinel meant to indicate an unmapped read More... | |
| static multipath_alignment_t | make_null_mp_alignment (const string &src_sequence, const string &src_quality) |
| template<class AlnType > | |
| static int32_t | get_score (const AlnType &aln) |
| template<class AlnType > | |
| static size_t | count_mismatches (const AlnType &surjected) |
| template<class AlnType > | |
| static void | set_is_secondary (AlnType &aln, bool value) |
| template<class AlnType > | |
| static bool | get_is_secondary (const AlnType &aln) |
Protected Attributes | |
| const PathPositionHandleGraph * | graph = nullptr |
| the graph we're surjecting onto More... | |
Protected Attributes inherited from vg::AlignerClient | |
| double | gc_content_estimate |
Additional Inherited Members | |
Static Public Member Functions inherited from vg::AlignerClient | |
| static int8_t * | parse_matrix (std::istream &matrix_stream) |
| Allocates an array to hold a 4x4 substitution matrix and returns it. More... | |
Widget to surject alignments down to linear paths in the graph.
Assumes the alignments actually go with the graph; the caller is repsonsible for ensuring that e.g. all nodes referenced by the alignments actually exist.
| using vg::Surjector::path_chunk_t = pair<pair<string::const_iterator, string::const_iterator>, path_t> |
a local type that represents a read interval matched to a portion of the alignment path
| vg::Surjector::Surjector | ( | const PathPositionHandleGraph * | graph | ) |
|
inlineprotected |
|
inlineprotected |
|
protected |
|
protected |
|
protected |
|
inlineprotected |
|
inlineprotected |
|
protected |
|
protected |
|
protected |
Compute a set of end-inclusive intervals of path positions that the realign sequence could align to, and associate with each one a vector indexes into path_chunks to indicate which path chunks it contains.
|
protected |
Compute the widest end-inclusive interval of path positions that the realigned sequence could align to, or an interval where start > end if there are no path chunks.
|
protected |
returns a vector assignming each node to a connectd component, requires both the forward and reverse adjacency lists. optionally also returns the total number of components
| size_t vg::Surjector::count_mismatches | ( | const Alignment & | aln | ) |
|
staticprotected |
| size_t vg::Surjector::count_mismatches | ( | const multipath_alignment_t & | mp_aln | ) |
|
protected |
if any anchors overlap each other, cut the second at the implied overlap position
|
protected |
if there are too many chunks, downsample to a given level
|
protected |
get the chunks of the alignment path that follow the given reference paths
|
protected |
same semantics except for a multipath alignment
|
protected |
remove any path chunks and corresponding ref chunks that are identical to a longer path chunk over the region where they overlap
|
protected |
returns all sets of chunks such that 1) all of chunks on the left set abut all of the chunks on the right set on the read, 2) all source-to-sink paths in the connected component go through an edge between the left and right sides, 3) all of the chunks that do not have a connection between them are fully connected (i.e. form a biclique)
|
protected |
| vector<pair<int, char> > vg::Surjector::get_cigar | ( | const Alignment & | surjected, |
| const tuple< string, int64_t, bool > & | position, | ||
| const PathPositionHandleGraph & | graph, | ||
| bool | spliced | ||
| ) | const |
|
protected |
| vector<pair<int, char> > vg::Surjector::get_cigar | ( | const multipath_alignment_t & | surjected, |
| const tuple< string, int64_t, bool > & | position, | ||
| const PathPositionHandleGraph & | graph, | ||
| bool | spliced | ||
| ) | const |
| bool vg::Surjector::get_is_secondary | ( | const Alignment & | aln | ) |
|
staticprotected |
Check whether a read alignment is primary or secondary.
| bool vg::Surjector::get_is_secondary | ( | const multipath_alignment_t & | aln | ) |
| int32_t vg::Surjector::get_score | ( | const Alignment & | aln | ) |
|
staticprotected |
| int32_t vg::Surjector::get_score | ( | const multipath_alignment_t & | mp_aln | ) |
make a sentinel meant to indicate an unmapped read
|
staticprotected |
|
protected |
|
protected |
get the nearest reference position for a mapped read that does not overlap a reference path
the final two fields in return value indicate 1) the distance traversed to reach the NR position from the end of the alignment that would be further in the direction of low coordinates of the oriented path, and 2) true if the traversal direction was in the direction of low coordinates, else false
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
eliminate any path chunks that have the exact same colinearities as another but are much shorter
|
protected |
|
protected |
reverses an adjacency list
|
virtual |
Override alignment score setting to let DP use slightly adjusted scores. The provided scores will be adjusted to increase gap open cost slightly when doing DP, but output scores will be scored with the provided parameters.
Reimplemented from vg::AlignerClient.
|
protected |
Do the extra score setup for the DP-only Aligner.
| void vg::Surjector::set_is_secondary | ( | Alignment & | aln, |
| bool | value | ||
| ) |
|
staticprotected |
Mark a read alignment as primary or secondary.
| void vg::Surjector::set_is_secondary | ( | multipath_alignment_t & | aln, |
| bool | value | ||
| ) |
|
protected |
use the graph position bounds and the path range bounds to assign a path position to a surjected read
| void vg::Surjector::set_refpos | ( | vector< Alignment > & | alns, |
| const vector< tuple< string, int64_t, bool >> & | positions | ||
| ) | const |
Populate refpos on Alignments from a separate collection of positions.
|
protected |
|
protected |
| vector< Alignment > vg::Surjector::surject | ( | const Alignment & | source, |
| const unordered_set< path_handle_t > & | paths, | ||
| bool | allow_negative_scores = false, |
||
| bool | preserve_deletions = false |
||
| ) | const |
Extract the portions of an alignment that are on a chosen set of paths and try to align realign the portions that are off of the chosen paths to the intervening path segments to obtain an alignment that is fully restricted to the paths.
Replaces the alignment's refpos with the path name, position, and strand the alignment has been surjected to.
Optionally either allow softclips so that the alignment has a nonnegative score on the path or require the full-length alignment, possibly creating a negative score.
Also optionally leaves deletions against the reference path in the final alignment (useful for splicing).
| vector< Alignment > vg::Surjector::surject | ( | const Alignment & | source, |
| const unordered_set< path_handle_t > & | paths, | ||
| vector< tuple< string, int64_t, bool >> & | positions_out, | ||
| bool | allow_negative_scores = false, |
||
| bool | preserve_deletions = false |
||
| ) | const |
Extract the portions of an alignment that are on a chosen set of paths and try to align realign the portions thaet are off of the chosen paths to the intervening path segments to obtain an alignment that is fully restricted to the paths.
Does not populate the alignment's refpos.
Also returns the path name, position, and strand of the new alignment.
Optionally either allow softclips so that the alignment has a nonnegative score on the path or require the full-length alignment, possibly creating a negative score.
Also optionally leaves deletions against the reference path in the final alignment (useful for splicing).
| vector< multipath_alignment_t > vg::Surjector::surject | ( | const multipath_alignment_t & | source, |
| const unordered_set< path_handle_t > & | paths, | ||
| vector< tuple< string, int64_t, bool >> & | positions_out, | ||
| bool | allow_negative_scores = false, |
||
| bool | preserve_deletions = false |
||
| ) | const |
Same semantics as with alignments except that connections are always preserved as splices. The output consists of a multipath alignment with a single path, separated by splices (either from large deletions or from connections)
| void vg::Surjector::surject_in_place | ( | vector< AlnType > & | alns, |
| const unordered_set< path_handle_t > & | paths, | ||
| bool | allow_negative_scores = false, |
||
| bool | preserve_deletions = false |
||
| ) | const |
Surject a whole collection of Alignment or multipath_alignment_t objects for an unpaired read.
On return, alns contains the surjected versions of the alignments.
For Alignment, populates refpos.
There can be more output surjections than there were input alignments.
| void vg::Surjector::surject_in_place | ( | vector< AlnType > & | alns, |
| vector< tuple< string, int64_t, bool >> & | positions_out, | ||
| const unordered_set< path_handle_t > & | paths, | ||
| bool | allow_negative_scores = false, |
||
| bool | preserve_deletions = false |
||
| ) | const |
Surject a whole collection of Alignment or multipath_alignment_t objects for an unpaired read.
On return, alns contains the surjected versions of the alignments, and positions_out contains their linear start positions.
For Alignment, does not populate refpos.
There can be more output surjections than there were input alignments.
|
protected |
| void vg::Surjector::surject_paired_in_place | ( | vector< AlnType > & | alns1, |
| vector< AlnType > & | alns2, | ||
| vector< AlnType > & | supplementary_alns1_out, | ||
| vector< AlnType > & | supplementary_alns2_out, | ||
| const unordered_set< path_handle_t > & | paths, | ||
| bool | allow_negative_scores = false, |
||
| bool | preserve_deletions = false |
||
| ) | const |
Surject paired-end reads and pull aside supplementary alignments.
Assumes that corresponding entries in alns1 and alns2 are paired with each other.
On return, alns1 and alns2 will be corresponding paired best surjections, and supplementary_alns1_out and supplementary_alns2_out will be supplementary alignments of each read annotated to attach them to the appropriate non-supplementary alignments.
All out vectors must be empty when passed in. You may pass one vector for both supplementary_alns1_out and supplementary_alns2_out.
For Alignment, populates refpos.
In non-multimapped-surjection mode, each input read pair will produce one non-supplementary output surjection.
In multimapped surjection mode, each input read pair can produce multiple non-supplementary output surjections, which will be in the same order as the input reads.
| void vg::Surjector::surject_paired_in_place | ( | vector< AlnType > & | alns1, |
| vector< AlnType > & | alns2, | ||
| vector< tuple< string, int64_t, bool >> & | positions1_out, | ||
| vector< tuple< string, int64_t, bool >> & | positions2_out, | ||
| vector< AlnType > & | supplementary_alns1_out, | ||
| vector< AlnType > & | supplementary_alns2_out, | ||
| vector< tuple< string, int64_t, bool >> & | supplementary_positions1_out, | ||
| vector< tuple< string, int64_t, bool >> & | supplementary_positions2_out, | ||
| const unordered_set< path_handle_t > & | paths, | ||
| bool | allow_negative_scores = false, |
||
| bool | preserve_deletions = false |
||
| ) | const |
Surject paired-end reads and pull aside supplementary alignments.
Assumes that corresponding entries in alns1 and alns2 are paired with each other.
On return, alns1 and alns2 will be corresponding paired best surjections, positions1_out and positions2_out will be their surjected linear positions, supplementary_alns1_out and supplementary_alns2_out will be supplementary alignments of each read annotated to attach them to the appropriate non-supplementary alignments, and supplementary_positions1_out and supplementary_positions2_out will be their positions.
All out vectors must be empty when passed in. You may pass one vector for both supplementary_alns1_out and supplementary_alns2_out, and you may pass one vector for both supplementary_positions1_out and supplementary_positions2_out, but you probably want to use either a combined vector for both or separate vectors for both so you can find the position that goes with each alignment.
For Alignment, does not populate refpos.
In non-multimapped-surjection mode, each input read pair will produce one non-supplementary output surjection.
In multimapped surjection mode, each input read pair can produce multiple non-supplementary output surjections, which will be in the same order as the input reads.
|
protected |
|
protected |
returns the transitive reduction of a topologically sorted DAG's adjacency list
|
staticprotected |
| bool vg::Surjector::annotate_off_reference_pos = false |
Annotate reads whose alignments are lost during surjection with the nearest reference position.
| bool vg::Surjector::annotate_with_all_path_scores = false |
| bool vg::Surjector::annotate_with_graph_alignment = false |
| std::function<size_t(const Alignment&, const HandleGraph&)> vg::Surjector::choose_band_padding |
|
staticconstexpr |
|
staticconstexpr |
And an accessible default max_subgraph_bases_per_read_base for normal alignment.
| int64_t vg::Surjector::disjoint_interval_allowable_overlap = 4 |
The max size overlap on the read between supplementaries before we designate them as non-colinear.
| int64_t vg::Surjector::dominated_path_chunk_diff = 10 |
| int64_t vg::Surjector::downsample_coverage = 16 |
while downsampling, try to get down to this coverage on each base
| std::unique_ptr<Aligner> vg::Surjector::dp_aligner |
When doing DP alignments, we use slightly adjusted alignment scores, which need to live in their own Aligner
| int8_t vg::Surjector::dp_gap_open_extra_cost = 0 |
When doing DP alignment, we increase gap open score by this much. (Changes won't take effect until set_alignment_scores() is called.)
| int8_t vg::Surjector::dp_score_scale = 10 |
When doing DP alignments, we multiply scores by this factor before slightly increasing gap open. (Changes won't take effect until set_alignment_scores() is called.)
|
protected |
the graph we're surjecting onto
| bool vg::Surjector::left_align = false |
Attempt to left-align indels relative to the forward strand of the surjection path.
| double vg::Surjector::low_complexity_p_value = .0075 |
| size_t vg::Surjector::max_anchors = std::numeric_limits<size_t>::max() |
How many anchors (per path) will we use when surjecting using anchors? Excessive anchors will be pruned away.
| uint64_t vg::Surjector::max_band_cells = 8000000000 |
| size_t vg::Surjector::max_disjoint_gap = 10000 |
The maximum gap size before we always separate into supplementary alignments.
| int64_t vg::Surjector::max_low_complexity_anchor_prune = 40 |
| int64_t vg::Surjector::max_low_complexity_anchor_trim = 65 |
| int64_t vg::Surjector::max_slide = DEFAULT_MAX_SLIDE |
Declare an anchor suspicious if it appears again at any offset up to this limit or the anchor length.
| double vg::Surjector::max_subgraph_bases_per_read_base = DEFAULT_SUBGRAPH_LIMIT |
How big of a graph (in graph bases per read base) should we ever try to align against for realigning surjection?
| int64_t vg::Surjector::max_tail_anchor_prune = 4 |
| size_t vg::Surjector::max_tail_length = 10000 |
the maximum length of a tail that we will try to align
| int64_t vg::Surjector::min_absolute_align_size_to_refuse = 1024 |
Don't refuse to align (graph size) * (read size) is at least this size (overrides max_subgraph_bases_per_read_base)
| size_t vg::Surjector::min_disjoint_gap = 50 |
The minimum gap size we should never separate into supplementary alignments.
| int64_t vg::Surjector::min_fold_coverage_for_downsample = 8 |
in spliced surject, downsample if the base-wise average coverage by chunks is this high
| int64_t vg::Surjector::min_shift_for_prune = 32 * 1024 |
| int64_t vg::Surjector::min_splice_length = 20 |
the minimum length deletion that the spliced algorithm will interpret as a splice event
| int64_t vg::Surjector::min_splice_repair_length = 250 |
the minimum length apparent intron that we will try to repair
| bool vg::Surjector::multimap_to_all_paths = false |
Return alignments to overlapping paths as secondaries instead of just the best one.
| size_t vg::Surjector::off_reference_pos_search_limit = 20000 |
How far we will traverse the graph in search of a reference position?
| int64_t vg::Surjector::pad_suspicious_anchors_to_length = 12 |
When examining anchors for low complexity, try and make them at least this long. To ensure orientation symmetry, we will make anchors with the oppsite parity (even if this is odd, or odd if this is even) 1bp longer.
| bool vg::Surjector::prune_suspicious_anchors = false |
| double vg::Surjector::read_length_prop_disjoint_gap = 1.0 |
What fraction of a read length separation should we expect before separating into supplementaries?
| bool vg::Surjector::report_supplementary = true |
Should we report supplementary alignments?
| int64_t vg::Surjector::shift_prune_diff = 16 * 1024 |
|
staticconstexpr |
We have a different default max_subgraph_bases_per_read_base to use for spliced alignment.
|
mutable |
And have we complained about hitting it?
1.9.1