vg
tools for working with variation graphs
|
Namespaces | |
io | |
subcommand | |
temp_file | |
unittest | |
Enumerations | |
enum | MappingQualityMethod { Approx, Exact, Adaptive, None } |
enum | SnarlType { UNCLASSIFIED = 0, ULTRABUBBLE = 1, UNARY = 2 } |
Enumeration of the classifications of snarls. More... | |
Functions | |
int | hts_for_each (string &filename, function< void(Alignment &)> lambda, const PathPositionHandleGraph *graph) |
int | hts_for_each (string &filename, function< void(Alignment &)> lambda) |
int | hts_for_each_parallel (string &filename, function< void(Alignment &)> lambda, const PathPositionHandleGraph *graph) |
int | hts_for_each_parallel (string &filename, function< void(Alignment &)> lambda) |
bam_hdr_t * | hts_file_header (string &filename, string &header) |
bam_hdr_t * | hts_string_header (string &header, map< string, int64_t > &path_length, map< string, string > &rg_sample) |
bool | get_next_alignment_from_fastq (gzFile fp, char *buffer, size_t len, Alignment &alignment) |
bool | get_next_interleaved_alignment_pair_from_fastq (gzFile fp, char *buffer, size_t len, Alignment &mate1, Alignment &mate2) |
bool | get_next_alignment_pair_from_fastqs (gzFile fp1, gzFile fp2, char *buffer, size_t len, Alignment &mate1, Alignment &mate2) |
size_t | unpaired_for_each_parallel (function< bool(Alignment &)> get_read_if_available, function< void(Alignment &)> lambda) |
size_t | paired_for_each_parallel_after_wait (function< bool(Alignment &, Alignment &)> get_pair_if_available, function< void(Alignment &, Alignment &)> lambda, function< bool(void)> single_threaded_until_true) |
size_t | fastq_unpaired_for_each_parallel (const string &filename, function< void(Alignment &)> lambda) |
size_t | fastq_paired_interleaved_for_each_parallel (const string &filename, function< void(Alignment &, Alignment &)> lambda) |
size_t | fastq_paired_two_files_for_each_parallel (const string &file1, const string &file2, function< void(Alignment &, Alignment &)> lambda) |
size_t | fastq_paired_interleaved_for_each_parallel_after_wait (const string &filename, function< void(Alignment &, Alignment &)> lambda, function< bool(void)> single_threaded_until_true) |
size_t | fastq_paired_two_files_for_each_parallel_after_wait (const string &file1, const string &file2, function< void(Alignment &, Alignment &)> lambda, function< bool(void)> single_threaded_until_true) |
size_t | fastq_unpaired_for_each (const string &filename, function< void(Alignment &)> lambda) |
size_t | fastq_paired_interleaved_for_each (const string &filename, function< void(Alignment &, Alignment &)> lambda) |
size_t | fastq_paired_two_files_for_each (const string &file1, const string &file2, function< void(Alignment &, Alignment &)> lambda) |
void | parse_rg_sample_map (char *hts_header, map< string, string > &rg_sample) |
short | quality_char_to_short (char c) |
char | quality_short_to_char (short i) |
void | alignment_quality_short_to_char (Alignment &alignment) |
string | string_quality_short_to_char (const string &quality) |
void | alignment_quality_char_to_short (Alignment &alignment) |
string | string_quality_char_to_short (const string &quality) |
string | alignment_to_sam_internal (const Alignment &alignment, const string &refseq, const int32_t refpos, const bool refrev, const vector< pair< int, char >> &cigar, const string &mateseq, const int32_t matepos, bool materev, const int32_t tlen, bool paired, const int32_t tlen_max) |
string | alignment_to_sam (const Alignment &alignment, const string &refseq, const int32_t refpos, const bool refrev, const vector< pair< int, char >> &cigar, const string &mateseq, const int32_t matepos, bool materev, const int32_t tlen, const int32_t tlen_max) |
string | alignment_to_sam (const Alignment &alignment, const string &refseq, const int32_t refpos, const bool refrev, const vector< pair< int, char >> &cigar) |
bam1_t * | alignment_to_bam_internal (const string &sam_header, const Alignment &alignment, const string &refseq, const int32_t refpos, const bool refrev, const vector< pair< int, char >> &cigar, const string &mateseq, const int32_t matepos, bool materev, const int32_t tlen, bool paired, const int32_t tlen_max) |
bam1_t * | alignment_to_bam (const string &sam_header, const Alignment &alignment, const string &refseq, const int32_t refpos, const bool refrev, const vector< pair< int, char >> &cigar, const string &mateseq, const int32_t matepos, bool materev, const int32_t tlen, const int32_t tlen_max) |
bam1_t * | alignment_to_bam (const string &sam_header, const Alignment &alignment, const string &refseq, const int32_t refpos, const bool refrev, const vector< pair< int, char >> &cigar) |
string | cigar_string (const vector< pair< int, char > > &cigar) |
string | mapping_string (const string &source, const Mapping &mapping) |
void | mapping_cigar (const Mapping &mapping, vector< pair< int, char >> &cigar) |
int64_t | cigar_mapping (const bam1_t *b, Mapping *mapping) |
void | mapping_against_path (Alignment &alignment, const bam1_t *b, char *chr, const PathPositionHandleGraph *graph, bool on_reverse_strand) |
vector< pair< int, char > > | cigar_against_path (const Alignment &alignment, bool on_reverse_strand, int64_t &pos, size_t path_len, size_t softclip_suppress) |
pair< int32_t, int32_t > | compute_template_lengths (const int64_t &pos1, const vector< pair< int, char >> &cigar1, const int64_t &pos2, const vector< pair< int, char >> &cigar2) |
int32_t | sam_flag (const Alignment &alignment, bool on_reverse_strand, bool paired) |
Alignment | bam_to_alignment (const bam1_t *b, map< string, string > &rg_sample, const bam_hdr_t *bh, const PathPositionHandleGraph *graph) |
Alignment | bam_to_alignment (const bam1_t *b, map< string, string > &rg_sample) |
int | alignment_to_length (const Alignment &a) |
int | alignment_from_length (const Alignment &a) |
Alignment | strip_from_start (const Alignment &aln, size_t drop) |
Alignment | strip_from_end (const Alignment &aln, size_t drop) |
Alignment | trim_alignment (const Alignment &aln, const Position &pos1, const Position &pos2) |
vector< Alignment > | alignment_ends (const Alignment &aln, size_t len1, size_t len2) |
Alignment | alignment_middle (const Alignment &aln, int len) |
vector< Alignment > | reverse_complement_alignments (const vector< Alignment > &alns, const function< int64_t(int64_t)> &node_length) |
Alignment | reverse_complement_alignment (const Alignment &aln, const function< int64_t(id_t)> &node_length) |
void | reverse_complement_alignment_in_place (Alignment *aln, const function< int64_t(id_t)> &node_length) |
Alignment | merge_alignments (const vector< Alignment > &alns) |
Alignment & | extend_alignment (Alignment &a1, const Alignment &a2, bool debug) |
Alignment | merge_alignments (const Alignment &a1, const Alignment &a2, bool debug) |
void | translate_nodes (Alignment &a, const unordered_map< id_t, pair< id_t, bool > > &ids, const std::function< size_t(int64_t)> &node_length) |
void | flip_nodes (Alignment &a, const set< int64_t > &ids, const std::function< size_t(int64_t)> &node_length) |
int | non_match_start (const Alignment &alignment) |
int | non_match_end (const Alignment &alignment) |
int | softclip_start (const Alignment &alignment) |
int | softclip_end (const Alignment &alignment) |
int | softclip_trim (Alignment &alignment) |
int | query_overlap (const Alignment &aln1, const Alignment &aln2) |
int | edit_count (const Alignment &alignment) |
size_t | to_length_after_pos (const Alignment &aln, const Position &pos) |
size_t | from_length_after_pos (const Alignment &aln, const Position &pos) |
size_t | to_length_before_pos (const Alignment &aln, const Position &pos) |
size_t | from_length_before_pos (const Alignment &aln, const Position &pos) |
const string | hash_alignment (const Alignment &aln) |
Alignment | simplify (const Alignment &a, bool trim_internal_deletions) |
void | normalize_alignment (Alignment &alignment) |
Merge adjacent edits of the same type and convert all N matches to mismatches. More... | |
map< id_t, int > | alignment_quality_per_node (const Alignment &aln) |
string | middle_signature (const Alignment &aln, int len) |
pair< string, string > | middle_signature (const Alignment &aln1, const Alignment &aln2, int len) |
string | signature (const Alignment &aln) |
pair< string, string > | signature (const Alignment &aln1, const Alignment &aln2) |
void | parse_bed_regions (istream &bedstream, const PathPositionHandleGraph *graph, vector< Alignment > *out_alignments) |
void | parse_gff_regions (istream &gffstream, const PathPositionHandleGraph *graph, vector< Alignment > *out_alignments) |
Position | alignment_start (const Alignment &aln) |
Position | alignment_end (const Alignment &aln) |
map< string,vector< pair< size_t, bool > > > | alignment_refpos_to_path_offsets (const Alignment &aln) |
return the path offsets as cached in the alignment More... | |
void | alignment_set_distance_to_correct (Alignment &aln, const Alignment &base) |
annotate the first alignment with its minimum distance to the second in their annotated paths More... | |
void | alignment_set_distance_to_correct (Alignment &aln, const map< string, vector< pair< size_t, bool > > > &base_offsets) |
bool | alignment_is_valid (Alignment &aln, const HandleGraph *hgraph) |
check to make sure edits on the alignment's path don't assume incorrect node lengths or ids More... | |
Alignment | target_alignment (const PathPositionHandleGraph *graph, const string &name, size_t pos1, size_t pos2, const string &feature, bool is_reverse, Mapping &cigar_mapping) |
Alignment | target_alignment (const PathPositionHandleGraph *graph, const string &name, size_t pos1, size_t pos2, const string &feature, bool is_reverse) |
int | fastq_for_each (string &filename, function< void(Alignment &)> lambda) |
void | write_alignment_to_file (const Alignment &aln, const string &filename) |
void | mapping_cigar (const Mapping &mapping, vector< pair< int, char > > &cigar) |
void | cigar_mapping (const bam1_t *b, Mapping &mapping) |
void | mapping_against_path (Alignment &alignment, const bam1_t *b, const PathPositionHandleGraph *graph, bool on_reverse_strand) |
unique_ptr< AlignmentEmitter > | get_alignment_emitter (const string &filename, const string &format, const map< string, int64_t > &path_length, size_t max_threads) |
template<typename AnnotationType , typename Annotated > | |
AnnotationType | get_annotation (const Annotated &annotated, const string &name) |
template<typename AnnotationType , typename Annotated > | |
AnnotationType | get_annotation (Annotated *annotated, const string &name) |
template<typename AnnotationType , typename Annotated > | |
void | set_annotation (Annotated *annotated, const string &name, const AnnotationType &annotation) |
template<typename AnnotationType , typename Annotated > | |
void | set_annotation (Annotated &annotated, const string &name, const AnnotationType &annotation) |
template<typename Annotated > | |
void | clear_annotation (Annotated *annotated, const string &name) |
Clear the annotation with the given name. More... | |
template<typename Annotated > | |
void | clear_annotation (Annotated &annotated, const string &name) |
Clear the annotation with the given name. More... | |
template<typename T > | |
T | value_cast (const google::protobuf::Value &value) |
Cast a Protobuf generic Value to any type. More... | |
template<typename T > | |
google::protobuf::Value | value_cast (const T &wrap) |
Cast any type to a generic Protobuf value. More... | |
template<> | |
bool | value_cast< bool > (const google::protobuf::Value &value) |
template<> | |
double | value_cast< double > (const google::protobuf::Value &value) |
template<> | |
string | value_cast< string > (const google::protobuf::Value &value) |
template<> | |
google::protobuf::Value | value_cast< bool > (const bool &wrap) |
template<> | |
google::protobuf::Value | value_cast< double > (const double &wrap) |
template<> | |
google::protobuf::Value | value_cast< string > (const string &wrap) |
template<typename Container > | |
Container | value_cast (const google::protobuf::Value &value) |
Cast a Protobuf generic Value to any type. More... | |
template<typename Container > | |
google::protobuf::Value | value_cast (const Container &wrap) |
void | augment (MutablePathMutableHandleGraph *graph, istream &gam_stream, vector< Translation > *out_translations, ostream *gam_out_stream, bool embed_paths, bool break_at_ends, bool remove_softclips, bool filter_out_of_graph_alignments, double min_baseq, double min_mapq, Packer *packer, size_t min_bp_coverage) |
void | augment (MutablePathMutableHandleGraph *graph, vector< Path > &path_vector, vector< Translation > *out_translations, ostream *gam_out_stream, bool embed_paths, bool break_at_ends, bool remove_softclips, bool filter_out_of_graph_alignments, double min_baseq, double min_mapq, Packer *packer, size_t min_bp_coverage) |
void | augment_impl (MutablePathMutableHandleGraph *graph, function< void(function< void(Alignment &)>, bool, bool)> iterate_gam, vector< Translation > *out_translation, ostream *gam_out_stream, bool embed_paths, bool break_at_ends, bool remove_soft_clips, bool filter_out_of_graph_alignments, double min_baseq, double min_mapq, Packer *packer, size_t min_bp_coverage) |
Generic version used to implement the above two methods. More... | |
double | get_avg_baseq (const Edit &edit, const string &base_quals, size_t position_in_read) |
void | find_breakpoints (const Path &path, unordered_map< id_t, set< pos_t >> &breakpoints, bool break_ends, const string &base_quals, double min_baseq) |
unordered_map< id_t, set< pos_t > > | forwardize_breakpoints (const HandleGraph *graph, const unordered_map< id_t, set< pos_t >> &breakpoints) |
Flips the breakpoints onto the forward strand. More... | |
void | find_packed_breakpoints (const Path &path, Packer &packed_breakpoints, bool break_ends=true, const string &base_quals="", double min_baseq=0) |
Like "find_breakpoints", but store in packed structure (better for large gams and enables coverage filter) More... | |
unordered_map< id_t, set< pos_t > > | filter_breakpoints_by_coverage (const Packer &packed_breakpoints, size_t min_bp_coverage) |
path_handle_t | add_path_to_graph (MutablePathHandleGraph *graph, const Path &path) |
map< pos_t, id_t > | ensure_breakpoints (MutableHandleGraph *graph, const unordered_map< id_t, set< pos_t >> &breakpoints) |
bool | simplify_filtered_edits (HandleGraph *graph, Path &path, const map< pos_t, id_t > &node_translation, const unordered_map< id_t, size_t > &orig_node_sizes, const string &base_quals, double min_baseq) |
Path | add_nodes_and_edges (MutableHandleGraph *graph, const Path &path, const map< pos_t, id_t > &node_translation, unordered_map< pair< pos_t, string >, vector< id_t >> &added_seqs, unordered_map< id_t, Path > &added_nodes, const unordered_map< id_t, size_t > &orig_node_sizes, size_t max_node_size=1024) |
This version doesn't require a set of dangling sides to populate More... | |
Path | add_nodes_and_edges (MutableHandleGraph *graph, const Path &path, const map< pos_t, id_t > &node_translation, unordered_map< pair< pos_t, string >, vector< id_t >> &added_seqs, unordered_map< id_t, Path > &added_nodes, const unordered_map< id_t, size_t > &orig_node_sizes, set< NodeSide > &dangling, size_t max_node_size) |
vector< Translation > | make_translation (const HandleGraph *graph, const map< pos_t, id_t > &node_translation, const unordered_map< id_t, Path > &added_nodes, const unordered_map< id_t, size_t > &orig_node_sizes) |
Produce a graph Translation object from information about the editing process. More... | |
ostream & | operator<< (ostream &out, const BenchmarkResult &result) |
void | benchmark_control () |
BenchmarkResult | run_benchmark (const string &name, size_t iterations, const function< void(void)> &under_test) |
BenchmarkResult | run_benchmark (const string &name, size_t iterations, const function< void(void)> &setup, const function< void(void)> &under_test) |
void | build_gcsa_lcp (const HandleGraph &graph, gcsa::GCSA *&gcsa, gcsa::LCPArray *&lcp, int kmer_size, size_t doubling_steps, size_t size_limit, const string &base_file_name) |
void * | mergeNodeObjects (void *a, void *b) |
void | getReachableBridges2 (stCactusEdgeEnd *edgeEnd1, stHash *bridgeEndsToBridgeNodes, stList *bridgeEnds) |
void | getReachableBridges (stCactusEdgeEnd *edgeEnd1, stList *bridgeEnds) |
void | addArbitraryTelomerePair (vector< stCactusEdgeEnd * > ends, stList *telomeres) |
pair< stCactusGraph *, stList * > | handle_graph_to_cactus (const PathHandleGraph &graph, const unordered_set< string > &hint_paths, bool single_component) |
VG | cactus_to_vg (stCactusGraph *cactus_graph) |
VG | cactusify (VG &graph) |
vector< pair< gcsa::node_type, size_t > > | mem_node_start_positions (const HandleGraph &graph, const vg::MaximalExactMatch &mem) |
get the handles that a mem covers More... | |
bdsg::HashGraph | cluster_subgraph_containing (const HandleGraph &base, const Alignment &aln, const vector< vg::MaximalExactMatch > &cluster, const GSSWAligner *aligner) |
return a containing subgraph connecting the mems More... | |
bdsg::HashGraph | cluster_subgraph_walk (const HandleGraph &base, const Alignment &aln, const vector< vg::MaximalExactMatch > &mems, double expansion) |
template<typename T > | |
bool | convert (const std::string &s, T &r) |
template<typename T > | |
std::string | convert (const T &r) |
void | convert_handle_graph (const HandleGraph *converting, MutableHandleGraph *converted) |
Takes in a pointer to a HandleGraph and copies it into an empty MutableHandleGraph graph. More... | |
void | convert_path_handle_graph (const PathHandleGraph *converting, MutablePathMutableHandleGraph *converted) |
Takes in a pointer to a PathHandleGraph and copies it, inclding paths, into an empty MutablePathMutableHandleGraph graph. More... | |
void | stacktrace_manually (ostream &out, int signalNumber, void *ip, void **bp) |
void | emit_stacktrace (int signalNumber, siginfo_t *signalInfo, void *signalContext) |
Emit a stack trace when something bad happens. Add as a signal handler with sigaction. More... | |
void | enable_crash_handling () |
Main should call this to turn on our stack tracing support. More... | |
real_t | gamma_ln (real_t x) |
real_t | factorial_ln (int n) |
real_t | pow_ln (real_t m, int n) |
real_t | choose_ln (int n, int k) |
real_t | multinomial_choose_ln (int n, vector< int > k) |
real_t | poisson_prob_ln (int observed, real_t expected) |
template<typename ProbIn > | |
real_t | multinomial_sampling_prob_ln (const vector< ProbIn > &probs, const vector< int > &obs) |
template<typename ProbIn > | |
real_t | binomial_cmf_ln (ProbIn success_logprob, size_t trials, size_t successes) |
template<typename ProbIn > | |
real_t | geometric_sampling_prob_ln (ProbIn success_logprob, size_t trials) |
template<typename Iter > | |
bool | advance_split (Iter start, Iter end) |
template<typename ProbIn > | |
real_t | multinomial_censored_sampling_prob_ln (const vector< ProbIn > &probs, const unordered_map< vector< bool >, int > &obs) |
real_t | ewens_af_prob_ln (const vector< int > &a, real_t theta) |
bool | edit_is_match (const Edit &e) |
bool | edit_is_sub (const Edit &e) |
bool | edit_is_insertion (const Edit &e) |
bool | edit_is_deletion (const Edit &e) |
bool | edit_is_empty (const Edit &e) |
pair< Edit, Edit > | cut_edit_at_to (const Edit &e, size_t to_off) |
pair< Edit, Edit > | cut_edit_at_from (const Edit &e, size_t from_off) |
Edit | reverse_complement_edit (const Edit &e) |
bool | operator== (const Edit &e1, const Edit &e2) |
double | entropy (const string &st) |
double | entropy (const char *st, size_t len) |
template<class Element > | |
void | in_place_subvector (std::vector< Element > &vec, size_t head, size_t tail) |
void | match_initial (GaplessExtension &match, const std::string &seq, gbwtgraph::GBWTGraph::view_type target, const Aligner *aligner) |
size_t | match_forward (GaplessExtension &match, const std::string &seq, gbwtgraph::GBWTGraph::view_type target, uint32_t mismatch_limit, const Aligner *aligner) |
void | match_backward (GaplessExtension &match, const std::string &seq, gbwtgraph::GBWTGraph::view_type target, uint32_t mismatch_limit, const Aligner *aligner) |
void | remove_duplicates (std::vector< GaplessExtension > &result) |
void | find_mismatches (const std::string &seq, const gbwtgraph::GBWTGraph &graph, std::vector< GaplessExtension > &result) |
size_t | interval_length (std::pair< size_t, size_t > interval) |
bool | trim_mismatches (GaplessExtension &extension, const gbwtgraph::GBWTGraph &graph, const gbwt::CachedGBWT &cache, const Aligner &aligner) |
std::string | thread_name (const gbwt::GBWT &gbwt_index, size_t i) |
Get a string representation of a thread name stored in GBWT metadata. More... | |
gbwt::GBWT | get_gbwt (const std::vector< gbwt::vector_type > &paths) |
Transform the paths into a GBWT index. Primarily for testing. More... | |
handle_t | gbwt_to_handle (const HandleGraph &graph, gbwt::node_type node) |
Convert gbwt::node_type to handle_t. More... | |
pos_t | gbwt_to_pos (gbwt::node_type node, size_t offset) |
Convert gbwt::node_type and an offset as size_t to pos_t. More... | |
gbwt::node_type | handle_to_gbwt (const HandleGraph &graph, handle_t handle) |
Convert handle_t to gbwt::node_type. More... | |
gbwt::node_type | pos_to_gbwt (pos_t pos) |
Extract gbwt::node_type from pos_t. More... | |
gbwt::node_type | mapping_to_gbwt (const Mapping &mapping) |
Convert Mapping to gbwt::node_type. More... | |
gbwt::node_type | xg_path_to_gbwt (const xg::XGPath &path, size_t i) |
Convert a node on XGPath to gbwt::node_type. More... | |
SnarlTraversal | get_traversal_of_snarl (VG &graph, const Snarl *snarl, const SnarlManager &manager, const Path &path) |
string | traversal_to_string (VG &graph, const SnarlTraversal &path) |
Support | make_support (double forward, double reverse, double quality) |
double | total (const Support &support) |
Support | support_min (const Support &a, const Support &b) |
Support | support_max (const Support &a, const Support &b) |
Support | flip (const Support &to_flip) |
Support | operator+ (const Support &one, const Support &other) |
Support & | operator+= (Support &one, const Support &other) |
bool | operator< (const Support &a, const Support &b) |
bool | operator> (const Support &a, const Support &b) |
ostream & | operator<< (ostream &stream, const Support &support) |
string | to_vcf_genotype (const Genotype >) |
template<typename Scalar > | |
Support | operator* (const Support &support, const Scalar &scale) |
template<typename Scalar > | |
Support & | operator*= (Support &support, const Scalar &scale) |
template<typename Scalar > | |
Support | operator* (const Scalar &scale, const Support &support) |
template<typename Scalar > | |
Support | operator/ (const Support &support, const Scalar &scale) |
template<typename Scalar > | |
Support & | operator/= (Support &support, const Scalar &scale) |
string | allele_to_string (VG &graph, const Path &allele) |
template<typename T > | |
void | set_intersection (const unordered_set< T > &set_1, const unordered_set< T > &set_2, unordered_set< T > *out_intersection) |
bool | stPinchSegment_getBlockOrientationSafe (stPinchSegment *segment) |
Get the segment's orientation in its block (false=backward, true=forward), or true (forward) if there is no block. More... | |
bool | gfa_to_graph (istream &in, VG *graph, bool only_perfect_match) |
void | graph_to_gfa (const VG *graph, ostream &out) |
Export the given VG graph to the given GFA file. More... | |
void | sort_by_id_dedup_and_clean (Graph &graph) |
remove duplicates and sort by id More... | |
void | remove_duplicates (Graph &graph) |
remove duplicate nodes and edges More... | |
void | remove_duplicate_edges (Graph &graph) |
remove duplicate edges More... | |
void | remove_duplicate_nodes (Graph &graph) |
remove duplicate nodes More... | |
void | remove_orphan_edges (Graph &graph) |
remove edges that link to a node that is not in the graph More... | |
void | sort_by_id (Graph &graph) |
order the nodes and edges in the graph by id More... | |
void | sort_nodes_by_id (Graph &graph) |
order the nodes in the graph by id More... | |
void | sort_edges_by_id (Graph &graph) |
order the edges in the graph by id pairs More... | |
bool | is_id_sortable (const Graph &graph) |
returns true if the graph is id-sortable (no reverse links) More... | |
bool | has_inversion (const Graph &graph) |
returns true if we find an edge that may specify an inversion More... | |
void | flip_doubly_reversed_edges (Graph &graph) |
clean up doubly-reversed edges More... | |
void | from_handle_graph (const HandleGraph &from, Graph &to) |
void | from_path_handle_graph (const PathHandleGraph &from, Graph &to) |
void | trace_haplotypes_and_paths (const PathHandleGraph &source, const gbwt::GBWT &haplotype_database, vg::id_t start_node, int extend_distance, Graph &out_graph, map< string, int > &out_thread_frequencies, bool expand_graph) |
void | output_haplotype_counts (ostream &annotation_ostream, vector< pair< thread_t, int >> &haplotype_list) |
Graph | output_graph_with_embedded_paths (vector< pair< thread_t, int >> &haplotype_list, const HandleGraph &source) |
void | output_graph_with_embedded_paths (ostream &subgraph_ostream, vector< pair< thread_t, int >> &haplotype_list, const HandleGraph &source, bool json) |
void | thread_to_graph_spanned (thread_t &t, Graph &g, const HandleGraph &source) |
void | add_thread_nodes_to_set (thread_t &t, set< int64_t > &nodes) |
void | add_thread_edges_to_set (thread_t &t, set< pair< int, int > > &edges) |
void | construct_graph_from_nodes_and_edges (Graph &g, const HandleGraph &source, set< int64_t > &nodes, set< pair< int, int > > &edges) |
Path | path_from_thread_t (thread_t &t, const HandleGraph &source) |
vector< pair< thread_t, int > > | list_haplotypes (const HandleGraph &source, const gbwt::GBWT &haplotype_database, gbwt::node_type start_node, int extend_distance) |
void | node_path_position (int64_t id, string &path_name, int64_t &position, bool backward, int64_t &offset) |
void | index_positions (VG &graph, map< long, Node * > &node_path, map< long, Edge * > &edge_path) |
void | for_each_kmer (const HandleGraph &graph, size_t k, const function< void(const kmer_t &)> &lambda, id_t head_id=0, id_t tail_id=0) |
Iterate over all the kmers in the graph, running lambda on each. More... | |
ostream & | operator<< (ostream &out, const kmer_t &kmer) |
Print a kmer_t to a stream. More... | |
void | kmer_to_gcsa_kmers (const kmer_t &kmer, const gcsa::Alphabet &alpha, const function< void(const gcsa::KMer &)> &lambda) |
Convert the kmer_t to a set of gcsa2 binary kmers which are exposed via a callback. More... | |
gcsa::byte_type | encode_chars (const vector< char > &chars, const gcsa::Alphabet &alpha) |
Encode the chars into the gcsa2 byte. More... | |
void | write_gcsa_kmers (const HandleGraph &graph, int kmer_size, ostream &out, size_t &size_limit, id_t head_id, id_t tail_id) |
string | write_gcsa_kmers_to_tmpfile (const HandleGraph &graph, int kmer_size, size_t &size_limit, id_t head_id, id_t tail_id, const string &base_file_name) |
int | sub_overlaps_of_first_aln (const vector< Alignment > &alns, float overlap_fraction) |
set< pos_t > | gcsa_nodes_to_positions (const vector< gcsa::node_type > &nodes) |
const int | balanced_stride (int read_length, int kmer_size, int stride) |
const vector< string > | balanced_kmers (const string &seq, const int kmer_size, const int stride) |
pair< int64_t, int64_t > | mem_min_oriented_distances (const MaximalExactMatch &m1, const MaximalExactMatch &m2) |
bool | operator== (const MaximalExactMatch &m1, const MaximalExactMatch &m2) |
bool | operator< (const MaximalExactMatch &m1, const MaximalExactMatch &m2) |
ostream & | operator<< (ostream &out, const MaximalExactMatch &mem) |
const string | mems_to_json (const vector< MaximalExactMatch > &mems) |
vector< string::const_iterator > | cluster_cover (const vector< MaximalExactMatch > &cluster) |
int | cluster_coverage (const vector< MaximalExactMatch > &cluster) |
bool | mems_overlap (const MaximalExactMatch &mem1, const MaximalExactMatch &mem2) |
int | mems_overlap_length (const MaximalExactMatch &mem1, const MaximalExactMatch &mem2) |
bool | clusters_overlap_in_read (const vector< MaximalExactMatch > &cluster1, const vector< MaximalExactMatch > &cluster2) |
int | clusters_overlap_length (const vector< MaximalExactMatch > &cluster1, const vector< MaximalExactMatch > &cluster2) |
vector< pos_t > | cluster_nodes (const vector< MaximalExactMatch > &cluster) |
bool | clusters_overlap_in_graph (const vector< MaximalExactMatch > &cluster1, const vector< MaximalExactMatch > &cluster2) |
vector< MaximalExactMatch > | translate_mems (const vector< MaximalExactMatch > &mems, const unordered_map< id_t, pair< id_t, bool > > &trans) |
string | get_proc_status_value (const string &name) |
Get the string value for a field in /proc/self/status by name, or "" if unsupported or not found. More... | |
size_t | get_max_rss_kb () |
Get the max RSS usage ever, in kb, or 0 if unsupported. More... | |
size_t | get_max_vmem_kb () |
Get the max virtual memory size ever, in kb, or 0 if unsupported. More... | |
size_t | get_current_vmem_kb () |
Get the current virtual memory size, in kb, or 0 if unsupported. More... | |
void | topologically_order_subpaths (MultipathAlignment &multipath_aln) |
Put subpaths in topological order (assumed to be true for other algorithms) More... | |
void | identify_start_subpaths (MultipathAlignment &multipath_aln) |
tuple< MultipathProblem, int64_t, int32_t > | run_multipath_dp (const MultipathAlignment &multipath_aln, bool subpath_global=false) |
template<typename TracebackIterator > | |
void | populate_path_from_traceback (const MultipathAlignment &multipath_aln, const MultipathProblem &problem, TracebackIterator traceback_start, TracebackIterator traceback_end, Path *output) |
int32_t | optimal_alignment_internal (const MultipathAlignment &multipath_aln, Alignment *aln_out, bool subpath_global) |
void | optimal_alignment (const MultipathAlignment &multipath_aln, Alignment &aln_out, bool subpath_global) |
int32_t | optimal_alignment_score (const MultipathAlignment &multipath_aln, bool subpath_global) |
vector< Alignment > | optimal_alignments (const MultipathAlignment &multipath_aln, size_t count) |
vector< Alignment > | optimal_alignments_with_disjoint_subpaths (const MultipathAlignment &multipath_aln, size_t count) |
vector< Alignment > | haplotype_consistent_alignments (const MultipathAlignment &multipath_aln, const haplo::ScoreProvider &score_provider, size_t soft_count, size_t hard_count, bool optimal_first) |
void | rev_comp_subpath (const Subpath &subpath, const function< int64_t(int64_t)> &node_length, Subpath &rev_comp_out) |
void | rev_comp_multipath_alignment (const MultipathAlignment &multipath_aln, const function< int64_t(int64_t)> &node_length, MultipathAlignment &rev_comp_out) |
void | rev_comp_multipath_alignment_in_place (MultipathAlignment *multipath_aln, const function< int64_t(int64_t)> &node_length) |
void | to_multipath_alignment (const Alignment &aln, MultipathAlignment &multipath_aln_out) |
void | transfer_read_metadata (const MultipathAlignment &from, MultipathAlignment &to) |
void | transfer_read_metadata (const Alignment &from, MultipathAlignment &to) |
void | transfer_read_metadata (const MultipathAlignment &from, Alignment &to) |
void | merge_non_branching_subpaths (MultipathAlignment &multipath_aln) |
Merges non-branching paths in a multipath alignment in place. More... | |
vector< vector< int64_t > > | connected_components (const MultipathAlignment &multipath_aln) |
void | extract_sub_multipath_alignment (const MultipathAlignment &multipath_aln, const vector< int64_t > &subpath_indexes, MultipathAlignment &sub_multipath_aln) |
bool | validate_multipath_alignment (const MultipathAlignment &multipath_aln, const HandleGraph &handle_graph) |
void | view_multipath_alignment (ostream &out, const MultipathAlignment &multipath_aln, const HandleGraph &handle_graph) |
Send a formatted string representation of the MultipathAlignment into the ostream. More... | |
void | view_multipath_alignment_as_dot (ostream &out, const MultipathAlignment &multipath_aln, bool show_graph=false) |
Converts a MultipathAlignment to a GraphViz Dot representation, output to the given ostream. More... | |
NodeSide | node_start (id_t id) |
Produce the start NodeSide of a Node. More... | |
NodeSide | node_end (id_t id) |
Produce the end NodeSide of a Node. More... | |
ostream & | operator<< (ostream &out, const NodeSide &nodeside) |
Print a NodeSide to a stream. More... | |
ostream & | operator<< (ostream &out, const NodeTraversal &nodetraversal) |
Print the given NodeTraversal. More... | |
ostream & | operator<< (ostream &out, mapping_t mapping) |
Allow a mapping_t to be printed, for debugging purposes. More... | |
Path & | append_path (Path &a, const Path &b) |
int | path_to_length (const Path &path) |
int | path_from_length (const Path &path) |
int | mapping_to_length (const Mapping &m) |
int | mapping_from_length (const Mapping &m) |
int | softclip_start (const Mapping &mapping) |
int | softclip_end (const Mapping &mapping) |
Position | first_path_position (const Path &path) |
Position | last_path_position (const Path &path) |
int | to_length (const Mapping &m) |
int | from_length (const Mapping &m) |
Path & | extend_path (Path &path1, const Path &path2) |
Path | concat_paths (const Path &path1, const Path &path2) |
Path | simplify (const Path &p, bool trim_internal_deletions) |
Mapping | concat_mappings (const Mapping &m, const Mapping &n, bool trim_internal_deletions) |
Mapping | simplify (const Mapping &m, bool trim_internal_deletions) |
Mapping | merge_adjacent_edits (const Mapping &m) |
Merge adjacent edits of the same type. More... | |
Path | trim_hanging_ends (const Path &p) |
bool | mapping_ends_in_deletion (const Mapping &m) |
bool | mapping_starts_in_deletion (const Mapping &m) |
bool | mapping_is_total_deletion (const Mapping &m) |
bool | mapping_is_simple_match (const Mapping &m) |
bool | path_is_simple_match (const Path &p) |
const string | mapping_sequence (const Mapping &mp, const string &node_seq) |
const string | mapping_sequence (const Mapping &mp, const Node &n) |
string | path_sequence (const HandleGraph &graph, const Path &path) |
Mapping | reverse_complement_mapping (const Mapping &m, const function< int64_t(id_t)> &node_length) |
void | reverse_complement_mapping_in_place (Mapping *m, const function< int64_t(id_t)> &node_length) |
Path | reverse_complement_path (const Path &path, const function< int64_t(id_t)> &node_length) |
void | reverse_complement_path_in_place (Path *path, const function< int64_t(id_t)> &node_length) |
pair< Mapping, Mapping > | cut_mapping (const Mapping &m, const Position &pos) |
pair< mapping_t, mapping_t > | cut_mapping (const mapping_t &m, const Position &pos) |
pair< Mapping, Mapping > | cut_mapping_offset (const Mapping &m, size_t offset) |
pair< mapping_t, mapping_t > | cut_mapping_offset (const mapping_t &m, size_t offset) |
pair< Mapping, Mapping > | cut_mapping (const Mapping &m, size_t offset) |
pair< mapping_t, mapping_t > | cut_mapping (const mapping_t &m, size_t offset) |
pair< Path, Path > | cut_path (const Path &path, const Position &pos) |
pair< Path, Path > | cut_path (const Path &path, size_t offset) |
bool | maps_to_node (const Path &p, id_t id) |
Position | path_start_position (const Path &path) |
string | path_to_string (Path p) |
Position | path_end_position (const Path &path) |
bool | adjacent_mappings (const Mapping &m1, const Mapping &m2) |
bool | mapping_is_match (const Mapping &m) |
double | divergence (const Mapping &m) |
double | identity (const Path &path) |
void | decompose (const Path &path, map< pos_t, int > &ref_positions, map< pos_t, Edit > &edits) |
double | overlap (const Path &p1, const Path &p2) |
void | translate_node_ids (Path &path, const unordered_map< id_t, id_t > &translator) |
Switches the node ids in the path to the ones indicated by the translator. More... | |
void | translate_node_ids (Path &path, const unordered_map< id_t, id_t > &translator, id_t cut_node, size_t bases_removed, bool from_right) |
void | translate_oriented_node_ids (Path &path, const unordered_map< id_t, pair< id_t, bool >> &translator) |
Switches the node ids and orientations in the path to the ones indicated by the translator. More... | |
pos_t | initial_position (const Path &path) |
pos_t | final_position (const Path &path) |
Path | path_from_node_traversals (const list< NodeTraversal > &traversals) |
void | remove_paths (Graph &graph, const function< bool(const string &)> &paths_to_take, std::list< Path > *matching) |
Path | path_from_path_handle (const PathHandleGraph &graph, path_handle_t path_handle) |
Alignment | alignment_from_path (const HandleGraph &graph, const Path &path) |
Path & | increment_node_mapping_ids (Path &p, id_t inc) |
const Paths | paths_from_graph (Graph &g) |
Path | merge_adjacent_edits (const Path &m) |
Merge adjacent edits of the same type. More... | |
vg::id_t | path_node (const vector< pair< vg::id_t, bool >> &path, size_t i) |
vg::id_t | path_node (const gbwt::vector_type &path, size_t i) |
size_t | path_size (const vector< pair< vg::id_t, bool >> &path) |
size_t | path_size (const gbwt::vector_type &path) |
bool | path_reverse (const vector< pair< vg::id_t, bool >> &path, size_t i) |
bool | path_reverse (const gbwt::vector_type &path, size_t i) |
std::ostream & | operator<< (std::ostream &out, PathBranch branch) |
template<class PathType > | |
bool | verify_path (const PathType &path, MutableHandleGraph &unfolded, const hash_map< vg::id_t, std::vector< vg::id_t >> &reverse_mapping) |
template<class Decoder > | |
void | printId (vg::id_t id) |
PhaseUnfolder::path_type | canonical_orientation (const PhaseUnfolder::path_type &path, bool &from_border, bool &to_border) |
pos_t | make_pos_t (const Position &pos) |
Convert a Position to a (much smaller) pos_t. More... | |
pos_t | make_pos_t (gcsa::node_type node) |
Create a pos_t from a gcsa node. More... | |
Position | make_position (const pos_t &pos) |
Convert a pos_t to a Position. More... | |
Position | make_position (id_t id, bool is_rev, off_t off) |
Create a Position from a Node ID, an orientation flag, and an offset along that strand of the node. More... | |
Position | make_position (gcsa::node_type node) |
Make a Position from a gcsa node. More... | |
Position | reverse (const Position &pos, size_t node_length) |
pair< int64_t, int64_t > | min_oriented_distances (const unordered_map< path_handle_t, vector< pair< size_t, bool > > > &path_offsets1, const unordered_map< path_handle_t, vector< pair< size_t, bool > > > &path_offsets2) |
Find the min distance in the path offsets where the path orientation is the same and different. More... | |
void | preflight_check () |
pair_hash_set< edge_t > | find_edges_to_prune (const HandleGraph &graph, size_t k, size_t edge_max) |
Iterate over all the walks up to length k, adding edges which. More... | |
ostream & | operator<< (ostream &os, const ReadFilter::Counts &counts) |
void | parse_region (const string &target, string &name, int64_t &start, int64_t &end) |
void | parse_bed_regions (const string &bed_path, vector< Region > &out_regions, vector< string > *out_names) |
void | parse_region (string ®ion, Region &out_region) |
pos_t | position_at (PathPositionHandleGraph *xgidx, const string &path_name, const size_t &path_offset, bool is_reverse) |
int64_t | min_not_minus_one (int64_t n1, int64_t n2) |
string | to_string (const HandleGraph &graph, handle_t handle) |
string | to_string (const HandleGraph &graph, edge_t edge) |
bool | start_backward (const Chain &chain) |
bool | end_backward (const Chain &chain) |
Visit | get_start_of (const Chain &chain) |
Visit | get_end_of (const Chain &chain) |
ChainIterator | chain_begin (const Chain &chain) |
ChainIterator | chain_end (const Chain &chain) |
ChainIterator | chain_rbegin (const Chain &chain) |
ChainIterator | chain_rend (const Chain &chain) |
ChainIterator | chain_rcbegin (const Chain &chain) |
ChainIterator | chain_rcend (const Chain &chain) |
ChainIterator | chain_begin_from (const Chain &chain, const Snarl *start_snarl, bool snarl_orientation) |
ChainIterator | chain_end_from (const Chain &chain, const Snarl *start_snarl, bool snarl_orientation) |
edge_t | to_edge (const handlegraph::HandleGraph &graph, const Visit &v1, const Visit &v2) |
Make an edge_t from a pair of visits. More... | |
bool | operator== (const Visit &a, const Visit &b) |
bool | operator!= (const Visit &a, const Visit &b) |
bool | operator< (const Visit &a, const Visit &b) |
ostream & | operator<< (ostream &out, const Visit &visit) |
bool | operator== (const SnarlTraversal &a, const SnarlTraversal &b) |
bool | operator!= (const SnarlTraversal &a, const SnarlTraversal &b) |
bool | operator< (const SnarlTraversal &a, const SnarlTraversal &b) |
bool | operator== (const Snarl &a, const Snarl &b) |
bool | operator!= (const Snarl &a, const Snarl &b) |
bool | operator< (const Snarl &a, const Snarl &b) |
ostream & | operator<< (ostream &out, const Snarl &snarl) |
NodeTraversal | to_node_traversal (const Visit &visit, const VG &graph) |
NodeTraversal | to_rev_node_traversal (const Visit &visit, const VG &graph) |
NodeSide | to_left_side (const Visit &visit) |
Converts a Visit to a node or snarl into a NodeSide for its left side. More... | |
NodeSide | to_right_side (const Visit &visit) |
Converts a Visit to a node or snarl into a NodeSide for its right side. More... | |
Visit | to_visit (const NodeTraversal &node_traversal) |
Converts a NodeTraversal to a Visit. More... | |
Visit | to_visit (const Mapping &mapping, bool make_full_node_match=false) |
Visit | to_visit (id_t node_id, bool is_reverse) |
Make a Visit from a node ID and an orientation. More... | |
Visit | to_visit (const Snarl &snarl) |
Make a Visit from a snarl to traverse. More... | |
Visit | to_visit (const handlegraph::HandleGraph &graph, const handle_t &handle) |
Make a Visit from a handle in a HandleGraph. More... | |
Visit | reverse (const Visit &visit) |
Get the reversed version of a visit. More... | |
Visit | to_rev_visit (const NodeTraversal &node_traversal) |
Converts a NodeTraversal to a Visit in the opposite orientation. More... | |
Mapping | to_mapping (const Visit &visit, std::function< size_t(id_t)> node_length) |
Mapping | to_mapping (const Visit &visit, const HandleGraph &vg) |
void | transfer_boundary_info (const Snarl &from, Snarl &to) |
Copies the boundary Visits from one Snarl into another. More... | |
NodeTraversal | to_node_traversal (const Visit &visit, VG &graph) |
NodeTraversal | to_rev_node_traversal (const Visit &visit, VG &graph) |
auto | operator<< (ostream &out, const BitString &bs) |
Allow BitStrings to be printed for debugging. More... | |
bool | is_match (const Translation &translation) |
pos_t | make_pos_t (id_t id, bool is_rev, off_t off) |
Create a pos_t from a Node ID, an orientation flag, and an offset along that strand of the node. More... | |
id_t | id (const pos_t &pos) |
Extract the id of the node a pos_t is on. More... | |
bool | is_rev (const pos_t &pos) |
Return true if a pos_t is on the reverse strand of its node. More... | |
off_t | offset (const pos_t &pos) |
Get the offset along the selected strand of the node from a pos_t. More... | |
id_t & | get_id (pos_t &pos) |
Get a reference to the Node ID of a pos_t. More... | |
bool & | get_is_rev (pos_t &pos) |
Get a reference to the reverse flag of a pos_t. More... | |
off_t & | get_offset (pos_t &pos) |
Get a reference to the offset field of a pos_t, which counts along the selected strand of the node. More... | |
bool | is_empty (const pos_t &pos) |
Return true if a pos_t is unset. More... | |
pos_t | reverse (const pos_t &pos, size_t node_length) |
pos_t | reverse_base_pos (const pos_t &pos, size_t node_length) |
Reverse a pos_t and get a pos_t at the same base, going the other direction. More... | |
std::ostream & | operator<< (std::ostream &out, const pos_t &pos) |
Print a pos_t to a stream. More... | |
char | reverse_complement (const char &c) |
string | reverse_complement (const string &seq) |
void | reverse_complement_in_place (string &seq) |
bool | is_all_n (const string &seq) |
int | get_thread_count (void) |
std::vector< std::string > & | split_delims (const std::string &s, const std::string &delims, std::vector< std::string > &elems) |
std::vector< std::string > | split_delims (const std::string &s, const std::string &delims) |
const std::string | sha1sum (const std::string &data) |
const std::string | sha1head (const std::string &data, size_t head) |
string | wrap_text (const string &str, size_t width) |
bool | is_number (const std::string &s) |
bool | allATGC (const string &s) |
bool | allATGCN (const string &s) |
string | nonATGCNtoN (const string &s) |
string | toUppercase (const string &s) |
void | write_fasta_sequence (const std::string &name, const std::string &sequence, ostream &os, size_t width) |
string | get_or_make_variant_id (const vcflib::Variant &variant) |
string | make_variant_id (const vcflib::Variant &variant) |
double | median (std::vector< int > &v) |
void | wellford_update (size_t &count, double &mean, double &M2, double new_val) |
pair< double, double > | wellford_mean_var (size_t count, double mean, double M2, bool sample_variance) |
vector< size_t > | range_vector (size_t begin, size_t end) |
bool | have_input_file (int &optind, int argc, char **argv) |
Return true if there's a command line argument (i.e. input file name) waiting to be processed. More... | |
void | get_input_file (int &optind, int argc, char **argv, function< void(istream &)> callback) |
string | get_input_file_name (int &optind, int argc, char **argv) |
string | get_output_file_name (int &optind, int argc, char **argv) |
void | get_input_file (const string &file_name, function< void(istream &)> callback) |
double | phi (double x1, double x2) |
double | normal_inverse_cdf (double quantile) |
Inverse CDF of a standard normal distribution. Must have 0 < quantile < 1. More... | |
void | create_ref_allele (vcflib::Variant &variant, const std::string &allele) |
int | add_alt_allele (vcflib::Variant &variant, const std::string &allele) |
double | slope (const std::vector< double > &x, const std::vector< double > &y) |
double | fit_zipf (const vector< double > &y) |
size_t | integer_power (uint64_t base, uint64_t exponent) |
Computes base^exponent in log(exponent) time. More... | |
size_t | modular_exponent (uint64_t base, uint64_t exponent, uint64_t modulus) |
default_random_engine | random_sequence_gen (102) |
string | random_sequence (size_t length) |
Returns a uniformly random DNA sequence of the given length. More... | |
string | replace_in_string (string subject, const string &search, const string &replace) |
string | percent_url_encode (const string &seq) |
Escape "%" to "%25". More... | |
unordered_map< id_t, pair< id_t, bool > > | overlay_node_translations (const unordered_map< id_t, pair< id_t, bool >> &over, const unordered_map< id_t, pair< id_t, bool >> &under) |
Compose the translations from two graph operations, both of which involved oriented transformations. More... | |
unordered_map< id_t, pair< id_t, bool > > | overlay_node_translations (const unordered_map< id_t, id_t > &over, const unordered_map< id_t, pair< id_t, bool >> &under) |
Compose the translations from two graph operations, the first of which involved oriented transformations. More... | |
unordered_map< id_t, pair< id_t, bool > > | overlay_node_translations (const unordered_map< id_t, pair< id_t, bool >> &over, const unordered_map< id_t, id_t > &under) |
Compose the translations from two graph operations, the second of which involved oriented transformations. More... | |
unordered_map< id_t, id_t > | overlay_node_translations (const unordered_map< id_t, id_t > &over, const unordered_map< id_t, id_t > &under) |
Compose the translations from two graph operations, neither of which involved oriented transformations. More... | |
template<> | |
bool | parse (const string &arg, double &dest) |
template<> | |
bool | parse (const string &arg, std::regex &dest) |
bool | is_number (const string &s) |
double | stdev (const std::vector< double > &v) |
template<typename T > | |
double | stdev (const T &v) |
double | add_log (double log_x, double log_y) |
double | subtract_log (double log_x, double log_y) |
double | ln_to_log10 (double ln) |
double | log10_to_ln (double l10) |
double | prob_to_logprob (double prob) |
double | logprob_to_prob (double logprob) |
double | logprob_add (double logprob1, double logprob2) |
double | logprob_invert (double logprob) |
double | phred_to_prob (int phred) |
double | prob_to_phred (double prob) |
double | phred_to_logprob (int phred) |
double | logprob_to_phred (double logprob) |
double | logprob_geometric_mean (double lnprob1, double lnprob2) |
double | phred_geometric_mean (double phred1, double phred2) |
template<typename T > | |
T | normal_pdf (T x, T m, T s) |
template<typename T , typename V > | |
set< T > | map_keys_to_set (const map< T, V > &m) |
template<typename T > | |
vector< T > | pmax (const std::vector< T > &a, const std::vector< T > &b) |
template<typename T > | |
vector< T > | vpmax (const std::vector< std::vector< T >> &vv) |
template<typename Collection > | |
Collection::value_type | sum (const Collection &collection) |
template<typename Collection > | |
Collection::value_type | logprob_sum (const Collection &collection) |
template<template< class T, class A=std::allocator< T >> class Container, typename Input , typename Output > | |
Container< Output > | map_over (const Container< Input > &in, const std::function< Output(const Input &)> &lambda) |
template<template< class T, class A=std::allocator< T >> class Container, typename Item > | |
Container< const Item * > | pointerfy (const Container< Item > &in) |
vector< size_t > | range_vector (size_t end) |
size_t | integer_power (size_t x, size_t power) |
template<class RandomIt > | |
void | deterministic_shuffle (RandomIt begin, RandomIt end, const uint32_t &seed) |
template<class RandomIt > | |
void | deterministic_shuffle (RandomIt begin, RandomIt end, const string &seed) |
string | make_shuffle_seed (const Alignment &aln) |
Make seeds for Alignments based on their sequences. More... | |
string | make_shuffle_seed (const Alignment *aln) |
Make seeds for Alignments based on their sequences. More... | |
string | make_shuffle_seed (const pair< Alignment, Alignment > *alns) |
Make seeds for pairs of Alignments based on their concatenated sequences. More... | |
template<class RandomIt > | |
void | deterministic_shuffle (RandomIt begin, RandomIt end) |
Do a deterministic shuffle with automatic seed determination. More... | |
template<class RandomIt , class Compare , class MakeSeed > | |
void | sort_shuffling_ties (RandomIt begin, RandomIt end, Compare comp, MakeSeed seed) |
template<class RandomIt , class Compare > | |
void | sort_shuffling_ties (RandomIt begin, RandomIt end, Compare comp) |
template<typename Result > | |
Result | parse (const string &arg) |
template<typename Result > | |
Result | parse (const char *arg) |
template<typename Result > | |
bool | parse (const string &arg, Result &dest) |
template<typename Result > | |
bool | parse (const string &arg, typename enable_if< sizeof(Result)<=sizeof(long long) &&is_integral< Result >::value &&is_signed< Result >::value, Result >::type &dest) |
void | genotype_svs (VG *graph, string gamfile, string refpath) |
void | variant_recall (VG *graph, vcflib::VariantCallFile *vars, FastaReference *ref_genome, vector< FastaReference * > insertions, string gamfile, bool isIndex) |
tuple< double, double, double > | hash_to_rgb (const string &str, double min_sum) |
size_t | wang_hash_64 (size_t key) |
template<typename Result > | |
bool | parse (const string &arg, typename enable_if< is_instantiation_of< Result, Range >::value, Result >::type &dest) |
Parse a range as start[:end[:step]]. More... | |
Variables | |
const char *const | BAM_DNA_LOOKUP = "=ACMGRSVTWYHKDBN" |
const char * | var = "VG_FULL_TRACEBACK" |
bool | fullTrace = false |
constexpr size_t | PRUNE_THREAD_BUFFER_SIZE = 1024 * 1024 |
using vg::benchtime = typedef chrono::nanoseconds |
We define a duration type for expressing benchmark times in.
Snarls are defined at the Protobuf level, but here is how we define chains as real objects.
A chain is a sequence of Snarls, in either normal (false) or reverse (true) orientation.
The SnarlManager is going to have one official copy of each chain stored, and it will give you a pointer to it on demand.
using vg::DeletableHandleGraph = typedef handlegraph::DeletableHandleGraph |
using vg::edge_t = typedef handlegraph::edge_t |
typedef std::map<id_t, std::vector<Edge*> > vg::EdgeMapping |
typedef vector<gbwt::node_type> vg::exon_nodes_t |
using vg::GAMIndex = typedef StreamIndex<Alignment> |
Define a GAM index as a stream index over a stream of Alignments.
using vg::GAMSorter = typedef StreamSorter<Alignment> |
typedef unordered_map<handle_t, int> vg::Handle2Component |
using vg::handle_t = typedef handlegraph::handle_t |
using vg::HandleGraph = typedef handlegraph::HandleGraph |
typedef unordered_set<handle_t> vg::HandleSet |
typedef handlegraph::nid_t vg::id_t |
Represents a Node ID. ID type is a 64-bit signed int.
using vg::MutableHandleGraph = typedef handlegraph::MutableHandleGraph |
using vg::MutablePathHandleGraph = typedef handlegraph::MutablePathHandleGraph |
using vg::nid_t = typedef handlegraph::nid_t |
using vg::path_handle_t = typedef handlegraph::path_handle_t |
using vg::PathHandleGraph = typedef handlegraph::PathHandleGraph |
using vg::PathPositionHandleGraph = typedef handlegraph::PathPositionHandleGraph |
using vg::real_t = typedef long double |
using vg::SerializableHandleGraph = typedef handlegraph::SerializableHandleGraph |
using vg::step_handle_t = typedef handlegraph::step_handle_t |
typedef vector<gbwt::size_type> vg::thread_ids_t |
using vg::thread_t = typedef vector<gbwt::node_type> |
using vg::VectorizableHandleGraph = typedef handlegraph::VectorizableHandleGraph |
enum vg::SnarlType |
int vg::add_alt_allele | ( | vcflib::Variant & | variant, |
const std::string & | allele | ||
) |
Add a new alt allele to a vcflib Variant, since apaprently there's no method for that already.
If that allele already exists in the variant, does not add it again.
Retuerns the allele number (0, 1, 2, etc.) corresponding to the given allele string in the given variant.
|
inline |
Path vg::add_nodes_and_edges | ( | MutableHandleGraph * | graph, |
const Path & | path, | ||
const map< pos_t, id_t > & | node_translation, | ||
unordered_map< pair< pos_t, string >, vector< id_t >> & | added_seqs, | ||
unordered_map< id_t, Path > & | added_nodes, | ||
const unordered_map< id_t, size_t > & | orig_node_sizes, | ||
set< NodeSide > & | dangling, | ||
size_t | max_node_size = 1024 |
||
) |
Given a path on nodes that may or may not exist, and a map from start position in the old graph to a node in the current graph, add all the new sequence and edges required by the path. The given path must not contain adjacent perfect match edits in the same mapping, or any deletions on the start or end of mappings (the removal of which can be accomplished with the Path::simplify() function).
Outputs (and caches for subsequent calls) novel node runs in added_seqs, and Paths describing where novel nodes translate back to in the original graph in added_nodes. Also needs a map of the original sizes of nodes deleted from the original graph, for reverse complementing. If dangling is nonempty, left edges of nodes created for initial inserts will connect to the specified sides. At the end, dangling is populated with the side corresponding to the last edit in the path.
Returns a fully embedded version of the path, after all node insertions, divisions, and translations.
Path vg::add_nodes_and_edges | ( | MutableHandleGraph * | graph, |
const Path & | path, | ||
const map< pos_t, id_t > & | node_translation, | ||
unordered_map< pair< pos_t, string >, vector< id_t >> & | added_seqs, | ||
unordered_map< id_t, Path > & | added_nodes, | ||
const unordered_map< id_t, size_t > & | orig_node_sizes, | ||
size_t | max_node_size | ||
) |
This version doesn't require a set of dangling sides to populate
path_handle_t vg::add_path_to_graph | ( | MutablePathHandleGraph * | graph, |
const Path & | path | ||
) |
Add a path to the graph. This is like VG::extend, and expects a path with no edits, and for all the nodes and edges in the path to exist exactly in the graph
void vg::add_thread_edges_to_set | ( | thread_t & | t, |
set< pair< int, int > > & | edges | ||
) |
void vg::add_thread_nodes_to_set | ( | thread_t & | t, |
set< int64_t > & | nodes | ||
) |
void vg::addArbitraryTelomerePair | ( | vector< stCactusEdgeEnd * > | ends, |
stList * | telomeres | ||
) |
Finds an arbitrary pair of telomeres in a Cactus graph, which are are either a pair of bridge edge ends or a pair of chain edge ends, oriented such that they form a pair of boundaries.
Mostly copied from the pinchesAndCacti unit tests.
bool vg::advance_split | ( | Iter | start, |
Iter | end | ||
) |
Given a split of items across a certain number of categories, as ints between the two given bidirectional iterators, advance to the next split and return true. If there is no next split, leave the collection unchanged and return false.
int vg::alignment_from_length | ( | const Alignment & | a | ) |
Alignment vg::alignment_from_path | ( | const HandleGraph & | graph, |
const Path & | path | ||
) |
bool vg::alignment_is_valid | ( | Alignment & | aln, |
const HandleGraph * | hgraph | ||
) |
check to make sure edits on the alignment's path don't assume incorrect node lengths or ids
void vg::alignment_quality_char_to_short | ( | Alignment & | alignment | ) |
void vg::alignment_quality_short_to_char | ( | Alignment & | alignment | ) |
map< string,vector< pair< size_t, bool > > > vg::alignment_refpos_to_path_offsets | ( | const Alignment & | aln | ) |
return the path offsets as cached in the alignment
annotate the first alignment with its minimum distance to the second in their annotated paths
void vg::alignment_set_distance_to_correct | ( | Alignment & | aln, |
const map< string, vector< pair< size_t, bool > > > & | base_offsets | ||
) |
bam1_t * vg::alignment_to_bam | ( | const string & | sam_header, |
const Alignment & | alignment, | ||
const string & | refseq, | ||
const int32_t | refpos, | ||
const bool | refrev, | ||
const vector< pair< int, char >> & | cigar | ||
) |
Convert an unpaired Alignment to a BAM record. If the alignment is unmapped, refpos must be -1. Otherwise, refpos must be the position on the reference sequence to which the alignment is aligned. Similarly, refseq must be the sequence aligned to, or "" if unaligned.
Remember to clean up with bam_destroy1(b);
bam1_t * vg::alignment_to_bam | ( | const string & | sam_header, |
const Alignment & | alignment, | ||
const string & | refseq, | ||
const int32_t | refpos, | ||
const bool | refrev, | ||
const vector< pair< int, char >> & | cigar, | ||
const string & | mateseq, | ||
const int32_t | matepos, | ||
bool | materev, | ||
const int32_t | tlen, | ||
const int32_t | tlen_max = 0 |
||
) |
Convert a paired Alignment to a BAM record. If the alignment is unmapped, refpos must be -1. Otherwise, refpos must be the position on the reference sequence to which the alignment is aligned. Similarly, refseq must be the sequence aligned to, or "" if unaligned. The mateseq and matepos fields must be set similarly for the mate. Note that mateseq must not be "=". If tlen_max is given, it is a limit on the magnitude of tlen to consider the read properly paired.
Remember to clean up with bam_destroy1(b);
bam1_t* vg::alignment_to_bam_internal | ( | const string & | sam_header, |
const Alignment & | alignment, | ||
const string & | refseq, | ||
const int32_t | refpos, | ||
const bool | refrev, | ||
const vector< pair< int, char >> & | cigar, | ||
const string & | mateseq, | ||
const int32_t | matepos, | ||
bool | materev, | ||
const int32_t | tlen, | ||
bool | paired, | ||
const int32_t | tlen_max | ||
) |
int vg::alignment_to_length | ( | const Alignment & | a | ) |
string vg::alignment_to_sam | ( | const Alignment & | alignment, |
const string & | refseq, | ||
const int32_t | refpos, | ||
const bool | refrev, | ||
const vector< pair< int, char >> & | cigar | ||
) |
Convert an unpaired Alignment to a SAM record. If the alignment is unmapped, refpos must be -1. Otherwise, refpos must be the position on the reference sequence to which the alignment is aligned. Similarly, refseq must be the sequence aligned to, or "" if unaligned.
string vg::alignment_to_sam | ( | const Alignment & | alignment, |
const string & | refseq, | ||
const int32_t | refpos, | ||
const bool | refrev, | ||
const vector< pair< int, char >> & | cigar, | ||
const string & | mateseq, | ||
const int32_t | matepos, | ||
bool | materev, | ||
const int32_t | tlen, | ||
const int32_t | tlen_max = 0 |
||
) |
Convert a paired Alignment to a SAM record. If the alignment is unmapped, refpos must be -1. Otherwise, refpos must be the position on the reference sequence to which the alignment is aligned. Similarly, refseq must be the sequence aligned to, or "" if unaligned. The mateseq and matepos fields must be set similarly for the mate. Note that mateseq must not be "=". If tlen_max is given, it is a limit on the magnitude of tlen to consider the read properly paired.
string vg::alignment_to_sam_internal | ( | const Alignment & | alignment, |
const string & | refseq, | ||
const int32_t | refpos, | ||
const bool | refrev, | ||
const vector< pair< int, char >> & | cigar, | ||
const string & | mateseq, | ||
const int32_t | matepos, | ||
bool | materev, | ||
const int32_t | tlen, | ||
bool | paired, | ||
const int32_t | tlen_max | ||
) |
bool vg::allATGC | ( | const string & | s | ) |
bool vg::allATGCN | ( | const string & | s | ) |
Turn the given path into an allele. Drops the first and last mappings and looks up the sequences for the nodes of the others.
void vg::augment | ( | MutablePathMutableHandleGraph * | graph, |
istream & | gam_stream, | ||
vector< Translation > * | out_translation = nullptr , |
||
ostream * | gam_out_stream = nullptr , |
||
bool | embed_paths = false , |
||
bool | break_at_ends = false , |
||
bool | remove_soft_clips = false , |
||
bool | filter_out_of_graph_alignments = false , |
||
double | min_baseq = 0 , |
||
double | min_mapq = 0 , |
||
Packer * | packer = nullptr , |
||
size_t | min_bp_coverage = 0 |
||
) |
Edit the graph to include all the sequence and edges added by the given paths. Can handle paths that visit nodes in any orientation. Note that this method sorts the graph and rebuilds the path index, so it should not be called in a loop.
If gam_out_stream is not null, the paths will be modified to reflect their embedding in the modified graph and written to the stream. If out_translation is not null, a list of translations, one per node existing after the edit, describing how each new or conserved node is embedded in the old graph. if embed_paths is true, then the augmented alignemnents will be saved as embededed paths in the graph in order to add it back to the graph. If break_at_ends is true, nodes will be broken at the ends of paths that start/end woth perfect matches, so the paths can be added to the vg graph's paths object. If soft_clip is true, soft clips will be removed from the input paths before processing, and the dangling ends won't end up in the graph If filter_out_of_graph_alignments is true, some extra time will be taken to check if all nodes in the alignment are in the graph. If they aren't, then it will be ignored If an edit sequence's avg base quality is less than min_baseq it will be ignored (considered a match) If an alignment's mapping quality
void vg::augment | ( | MutablePathMutableHandleGraph * | graph, |
vector< Path > & | path_vector, | ||
vector< Translation > * | out_translation = nullptr , |
||
ostream * | gam_out_stream = nullptr , |
||
bool | embed_paths = false , |
||
bool | break_at_ends = false , |
||
bool | remove_soft_clips = false , |
||
bool | filter_out_of_graph_alignments = false , |
||
double | min_baseq = 0 , |
||
double | min_mapq = 0 , |
||
Packer * | packer = nullptr , |
||
size_t | min_bp_coverage = 0 |
||
) |
Like above, but operates on a vector of Alignments, instead of a stream (Note: It is best to use stream interface for large numbers of alignments to save memory)
void vg::augment_impl | ( | MutablePathMutableHandleGraph * | graph, |
function< void(function< void(Alignment &)> | , | ||
bool | , | ||
bool | |||
) |
Generic version used to implement the above two methods.
const vector< string > vg::balanced_kmers | ( | const string & | seq, |
const int | kmer_size, | ||
const int | stride | ||
) |
const int vg::balanced_stride | ( | int | read_length, |
int | kmer_size, | ||
int | stride | ||
) |
Alignment vg::bam_to_alignment | ( | const bam1_t * | b, |
map< string, string > & | rg_sample | ||
) |
Alignment vg::bam_to_alignment | ( | const bam1_t * | b, |
map< string, string > & | rg_sample, | ||
const bam_hdr_t * | bh, | ||
const PathPositionHandleGraph * | graph | ||
) |
void vg::benchmark_control | ( | ) |
The benchmark control function, designed to take some amount of time that might vary with CPU load.
real_t vg::binomial_cmf_ln | ( | ProbIn | success_logprob, |
size_t | trials, | ||
size_t | successes | ||
) |
Compute the probability of having the given number of successes or fewer in the given number of trials, with the given success probability. Returns the resulting log probability.
void vg::build_gcsa_lcp | ( | const HandleGraph & | graph, |
gcsa::GCSA *& | gcsa, | ||
gcsa::LCPArray *& | lcp, | ||
int | kmer_size, | ||
size_t | doubling_steps, | ||
size_t | size_limit, | ||
const string & | base_file_name | ||
) |
VG vg::cactus_to_vg | ( | stCactusGraph * | cactus_graph | ) |
PhaseUnfolder::path_type vg::canonical_orientation | ( | const PhaseUnfolder::path_type & | path, |
bool & | from_border, | ||
bool & | to_border | ||
) |
ChainIterator vg::chain_begin | ( | const Chain & | chain | ) |
We define free functions for getting iterators forward and backward through chains.
ChainIterator vg::chain_begin_from | ( | const Chain & | chain, |
const Snarl * | start_snarl, | ||
bool | snarl_orientation | ||
) |
We also define a function for getting the ChainIterator (forward or reverse complement) for a chain starting with a given snarl in the given inward orientation. Only works for bounding snarls of the chain.
ChainIterator vg::chain_end | ( | const Chain & | chain | ) |
ChainIterator vg::chain_end_from | ( | const Chain & | chain, |
const Snarl * | start_snarl, | ||
bool | snarl_orientation | ||
) |
And the end iterator for the chain (forward or reverse complement) viewed from a given snarl in the given inward orientation. Only works for bounding snarls of the chain, and should be the same bounding snarl as was used for chain_begin_from.
ChainIterator vg::chain_rbegin | ( | const Chain & | chain | ) |
ChainIterator vg::chain_rcbegin | ( | const Chain & | chain | ) |
We also define some reverse complement iterators, which go from right to left through the chains, but give us the reverse view. For ecample, if all the snarls are oriented forward in the chain, we will iterate through the snarls in reverse order, with each individual snarl also reversed.
ChainIterator vg::chain_rcend | ( | const Chain & | chain | ) |
ChainIterator vg::chain_rend | ( | const Chain & | chain | ) |
|
inline |
Compute the number of ways to select k items from a collection of n distinguishable items, ignoring order. Returns the natural log of the (integer) result.
vector< pair< int, char > > vg::cigar_against_path | ( | const Alignment & | alignment, |
bool | on_reverse_strand, | ||
int64_t & | pos, | ||
size_t | path_len, | ||
size_t | softclip_suppress | ||
) |
Create a CIGAR from the given Alignment. If softclip_suppress is nonzero, suppress softclips up to that length. This will necessitate adjusting pos, which is why it is passed by reference.
void vg::cigar_mapping | ( | const bam1_t * | b, |
Mapping & | mapping | ||
) |
int64_t vg::cigar_mapping | ( | const bam1_t * | b, |
Mapping * | mapping | ||
) |
string vg::cigar_string | ( | const vector< pair< int, char > > & | cigar | ) |
|
inline |
Clear the annotation with the given name.
|
inline |
Clear the annotation with the given name.
vector< string::const_iterator > vg::cluster_cover | ( | const vector< MaximalExactMatch > & | cluster | ) |
int vg::cluster_coverage | ( | const vector< MaximalExactMatch > & | cluster | ) |
vector< pos_t > vg::cluster_nodes | ( | const vector< MaximalExactMatch > & | cluster | ) |
bdsg::HashGraph vg::cluster_subgraph_containing | ( | const HandleGraph & | base, |
const Alignment & | aln, | ||
const vector< vg::MaximalExactMatch > & | cluster, | ||
const GSSWAligner * | aligner | ||
) |
return a containing subgraph connecting the mems
bdsg::HashGraph vg::cluster_subgraph_walk | ( | const HandleGraph & | base, |
const Alignment & | aln, | ||
const vector< vg::MaximalExactMatch > & | mems, | ||
double | expansion | ||
) |
return a subgraph for a cluster of MEMs from the given alignment use walking to get the hits
bool vg::clusters_overlap_in_graph | ( | const vector< MaximalExactMatch > & | cluster1, |
const vector< MaximalExactMatch > & | cluster2 | ||
) |
bool vg::clusters_overlap_in_read | ( | const vector< MaximalExactMatch > & | cluster1, |
const vector< MaximalExactMatch > & | cluster2 | ||
) |
int vg::clusters_overlap_length | ( | const vector< MaximalExactMatch > & | cluster1, |
const vector< MaximalExactMatch > & | cluster2 | ||
) |
pair< int32_t, int32_t > vg::compute_template_lengths | ( | const int64_t & | pos1, |
const vector< pair< int, char >> & | cigar1, | ||
const int64_t & | pos2, | ||
const vector< pair< int, char >> & | cigar2 | ||
) |
Work out the TLEN values for two reads. The magnitude is the distance between the outermost aligned bases, and the sign is positive for the leftmost read and negative for the rightmost.
vector< vector< int64_t > > vg::connected_components | ( | const MultipathAlignment & | multipath_aln | ) |
Returns a vector whose elements are vectors with the indexes of the Subpaths in each connected component. An unmapped MultipathAlignment with no subpaths produces an empty vector.
void vg::construct_graph_from_nodes_and_edges | ( | Graph & | g, |
const HandleGraph & | source, | ||
set< int64_t > & | nodes, | ||
set< pair< int, int > > & | edges | ||
) |
bool vg::convert | ( | const std::string & | s, |
T & | r | ||
) |
std::string vg::convert | ( | const T & | r | ) |
void vg::convert_handle_graph | ( | const HandleGraph * | converting, |
MutableHandleGraph * | converted | ||
) |
Takes in a pointer to a HandleGraph and copies it into an empty MutableHandleGraph graph.
void vg::convert_path_handle_graph | ( | const PathHandleGraph * | converting, |
MutablePathMutableHandleGraph * | converted | ||
) |
Takes in a pointer to a PathHandleGraph and copies it, inclding paths, into an empty MutablePathMutableHandleGraph graph.
void vg::create_ref_allele | ( | vcflib::Variant & | variant, |
const std::string & | allele | ||
) |
Create the reference allele for an empty vcflib Variant, since apaprently there's no method for that already. Must be called before any alt alleles are added.
void vg::decompose | ( | const Path & | path, |
map< pos_t, int > & | ref_positions, | ||
map< pos_t, Edit > & | edits | ||
) |
void vg::deterministic_shuffle | ( | RandomIt | begin, |
RandomIt | end | ||
) |
Do a deterministic shuffle with automatic seed determination.
void vg::deterministic_shuffle | ( | RandomIt | begin, |
RandomIt | end, | ||
const string & | seed | ||
) |
Given a pair of random access iterators defining a range, deterministically shuffle the contents of the range based on the given string seed.
void vg::deterministic_shuffle | ( | RandomIt | begin, |
RandomIt | end, | ||
const uint32_t & | seed | ||
) |
Given a pair of random access iterators defining a range, deterministically shuffle the contents of the range based on the given integer seed.
double vg::divergence | ( | const Mapping & | m | ) |
int vg::edit_count | ( | const Alignment & | alignment | ) |
bool vg::edit_is_deletion | ( | const Edit & | e | ) |
bool vg::edit_is_empty | ( | const Edit & | e | ) |
bool vg::edit_is_insertion | ( | const Edit & | e | ) |
bool vg::edit_is_match | ( | const Edit & | e | ) |
bool vg::edit_is_sub | ( | const Edit & | e | ) |
void vg::emit_stacktrace | ( | int | signalNumber, |
siginfo_t * | signalInfo, | ||
void * | signalContext | ||
) |
Emit a stack trace when something bad happens. Add as a signal handler with sigaction.
void vg::enable_crash_handling | ( | ) |
Main should call this to turn on our stack tracing support.
gcsa::byte_type vg::encode_chars | ( | const vector< char > & | chars, |
const gcsa::Alphabet & | alpha | ||
) |
Encode the chars into the gcsa2 byte.
bool vg::end_backward | ( | const Chain & | chain | ) |
Return true if the last snarl in the given chain is backward relative to the chain.
map< pos_t, id_t > vg::ensure_breakpoints | ( | MutableHandleGraph * | graph, |
const unordered_map< id_t, set< pos_t >> & | breakpoints | ||
) |
Take a map from node ID to a set of offsets at which new nodes should start (which may include 0 and 1-past-the-end, which should be ignored), break the specified nodes at those positions. Returns a map from old node start position to new node pointer in the graph. Note that the caller will have to crear and rebuild path rank data.
Returns a map from old node start position to new node. This map contains some entries pointing to null, for positions past the ends of original nodes. It also maps from positions on either strand of the old node to the same new node pointer; the new node's forward strand is always the same as the old node's forward strand.
double vg::entropy | ( | const char * | st, |
size_t | len | ||
) |
double vg::entropy | ( | const string & | st | ) |
void vg::extract_sub_multipath_alignment | ( | const MultipathAlignment & | multipath_aln, |
const vector< int64_t > & | subpath_indexes, | ||
MultipathAlignment & | sub_multipath_aln | ||
) |
Extract the MultipathAlignment consisting of the Subpaths with the given indexes into a new MultipathAlignment object
|
inline |
Calculate the natural log of the factorial of the given integer. TODO: replace with a cache or giant lookup table from Freebayes.
int vg::fastq_for_each | ( | string & | filename, |
function< void(Alignment &)> | lambda | ||
) |
size_t vg::fastq_paired_interleaved_for_each | ( | const string & | filename, |
function< void(Alignment &, Alignment &)> | lambda | ||
) |
size_t vg::fastq_paired_interleaved_for_each_parallel | ( | const string & | filename, |
function< void(Alignment &, Alignment &)> | lambda | ||
) |
size_t vg::fastq_paired_interleaved_for_each_parallel_after_wait | ( | const string & | filename, |
function< void(Alignment &, Alignment &)> | lambda, | ||
function< bool(void)> | single_threaded_until_true | ||
) |
size_t vg::fastq_paired_two_files_for_each | ( | const string & | file1, |
const string & | file2, | ||
function< void(Alignment &, Alignment &)> | lambda | ||
) |
size_t vg::fastq_paired_two_files_for_each_parallel | ( | const string & | file1, |
const string & | file2, | ||
function< void(Alignment &, Alignment &)> | lambda | ||
) |
size_t vg::fastq_paired_two_files_for_each_parallel_after_wait | ( | const string & | file1, |
const string & | file2, | ||
function< void(Alignment &, Alignment &)> | lambda, | ||
function< bool(void)> | single_threaded_until_true | ||
) |
size_t vg::fastq_unpaired_for_each | ( | const string & | filename, |
function< void(Alignment &)> | lambda | ||
) |
size_t vg::fastq_unpaired_for_each_parallel | ( | const string & | filename, |
function< void(Alignment &)> | lambda | ||
) |
unordered_map< id_t, set< pos_t > > vg::filter_breakpoints_by_coverage | ( | const Packer & | packed_breakpoints, |
size_t | min_bp_coverage | ||
) |
Filters the breakpoints by coverage, and converts them back from the Packer to the STL map expected by following methods
void vg::find_breakpoints | ( | const Path & | path, |
unordered_map< id_t, set< pos_t >> & | breakpoints, | ||
bool | break_ends = true , |
||
const string & | base_quals = "" , |
||
double | min_baseq = 0 |
||
) |
Find all the points at which a Path enters or leaves nodes in the graph. Adds them to the given map by node ID of sets of bases in the node that will need to become the starts of new nodes.
If break_ends is true, emits breakpoints at the ends of the path, even if it starts/ends with perfect matches. Find all the points at which a Path enters or leaves nodes in the graph. Adds them to the given map by node ID of sets of bases in the node that will need to become the starts of new nodes.
If break_ends is true, emits breakpoints at the ends of the path, even if it starts/ends with perfect matches.
pair_hash_set< edge_t > vg::find_edges_to_prune | ( | const HandleGraph & | graph, |
size_t | k, | ||
size_t | edge_max | ||
) |
Iterate over all the walks up to length k, adding edges which.
void vg::find_mismatches | ( | const std::string & | seq, |
const gbwtgraph::GBWTGraph & | graph, | ||
std::vector< GaplessExtension > & | result | ||
) |
void vg::find_packed_breakpoints | ( | const Path & | path, |
Packer & | packed_breakpoints, | ||
bool | break_ends, | ||
const string & | base_quals, | ||
double | min_baseq | ||
) |
Like "find_breakpoints", but store in packed structure (better for large gams and enables coverage filter)
double vg::fit_zipf | ( | const vector< double > & | y | ) |
void vg::flip_doubly_reversed_edges | ( | Graph & | graph | ) |
clean up doubly-reversed edges
void vg::flip_nodes | ( | Alignment & | a, |
const set< int64_t > & | ids, | ||
const std::function< size_t(int64_t)> & | node_length | ||
) |
void vg::for_each_kmer | ( | const HandleGraph & | graph, |
size_t | k, | ||
const function< void(const kmer_t &)> & | lambda, | ||
id_t | head_id, | ||
id_t | tail_id | ||
) |
Iterate over all the kmers in the graph, running lambda on each.
unordered_map< id_t, set< pos_t > > vg::forwardize_breakpoints | ( | const HandleGraph * | graph, |
const unordered_map< id_t, set< pos_t >> & | breakpoints | ||
) |
Flips the breakpoints onto the forward strand.
void vg::from_handle_graph | ( | const HandleGraph & | from, |
Graph & | to | ||
) |
int vg::from_length | ( | const Mapping & | m | ) |
void vg::from_path_handle_graph | ( | const PathHandleGraph & | from, |
Graph & | to | ||
) |
Calculate the natural log of the gamma function of the given argument.
|
inline |
Convert gbwt::node_type to handle_t.
|
inline |
Convert gbwt::node_type and an offset as size_t to pos_t.
set< pos_t > vg::gcsa_nodes_to_positions | ( | const vector< gcsa::node_type > & | nodes | ) |
void vg::genotype_svs | ( | VG * | graph, |
string | gamfile, | ||
string | refpath | ||
) |
Takes a graph and two GAMs, one tumor and one normal Locates existing variation supported by the tumor and annotate it with a path Then overlay the normal sample Use a depthmap of snarltraversal transforms, one for tumor, one for normal which we can use to count the normal and tumor alleles void somatic_genotyper(VG* graph, string tumorgam, string normalgam);
Do smart augment, maintaining a depth map for tumor/normal perfect matches and then editing in all of the SV reads (after normalization) with a T/N_ prefix Then, get our Snarls count reads supporting each and genotype void somatic_caller_genotyper(VG* graph, string tumorgam, string normalgam);
real_t vg::geometric_sampling_prob_ln | ( | ProbIn | success_logprob, |
size_t | trials | ||
) |
Get the log probability for sampling the given value from a geometric distribution with the given success log probability. The geometric distribution is the distribution of the number of trials, with a given success probability, required to observe a single success.
unique_ptr< AlignmentEmitter > vg::get_alignment_emitter | ( | const string & | filename, |
const string & | format, | ||
const map< string, int64_t > & | path_length, | ||
size_t | max_threads | ||
) |
Get an AlignmentEmitter that can emit to the given file (or "-") in the given format. A table of contig lengths is required for HTSlib formats. Automatically applies per-thread buffering, but needs to know how many OMP threads will be in use.
|
inline |
Get the annotation with the given name and return it. If not present, returns the Protobuf default value for the annotation type. The value may be a primitive type or an entire Protobuf object. It is undefined behavior to read a value out into a different type than it was stored with.
|
inline |
Get the annotation with the given name and return it. If not present, returns the Protobuf default value for the annotation type. The value may be a primitive type or an entire Protobuf object. It is undefined behavior to read a value out into a different type than it was stored with.
double vg::get_avg_baseq | ( | const Edit & | edit, |
const string & | base_quals, | ||
size_t | position_in_read | ||
) |
Compute the average base quality of an edit. If the edit has no sequence or there are no base_quals given, then double_max is returned.
size_t vg::get_current_vmem_kb | ( | ) |
Get the current virtual memory size, in kb, or 0 if unsupported.
gbwt::GBWT vg::get_gbwt | ( | const std::vector< gbwt::vector_type > & | paths | ) |
Transform the paths into a GBWT index. Primarily for testing.
void vg::get_input_file | ( | const string & | file_name, |
function< void(istream &)> | callback | ||
) |
Get a callback with an istream& to an open file. Handles "-" as a filename as indicating standard input. The reference passed is guaranteed to be valid only until the callback returns.
void vg::get_input_file | ( | int & | optind, |
int | argc, | ||
char ** | argv, | ||
function< void(istream &)> | callback | ||
) |
Get a callback with an istream& to an open file if a file name argument is present after the parsed options, or print an error message and exit if one is not. Handles "-" as a filename as indicating standard input. The reference passed is guaranteed to be valid only until the callback returns. Bumps up optind to the next argument if a filename is found.
string vg::get_input_file_name | ( | int & | optind, |
int | argc, | ||
char ** | argv | ||
) |
Parse out the name of an input file (i.e. the next positional argument), or throw an error. File name must be nonempty, but may be "-" or may not exist.
|
inline |
Get a reference to the reverse flag of a pos_t.
size_t vg::get_max_rss_kb | ( | ) |
Get the max RSS usage ever, in kb, or 0 if unsupported.
size_t vg::get_max_vmem_kb | ( | ) |
Get the max virtual memory size ever, in kb, or 0 if unsupported.
bool vg::get_next_alignment_from_fastq | ( | gzFile | fp, |
char * | buffer, | ||
size_t | len, | ||
Alignment & | alignment | ||
) |
bool vg::get_next_alignment_pair_from_fastqs | ( | gzFile | fp1, |
gzFile | fp2, | ||
char * | buffer, | ||
size_t | len, | ||
Alignment & | mate1, | ||
Alignment & | mate2 | ||
) |
bool vg::get_next_interleaved_alignment_pair_from_fastq | ( | gzFile | fp, |
char * | buffer, | ||
size_t | len, | ||
Alignment & | mate1, | ||
Alignment & | mate2 | ||
) |
Get a reference to the offset field of a pos_t, which counts along the selected strand of the node.
string vg::get_or_make_variant_id | ( | const vcflib::Variant & | variant | ) |
string vg::get_output_file_name | ( | int & | optind, |
int | argc, | ||
char ** | argv | ||
) |
Parse out the name of an output file (i.e. the next positional argument), or throw an error. File name must be nonempty.
string vg::get_proc_status_value | ( | const string & | name | ) |
Get the string value for a field in /proc/self/status by name, or "" if unsupported or not found.
int vg::get_thread_count | ( | void | ) |
Return the number of threads that OMP will produce for a parallel section. TODO: Assumes that this is the same for every parallel section.
SnarlTraversal vg::get_traversal_of_snarl | ( | VG & | graph, |
const Snarl * | snarl, | ||
const SnarlManager & | manager, | ||
const Path & | path | ||
) |
Given a path (which may run either direction through a snarl, or not touch the ends at all), collect a list of NodeTraversals in order for the part of the path that is inside the snarl, in the same orientation as the path.
void vg::getReachableBridges | ( | stCactusEdgeEnd * | edgeEnd1, |
stList * | bridgeEnds | ||
) |
Get the bridge ends that form boundary pairs with edgeEnd1. Duplicated from the pinchesAndCacti tests.
void vg::getReachableBridges2 | ( | stCactusEdgeEnd * | edgeEnd1, |
stHash * | bridgeEndsToBridgeNodes, | ||
stList * | bridgeEnds | ||
) |
Get the bridge ends that form boundary pairs with edgeEnd1, using the given getBridgeEdgeEndsToBridgeNodes hash map. Duplicated from the pinchesAndCacti tests.
bool vg::gfa_to_graph | ( | istream & | in, |
VG * | graph, | ||
bool | only_perfect_match = false |
||
) |
Import the given GFA file into the given (empty) VG. If only_perfect_match is set, only completely-M-operation CIGARs of length <= node length for edge overlaps will be used, and sequence differences will be resolved arbitrarily. Otherwise, CIGAR strings will be respected, files containing alingments using more bases than the sequences will be rejected, and mismatches in CIGAR-M sequences will form bubbles.
Returns true if the import was successful. Returns false if the import failed because the GFA file is invalid. Throws an error if the import failed because of an apparent bug in the import code, or if the GFA tries to do something that might be technically valid but which we don't know how to interpret.
void vg::graph_to_gfa | ( | const VG * | graph, |
ostream & | out | ||
) |
Export the given VG graph to the given GFA file.
pair< stCactusGraph *, stList * > vg::handle_graph_to_cactus | ( | const PathHandleGraph & | graph, |
const unordered_set< string > & | hint_paths, | ||
bool | single_component | ||
) |
|
inline |
Convert handle_t to gbwt::node_type.
vector< Alignment > vg::haplotype_consistent_alignments | ( | const MultipathAlignment & | multipath_aln, |
const haplo::ScoreProvider & | score_provider, | ||
size_t | soft_count, | ||
size_t | hard_count, | ||
bool | optimal_first = false |
||
) |
Finds all alignments consistent with haplotypes available by incremental search with the given haplotype score provider. Pads to a certain count with haplotype-inconsistent alignments that are population-scorable (i.e. use only edges used by some haplotype in the index), and then with unscorable alignments if scorable ones are unavailable. This may result in an empty vector.
Output Alignments may not be unique. The input MultipathAlignment may have exponentially many ways to spell the same Alignment, and we will look at all of them. We also may have duplicates of the optimal alignment if we are asked to produce it unconsitionally.
Note: Assumes that each subpath's Path object uses one Mapping per node and that start subpaths have been identified
Args: multipath_aln multipath alignment to find optimal paths through score_provider a haplo::ScoreProvider that supports incremental search over its haplotype database (such as a GBWTScoreProvider) soft_count maximum number of haplotype-inconsistent alignments to pad to hard_count maximum number of alignments, including haplotype-consistent (0 if no limit) optimal_first always compute and return first the optimal alignment, even if not haplotype-consistent
bool vg::has_inversion | ( | const Graph & | graph | ) |
returns true if we find an edge that may specify an inversion
const string vg::hash_alignment | ( | const Alignment & | aln | ) |
tuple< double, double, double > vg::hash_to_rgb | ( | const string & | str, |
double | min_sum | ||
) |
bool vg::have_input_file | ( | int & | optind, |
int | argc, | ||
char ** | argv | ||
) |
Return true if there's a command line argument (i.e. input file name) waiting to be processed.
bam_hdr_t * vg::hts_file_header | ( | string & | filename, |
string & | header | ||
) |
int vg::hts_for_each | ( | string & | filename, |
function< void(Alignment &)> | lambda | ||
) |
int vg::hts_for_each | ( | string & | filename, |
function< void(Alignment &)> | lambda, | ||
const PathPositionHandleGraph * | graph | ||
) |
int vg::hts_for_each_parallel | ( | string & | filename, |
function< void(Alignment &)> | lambda | ||
) |
int vg::hts_for_each_parallel | ( | string & | filename, |
function< void(Alignment &)> | lambda, | ||
const PathPositionHandleGraph * | graph | ||
) |
bam_hdr_t * vg::hts_string_header | ( | string & | header, |
map< string, int64_t > & | path_length, | ||
map< string, string > & | rg_sample | ||
) |
void vg::identify_start_subpaths | ( | MultipathAlignment & | multipath_aln | ) |
Finds the start subpaths (i.e. the source nodes of the multipath DAG) and stores them in the 'start' field of the MultipathAlignment
double vg::identity | ( | const Path & | path | ) |
void vg::in_place_subvector | ( | std::vector< Element > & | vec, |
size_t | head, | ||
size_t | tail | ||
) |
void vg::index_positions | ( | VG & | graph, |
map< long, Node * > & | node_path, | ||
map< long, Edge * > & | edge_path | ||
) |
size_t vg::integer_power | ( | size_t | x, |
size_t | power | ||
) |
size_t vg::integer_power | ( | uint64_t | base, |
uint64_t | exponent | ||
) |
Computes base^exponent in log(exponent) time.
size_t vg::interval_length | ( | std::pair< size_t, size_t > | interval | ) |
bool vg::is_all_n | ( | const string & | seq | ) |
Return True if the given string is entirely Ns of either case, and false otherwise.
|
inline |
Return true if a pos_t is unset.
bool vg::is_id_sortable | ( | const Graph & | graph | ) |
returns true if the graph is id-sortable (no reverse links)
bool vg::is_match | ( | const Translation & | translation | ) |
bool vg::is_number | ( | const std::string & | s | ) |
bool vg::is_number | ( | const string & | s | ) |
|
inline |
Return true if a pos_t is on the reverse strand of its node.
void vg::kmer_to_gcsa_kmers | ( | const kmer_t & | kmer, |
const gcsa::Alphabet & | alpha, | ||
const function< void(const gcsa::KMer &)> & | lambda | ||
) |
Convert the kmer_t to a set of gcsa2 binary kmers which are exposed via a callback.
vector< pair< thread_t, int > > vg::list_haplotypes | ( | const HandleGraph & | source, |
const gbwt::GBWT & | haplotype_database, | ||
gbwt::node_type | start_node, | ||
int | extend_distance | ||
) |
|
inline |
Convert a number ln to the same number log 10.
|
inline |
Convert a number log 10 to the same number ln.
|
inline |
|
inline |
|
inline |
Collection::value_type vg::logprob_sum | ( | const Collection & | collection | ) |
Compute the sum of the values in a collection, where the values are log probabilities and the result is the log of the total probability. Items must be convertible to/from doubles for math.
|
inline |
|
inline |
pos_t vg::make_pos_t | ( | gcsa::node_type | node | ) |
Create a pos_t from a gcsa node.
Create a pos_t from a Node ID, an orientation flag, and an offset along that strand of the node.
|
inline |
Make seeds for Alignments based on their sequences.
|
inline |
Make seeds for Alignments based on their sequences.
Make seeds for pairs of Alignments based on their concatenated sequences.
Support vg::make_support | ( | double | forward, |
double | reverse, | ||
double | quality | ||
) |
TBD Create a Support for the given forward and reverse coverage and quality.
vector< Translation > vg::make_translation | ( | const HandleGraph * | graph, |
const map< pos_t, id_t > & | node_translation, | ||
const unordered_map< id_t, Path > & | added_nodes, | ||
const unordered_map< id_t, size_t > & | orig_node_sizes | ||
) |
Produce a graph Translation object from information about the editing process.
string vg::make_variant_id | ( | const vcflib::Variant & | variant | ) |
set<T> vg::map_keys_to_set | ( | const map< T, V > & | m | ) |
Container<Output> vg::map_over | ( | const Container< Input > & | in, |
const std::function< Output(const Input &)> & | lambda | ||
) |
We have a transforming map function that we can chain.
void vg::mapping_against_path | ( | Alignment & | alignment, |
const bam1_t * | b, | ||
char * | chr, | ||
const PathPositionHandleGraph * | graph, | ||
bool | on_reverse_strand | ||
) |
void vg::mapping_against_path | ( | Alignment & | alignment, |
const bam1_t * | b, | ||
const PathPositionHandleGraph * | graph, | ||
bool | on_reverse_strand | ||
) |
void vg::mapping_cigar | ( | const Mapping & | mapping, |
vector< pair< int, char > > & | cigar | ||
) |
void vg::mapping_cigar | ( | const Mapping & | mapping, |
vector< pair< int, char >> & | cigar | ||
) |
bool vg::mapping_ends_in_deletion | ( | const Mapping & | m | ) |
int vg::mapping_from_length | ( | const Mapping & | m | ) |
bool vg::mapping_is_match | ( | const Mapping & | m | ) |
bool vg::mapping_is_simple_match | ( | const Mapping & | m | ) |
bool vg::mapping_is_total_deletion | ( | const Mapping & | m | ) |
const string vg::mapping_sequence | ( | const Mapping & | mp, |
const string & | node_seq | ||
) |
bool vg::mapping_starts_in_deletion | ( | const Mapping & | m | ) |
string vg::mapping_string | ( | const string & | source, |
const Mapping & | mapping | ||
) |
|
inline |
Convert Mapping to gbwt::node_type.
int vg::mapping_to_length | ( | const Mapping & | m | ) |
void vg::match_backward | ( | GaplessExtension & | match, |
const std::string & | seq, | ||
gbwtgraph::GBWTGraph::view_type | target, | ||
uint32_t | mismatch_limit, | ||
const Aligner * | aligner | ||
) |
size_t vg::match_forward | ( | GaplessExtension & | match, |
const std::string & | seq, | ||
gbwtgraph::GBWTGraph::view_type | target, | ||
uint32_t | mismatch_limit, | ||
const Aligner * | aligner | ||
) |
void vg::match_initial | ( | GaplessExtension & | match, |
const std::string & | seq, | ||
gbwtgraph::GBWTGraph::view_type | target, | ||
const Aligner * | aligner | ||
) |
double vg::median | ( | std::vector< int > & | v | ) |
pair< int64_t, int64_t > vg::mem_min_oriented_distances | ( | const MaximalExactMatch & | m1, |
const MaximalExactMatch & | m2 | ||
) |
vector< pair< gcsa::node_type, size_t > > vg::mem_node_start_positions | ( | const HandleGraph & | graph, |
const vg::MaximalExactMatch & | mem | ||
) |
get the handles that a mem covers
bool vg::mems_overlap | ( | const MaximalExactMatch & | mem1, |
const MaximalExactMatch & | mem2 | ||
) |
int vg::mems_overlap_length | ( | const MaximalExactMatch & | mem1, |
const MaximalExactMatch & | mem2 | ||
) |
const string vg::mems_to_json | ( | const vector< MaximalExactMatch > & | mems | ) |
void vg::merge_non_branching_subpaths | ( | MultipathAlignment & | multipath_aln | ) |
Merges non-branching paths in a multipath alignment in place.
void* vg::mergeNodeObjects | ( | void * | a, |
void * | b | ||
) |
string vg::middle_signature | ( | const Alignment & | aln, |
int | len | ||
) |
pair< string, string > vg::middle_signature | ( | const Alignment & | aln1, |
const Alignment & | aln2, | ||
int | len | ||
) |
int64_t vg::min_not_minus_one | ( | int64_t | n1, |
int64_t | n2 | ||
) |
pair< int64_t, int64_t > vg::min_oriented_distances | ( | const unordered_map< path_handle_t, vector< pair< size_t, bool > > > & | path_offsets1, |
const unordered_map< path_handle_t, vector< pair< size_t, bool > > > & | path_offsets2 | ||
) |
Find the min distance in the path offsets where the path orientation is the same and different.
size_t vg::modular_exponent | ( | uint64_t | base, |
uint64_t | exponent, | ||
uint64_t | modulus | ||
) |
Computes base^exponent mod modulus in log(exponent) time without requiring more than 64 bits to represent exponentiated number
real_t vg::multinomial_censored_sampling_prob_ln | ( | const vector< ProbIn > & | probs, |
const unordered_map< vector< bool >, int > & | obs | ||
) |
Get the log probability for sampling any actual set of category counts that is consistent with the constraints specified by obs, using the per-category probabilities defined in probs.
Obs maps from a vector of per-category flags (called a "class") to a number of items that might be in any of the flagged categories.
For example, if there are two equally likely categories, and one item flagged as potentially from either category, the probability of sampling a set of category counts consistent with that constraint is 1. If instead there are three equally likely categories, and one item flagged as potentially from two of the three but not the third, the probability of sampling a set of category counts consistent with that constraint is 2/3.
|
inline |
Compute the number of ways to select k_1, k_2, ... k_i items into i buckets from a collection of n distinguishable items, ignoring order. All of the items have to go into the buckets, so all k_i must sum to n. To compute choose you have to call this function with a 2-element vector, to represent the chosen and not-chosen buckets. Returns the natural log of the (integer) result.
TODO: Turns out we don't actually need this for the ambiguous multinomial after all.
real_t vg::multinomial_sampling_prob_ln | ( | const vector< ProbIn > & | probs, |
const vector< int > & | obs | ||
) |
Get the probability for sampling the counts in obs from a set of categories weighted by the probabilities in probs. Works for both double and real_t probabilities. Also works for binomials.
void vg::node_path_position | ( | int64_t | id, |
string & | path_name, | ||
int64_t & | position, | ||
bool | backward, | ||
int64_t & | offset | ||
) |
int vg::non_match_end | ( | const Alignment & | alignment | ) |
int vg::non_match_start | ( | const Alignment & | alignment | ) |
string vg::nonATGCNtoN | ( | const string & | s | ) |
double vg::normal_inverse_cdf | ( | double | p | ) |
Inverse CDF of a standard normal distribution. Must have 0 < quantile < 1.
T vg::normal_pdf | ( | T | x, |
T | m, | ||
T | s | ||
) |
void vg::normalize_alignment | ( | Alignment & | alignment | ) |
Merge adjacent edits of the same type and convert all N matches to mismatches.
Get the offset along the selected strand of the node from a pos_t.
Two Snarls are unequal if they are not equal.
bool vg::operator!= | ( | const SnarlTraversal & | a, |
const SnarlTraversal & | b | ||
) |
Two SnarlTraversals are unequal if they are not equal.
Two Visits are unequal if they are not equal.
Scale a Support by a factor, the other way
Scale a Support by a factor.
Scale a Support by a factor, in place.
Add two Support values together, accounting for strand.
Divide a Support by a factor.
Divide a Support by a factor, in place.
bool vg::operator< | ( | const MaximalExactMatch & | m1, |
const MaximalExactMatch & | m2 | ||
) |
bool vg::operator< | ( | const SnarlTraversal & | a, |
const SnarlTraversal & | b | ||
) |
Support less-than, based on total coverage.
ostream & vg::operator<< | ( | ostream & | os, |
const ReadFilter::Counts & | counts | ||
) |
ostream & vg::operator<< | ( | ostream & | out, |
const BenchmarkResult & | result | ||
) |
Benchmark results can be output to streams
ostream & vg::operator<< | ( | ostream & | out, |
const BitString & | bs | ||
) | -> ostream & |
Allow BitStrings to be printed for debugging.
ostream& vg::operator<< | ( | ostream & | out, |
const MaximalExactMatch & | mem | ||
) |
|
inline |
Print a NodeSide to a stream.
|
inline |
Print the given NodeTraversal.
ostream & vg::operator<< | ( | ostream & | out, |
mapping_t | mapping | ||
) |
Allow a mapping_t to be printed, for debugging purposes.
|
inline |
Print a pos_t to a stream.
std::ostream& vg::operator<< | ( | std::ostream & | out, |
PathBranch | branch | ||
) |
bool vg::operator== | ( | const MaximalExactMatch & | m1, |
const MaximalExactMatch & | m2 | ||
) |
Two Snarls are equal if their types are equal and their bounding Visits are equal and their parents are equal.
bool vg::operator== | ( | const SnarlTraversal & | a, |
const SnarlTraversal & | b | ||
) |
Two SnarlTraversals are equal if their snarls are equal and they have the same number of visits and all their visits are equal.
Support greater-than, based on total coverage.
void vg::optimal_alignment | ( | const MultipathAlignment & | multipath_aln, |
Alignment & | aln_out, | ||
bool | subpath_global = false |
||
) |
Stores the highest scoring alignment contained in the MultipathAlignment in an Alignment
Note: Assumes that each subpath's Path object uses one Mapping per node and that start subpaths have been identified
Args: multipath_aln multipath alignment to find optimal path through aln_out empty alignment to store optimal alignment in (data will be overwritten if not empty) subpath_global if true, only allows alignments that source subpath to sink subpath in the multipath DAG, else allows any start and end subpath
int32_t vg::optimal_alignment_internal | ( | const MultipathAlignment & | multipath_aln, |
Alignment * | aln_out, | ||
bool | subpath_global | ||
) |
int32_t vg::optimal_alignment_score | ( | const MultipathAlignment & | multipath_aln, |
bool | subpath_global = false |
||
) |
Returns the score of the highest scoring alignment contained in the MultipathAlignment
Note: Assumes that each subpath's Path object uses one Mapping per node and that start subpaths have been identified
Args: multipath_aln multipath alignment to find optimal score in subpath_global if true, only allows alignments that source subpath to sink subpath in the multipath DAG, else allows any start and end subpath
vector< Alignment > vg::optimal_alignments | ( | const MultipathAlignment & | multipath_aln, |
size_t | count | ||
) |
Returns the top k highest-scoring alignments contained in the MultipathAlignment. Note that some or all of these may be duplicate Alignments, which were spelled out by tracebacks through different sequences of subpaths that shared alignment material.
If the best alignment is no alignment (i.e. the read is unmapped), returns an empty vector.
Note: Assumes that each subpath's Path object uses one Mapping per node and that start subpaths have been identified
Args: multipath_aln multipath alignment to find optimal paths through count maximum number of top alignments to return
vector< Alignment > vg::optimal_alignments_with_disjoint_subpaths | ( | const MultipathAlignment & | multipath_aln, |
size_t | count | ||
) |
Finds k or fewer top-scoring alignments using only distinct subpaths. Asymmetrical: the optimal alignment for each end subpath is found, greedily, subject to the constraint, but the other subpaths are first-come first-serve. Also, distinct subpaths may not guarantee distinct actual alignments, so alignments may need deduplication.
If the best alignment is no alignment (i.e. the read is unmapped), returns an empty vector.
Note: Assumes that each subpath's Path object uses one Mapping per node and that start subpaths have been identified
Args: multipath_aln multipath alignment to find optimal paths through count maximum number of top alignments to return
void vg::output_graph_with_embedded_paths | ( | ostream & | subgraph_ostream, |
vector< pair< thread_t, int >> & | haplotype_list, | ||
const HandleGraph & | source, | ||
bool | json | ||
) |
Graph vg::output_graph_with_embedded_paths | ( | vector< pair< thread_t, int >> & | haplotype_list, |
const HandleGraph & | source | ||
) |
void vg::output_haplotype_counts | ( | ostream & | annotation_ostream, |
vector< pair< thread_t, int >> & | haplotype_list | ||
) |
unordered_map< id_t, id_t > vg::overlay_node_translations | ( | const unordered_map< id_t, id_t > & | over, |
const unordered_map< id_t, id_t > & | under | ||
) |
Compose the translations from two graph operations, neither of which involved oriented transformations.
unordered_map< id_t, pair< id_t, bool > > vg::overlay_node_translations | ( | const unordered_map< id_t, id_t > & | over, |
const unordered_map< id_t, pair< id_t, bool >> & | under | ||
) |
Compose the translations from two graph operations, the first of which involved oriented transformations.
unordered_map< id_t, pair< id_t, bool > > vg::overlay_node_translations | ( | const unordered_map< id_t, pair< id_t, bool >> & | over, |
const unordered_map< id_t, id_t > & | under | ||
) |
Compose the translations from two graph operations, the second of which involved oriented transformations.
unordered_map< id_t, pair< id_t, bool > > vg::overlay_node_translations | ( | const unordered_map< id_t, pair< id_t, bool >> & | over, |
const unordered_map< id_t, pair< id_t, bool >> & | under | ||
) |
Compose the translations from two graph operations, both of which involved oriented transformations.
size_t vg::paired_for_each_parallel_after_wait | ( | function< bool(Alignment &, Alignment &)> | get_pair_if_available, |
function< void(Alignment &, Alignment &)> | lambda, | ||
function< bool(void)> | single_threaded_until_true | ||
) |
Result vg::parse | ( | const char * | arg | ) |
Parse a command-line argument C string. Exits with an error if the string does not contain exactly an item fo the appropriate type.
Result vg::parse | ( | const string & | arg | ) |
Parse a command-line argument string. Exits with an error if the string does not contain exactly an item fo the appropriate type.
bool vg::parse | ( | const string & | arg, |
double & | dest | ||
) |
bool vg::parse | ( | const string & | arg, |
Result & | dest | ||
) |
Parse the appropriate type from the string to the destination value. Return true if parsing is successful and false (or throw something) otherwise.
bool vg::parse | ( | const string & | arg, |
std::regex & | dest | ||
) |
|
inline |
Parse a range as start[:end[:step]].
bool vg::parse | ( | const string & | arg | ) |
void vg::parse_bed_regions | ( | const string & | bed_path, |
vector< Region > & | out_regions, | ||
vector< string > * | out_names | ||
) |
void vg::parse_bed_regions | ( | istream & | bedstream, |
const PathPositionHandleGraph * | graph, | ||
vector< Alignment > * | out_alignments | ||
) |
Parse regions from the given BED file into Alignments in a vector. Reads the optional name, is_reverse, and score fields if present, and populates the relevant Alignment fields. Skips and warns about malformed or illegal BED records.
void vg::parse_gff_regions | ( | istream & | gffstream, |
const PathPositionHandleGraph * | graph, | ||
vector< Alignment > * | out_alignments | ||
) |
void vg::parse_region | ( | const string & | target, |
string & | name, | ||
int64_t & | start, | ||
int64_t & | end | ||
) |
|
inline |
void vg::parse_rg_sample_map | ( | char * | hts_header, |
map< string, string > & | rg_sample | ||
) |
int vg::path_from_length | ( | const Path & | path | ) |
Path vg::path_from_node_traversals | ( | const list< NodeTraversal > & | traversals | ) |
Path vg::path_from_path_handle | ( | const PathHandleGraph & | graph, |
path_handle_t | path_handle | ||
) |
Path vg::path_from_thread_t | ( | thread_t & | t, |
const HandleGraph & | source | ||
) |
bool vg::path_is_simple_match | ( | const Path & | p | ) |
vg::id_t vg::path_node | ( | const gbwt::vector_type & | path, |
size_t | i | ||
) |
bool vg::path_reverse | ( | const gbwt::vector_type & | path, |
size_t | i | ||
) |
bool vg::path_reverse | ( | const vector< pair< vg::id_t, bool >> & | path, |
size_t | i | ||
) |
string vg::path_sequence | ( | const HandleGraph & | graph, |
const Path & | path | ||
) |
size_t vg::path_size | ( | const gbwt::vector_type & | path | ) |
size_t vg::path_size | ( | const vector< pair< vg::id_t, bool >> & | path | ) |
int vg::path_to_length | ( | const Path & | path | ) |
string vg::path_to_string | ( | Path | p | ) |
string vg::percent_url_encode | ( | const string & | seq | ) |
Escape "%" to "%25".
double vg::phi | ( | double | x1, |
double | x2 | ||
) |
|
inline |
|
inline |
|
inline |
vector<T> vg::pmax | ( | const std::vector< T > & | a, |
const std::vector< T > & | b | ||
) |
Container<const Item*> vg::pointerfy | ( | const Container< Item > & | in | ) |
We have a wrapper of that to turn a container reference into a container of pointers.
Compute the log probability of a Poisson-distributed process: observed events in an interval where expected events happen on average.
void vg::populate_path_from_traceback | ( | const MultipathAlignment & | multipath_aln, |
const MultipathProblem & | problem, | ||
TracebackIterator | traceback_start, | ||
TracebackIterator | traceback_end, | ||
Path * | output | ||
) |
|
inline |
Extract gbwt::node_type from pos_t.
pos_t vg::position_at | ( | PathPositionHandleGraph * | xgidx, |
const string & | path_name, | ||
const size_t & | path_offset, | ||
bool | is_reverse | ||
) |
We have a helper function to convert path positions and orientations to pos_t values.
We have a utility function for turning positions along paths, with orientations, into pos_ts. Remember that pos_t counts offset from the start of the reoriented node, while here we count offset from the beginning of the forward version of the path.
void vg::preflight_check | ( | ) |
Run a preflight check to make sure that the system is usable for this build of vg. Aborts with a helpful message if this is not the case. We make sure to build it for a lowest-common-denominator architecture.
void vg::printId | ( | vg::id_t | id | ) |
|
inline |
|
inline |
short vg::quality_char_to_short | ( | char | c | ) |
char vg::quality_short_to_char | ( | short | i | ) |
string vg::random_sequence | ( | size_t | length | ) |
Returns a uniformly random DNA sequence of the given length.
default_random_engine vg::random_sequence_gen | ( | 102 | ) |
vector< size_t > vg::range_vector | ( | size_t | begin, |
size_t | end | ||
) |
|
inline |
void vg::remove_duplicate_edges | ( | Graph & | graph | ) |
remove duplicate edges
void vg::remove_duplicate_nodes | ( | Graph & | graph | ) |
remove duplicate nodes
void vg::remove_duplicates | ( | Graph & | graph | ) |
remove duplicate nodes and edges
void vg::remove_duplicates | ( | std::vector< GaplessExtension > & | result | ) |
void vg::remove_orphan_edges | ( | Graph & | graph | ) |
remove edges that link to a node that is not in the graph
void vg::remove_paths | ( | Graph & | graph, |
const function< bool(const string &)> & | paths_to_take, | ||
std::list< Path > * | matching | ||
) |
string vg::replace_in_string | ( | string | subject, |
const string & | search, | ||
const string & | replace | ||
) |
void vg::rev_comp_multipath_alignment | ( | const MultipathAlignment & | multipath_aln, |
const function< int64_t(int64_t)> & | node_length, | ||
MultipathAlignment & | rev_comp_out | ||
) |
Stores the reverse complement of a MultipathAlignment in another MultipathAlignment
Args: multipath_aln multipath alignment to reverse complement node_length a function that returns the length of a node sequence from its node ID rev_comp_out empty multipath alignment to store reverse complement in (some data may be overwritten if not empty)
void vg::rev_comp_multipath_alignment_in_place | ( | MultipathAlignment * | multipath_aln, |
const function< int64_t(int64_t)> & | node_length | ||
) |
Stores the reverse complement of a MultipathAlignment in another MultipathAlignment
Args: multipath_aln multipath alignment to reverse complement in place node_length a function that returns the length of a node sequence from its node ID
|
inline |
Stores the reverse complement of a Subpath in another Subpath
note: this is not included in the header because reversing a subpath without going through the multipath alignment can break invariants related to the edge lists
Args: subpath subpath to reverse complement node_length a function that returns the length of a node sequence from its node ID rev_comp_out empty subpath to store reverse complement in (data will be overwritten if not empty)
Reverse a pos_t and get a pos_t at the same point between bases, going the other direction. To get a pos_t to the same base, subtract 1 from the resulting offset or call reverse_base_pos().
Reverse a pos_t and get a pos_t at the same base, going the other direction.
char vg::reverse_complement | ( | const char & | c | ) |
string vg::reverse_complement | ( | const string & | seq | ) |
Alignment vg::reverse_complement_alignment | ( | const Alignment & | aln, |
const function< int64_t(id_t)> & | node_length | ||
) |
void vg::reverse_complement_alignment_in_place | ( | Alignment * | aln, |
const function< int64_t(id_t)> & | node_length | ||
) |
vector< Alignment > vg::reverse_complement_alignments | ( | const vector< Alignment > & | alns, |
const function< int64_t(int64_t)> & | node_length | ||
) |
void vg::reverse_complement_in_place | ( | string & | seq | ) |
Mapping vg::reverse_complement_mapping | ( | const Mapping & | m, |
const function< int64_t(id_t)> & | node_length | ||
) |
void vg::reverse_complement_mapping_in_place | ( | Mapping * | m, |
const function< int64_t(id_t)> & | node_length | ||
) |
Path vg::reverse_complement_path | ( | const Path & | path, |
const function< int64_t(id_t)> & | node_length | ||
) |
void vg::reverse_complement_path_in_place | ( | Path * | path, |
const function< int64_t(id_t)> & | node_length | ||
) |
BenchmarkResult vg::run_benchmark | ( | const string & | name, |
size_t | iterations, | ||
const function< void(void)> & | setup, | ||
const function< void(void)> & | under_test | ||
) |
Run a benchmark with a setup function.
BenchmarkResult vg::run_benchmark | ( | const string & | name, |
size_t | iterations, | ||
const function< void(void)> & | under_test | ||
) |
Run the given function the given number of times, interleaved with runs of the control function, and return a BenchmarkResult describing its performance.
tuple<MultipathProblem, int64_t, int32_t> vg::run_multipath_dp | ( | const MultipathAlignment & | multipath_aln, |
bool | subpath_global = false |
||
) |
Internal helper function for running the dynamic programming problem represented by a multipath alignment. Returns the filled DP problem, the optimal ending subpath, or -1 if no subpath is optimal, and the optimal score, or 0 if no score is optimal. An option toggles whether the traceback should be global (a source to a sink in the multipath DAG) or local (starting and ending at any subpath)
int32_t vg::sam_flag | ( | const Alignment & | alignment, |
bool | on_reverse_strand, | ||
bool | paired | ||
) |
|
inline |
Set the annotation with the given name to the given value. The value may be a primitive type or a vector of a primitive type.
|
inline |
Set the annotation with the given name to the given value. The value may be a primitive type or a vector of a primitive type.
|
inline |
const std::string vg::sha1head | ( | const std::string & | data, |
size_t | head | ||
) |
const std::string vg::sha1sum | ( | const std::string & | data | ) |
string vg::signature | ( | const Alignment & | aln | ) |
Merge adjacent edits of the same type, strip leading and trailing deletion edits (while updating positions if necessary), and makes sure position is actually set.
Simplify the path for addition as new material in the graph. Remove any mappings that are merely single deletions, merge adjacent edits of the same type, strip leading and trailing deletion edits on mappings, and make sure no mappings have missing positions.
bool vg::simplify_filtered_edits | ( | HandleGraph * | graph, |
Path & | path, | ||
const map< pos_t, id_t > & | node_translation, | ||
const unordered_map< id_t, size_t > & | orig_node_sizes, | ||
const string & | base_quals = "" , |
||
double | min_baseq = 0 |
||
) |
Remove edits in our graph that don't correspond to breakpoints (ie were effectively filtered out due to insufficient coverage. This way, subsequent logic in add_nodes_and_edges can be run correctly. Returns true if at least one edit survived the filter.
double vg::slope | ( | const std::vector< double > & | x, |
const std::vector< double > & | y | ||
) |
int vg::softclip_end | ( | const Alignment & | alignment | ) |
int vg::softclip_end | ( | const Mapping & | mapping | ) |
int vg::softclip_start | ( | const Alignment & | alignment | ) |
int vg::softclip_start | ( | const Mapping & | mapping | ) |
int vg::softclip_trim | ( | Alignment & | alignment | ) |
void vg::sort_by_id | ( | Graph & | graph | ) |
order the nodes and edges in the graph by id
void vg::sort_by_id_dedup_and_clean | ( | Graph & | graph | ) |
remove duplicates and sort by id
void vg::sort_edges_by_id | ( | Graph & | graph | ) |
order the edges in the graph by id pairs
void vg::sort_nodes_by_id | ( | Graph & | graph | ) |
order the nodes in the graph by id
void vg::sort_shuffling_ties | ( | RandomIt | begin, |
RandomIt | end, | ||
Compare | comp | ||
) |
Sort the items between the two given random-access iterators, as with std::sort. Deterministically shuffle the ties, if any, at the top end, using automatic seed determination.
void vg::sort_shuffling_ties | ( | RandomIt | begin, |
RandomIt | end, | ||
Compare | comp, | ||
MakeSeed | seed | ||
) |
Sort the items between the two given random-access iterators, as with std::sort. Deterministically shuffle the ties, if any, at the top end, using the given seed generator function.
std::vector< std::string > vg::split_delims | ( | const std::string & | s, |
const std::string & | delims | ||
) |
std::vector< std::string > & vg::split_delims | ( | const std::string & | s, |
const std::string & | delims, | ||
std::vector< std::string > & | elems | ||
) |
void vg::stacktrace_manually | ( | ostream & | out, |
int | signalNumber, | ||
void * | ip, | ||
void ** | bp | ||
) |
bool vg::start_backward | ( | const Chain & | chain | ) |
Return true if the first snarl in the given chain is backward relative to the chain.
double vg::stdev | ( | const std::vector< double > & | v | ) |
double vg::stdev | ( | const T & | v | ) |
bool vg::stPinchSegment_getBlockOrientationSafe | ( | stPinchSegment * | segment | ) |
Get the segment's orientation in its block (false=backward, true=forward), or true (forward) if there is no block.
string vg::string_quality_char_to_short | ( | const string & | quality | ) |
string vg::string_quality_short_to_char | ( | const string & | quality | ) |
int vg::sub_overlaps_of_first_aln | ( | const vector< Alignment > & | alns, |
float | overlap_fraction | ||
) |
|
inline |
Collection::value_type vg::sum | ( | const Collection & | collection | ) |
Compute the sum of the values in a collection. Values must be default- constructable (like numbers are).
Get the maximum support of a pair of Supports, by taking the max in each orientation.
Get the minimum support of a pair of Supports, by taking the min in each orientation.
Alignment vg::target_alignment | ( | const PathPositionHandleGraph * | graph, |
const string & | name, | ||
size_t | pos1, | ||
size_t | pos2, | ||
const string & | feature, | ||
bool | is_reverse | ||
) |
Make an Alignment corresponding to a subregion of a stored path. Positions are 0-based, and pos2 is excluded. Respects path circularity, so pos2 < pos1 is not a problem. If pos1 == pos2, returns an empty alignment.
Alignment vg::target_alignment | ( | const PathPositionHandleGraph * | graph, |
const string & | name, | ||
size_t | pos1, | ||
size_t | pos2, | ||
const string & | feature, | ||
bool | is_reverse, | ||
Mapping & | cigar_mapping | ||
) |
std::string vg::thread_name | ( | const gbwt::GBWT & | gbwt_index, |
size_t | i | ||
) |
Get a string representation of a thread name stored in GBWT metadata.
void vg::thread_to_graph_spanned | ( | thread_t & | t, |
Graph & | g, | ||
const HandleGraph & | source | ||
) |
edge_t vg::to_edge | ( | const HandleGraph & | graph, |
const Visit & | v1, | ||
const Visit & | v2 | ||
) |
Make an edge_t from a pair of visits.
int vg::to_length | ( | const Mapping & | m | ) |
|
inline |
void vg::to_multipath_alignment | ( | const Alignment & | aln, |
MultipathAlignment & | multipath_aln_out | ||
) |
|
inline |
Converts a Visit to a NodeTraversal. Throws an exception if the Visit is of a Snarl instead of a Node
|
inline |
|
inline |
Converts a Visit to a NodeTraversal in the opposite orientation. Throws an exception if the Visit is of a Snarl instead of a Node
|
inline |
|
inline |
Converts a NodeTraversal to a Visit in the opposite orientation.
|
inline |
|
inline |
string vg::to_vcf_genotype | ( | const Genotype & | gt | ) |
Get a VCF-style 1/2, 1|2|3, etc. string from a Genotype.
|
inline |
Make a Visit from a handle in a HandleGraph.
|
inline |
Converts a NodeTraversal to a Visit.
Make a Visit from a node ID and an orientation.
void vg::topologically_order_subpaths | ( | MultipathAlignment & | multipath_aln | ) |
Put subpaths in topological order (assumed to be true for other algorithms)
string vg::toUppercase | ( | const string & | s | ) |
void vg::trace_haplotypes_and_paths | ( | const PathHandleGraph & | source, |
const gbwt::GBWT & | haplotype_database, | ||
vg::id_t | start_node, | ||
int | extend_distance, | ||
Graph & | out_graph, | ||
map< string, int > & | out_thread_frequencies, | ||
bool | expand_graph | ||
) |
Copies the boundary Visits from one Snarl into another.
void vg::transfer_read_metadata | ( | const Alignment & | from, |
MultipathAlignment & | to | ||
) |
Copies metadata from an Alignment object and transfers it to a MultipathAlignment
Args: from copy metadata from this to into this
void vg::transfer_read_metadata | ( | const MultipathAlignment & | from, |
Alignment & | to | ||
) |
Copies metadata from an MultipathAlignment object and transfers it to a Alignment
Args: from copy metadata from this to into this
void vg::transfer_read_metadata | ( | const MultipathAlignment & | from, |
MultipathAlignment & | to | ||
) |
Copies metadata from an MultipathAlignment object and transfers it to another MultipathAlignment
Args: from copy metadata from this to into this
vector< MaximalExactMatch > vg::translate_mems | ( | const vector< MaximalExactMatch > & | mems, |
const unordered_map< id_t, pair< id_t, bool > > & | trans | ||
) |
Switches the node ids in the path to the ones indicated by the translator.
void vg::translate_node_ids | ( | Path & | path, |
const unordered_map< id_t, id_t > & | translator, | ||
id_t | cut_node, | ||
size_t | bases_removed, | ||
bool | from_right | ||
) |
Replaces the node IDs in the path with the ones indicated by the translator. Supports a single cut node in the source graph, where the given number of bases of the given node were removed from its left or right side when making the source graph from the destination graph.
void vg::translate_nodes | ( | Alignment & | a, |
const unordered_map< id_t, pair< id_t, bool > > & | ids, | ||
const std::function< size_t(int64_t)> & | node_length | ||
) |
void vg::translate_oriented_node_ids | ( | Path & | path, |
const unordered_map< id_t, pair< id_t, bool >> & | translator | ||
) |
Switches the node ids and orientations in the path to the ones indicated by the translator.
string vg::traversal_to_string | ( | VG & | graph, |
const SnarlTraversal & | path | ||
) |
Make a SnarlTraversal into the string it represents, including notes for nested child snarls.
Alignment vg::trim_alignment | ( | const Alignment & | aln, |
const Position & | pos1, | ||
const Position & | pos2 | ||
) |
bool vg::trim_mismatches | ( | GaplessExtension & | extension, |
const gbwtgraph::GBWTGraph & | graph, | ||
const gbwt::CachedGBWT & | cache, | ||
const Aligner & | aligner | ||
) |
size_t vg::unpaired_for_each_parallel | ( | function< bool(Alignment &)> | get_read_if_available, |
function< void(Alignment &)> | lambda | ||
) |
bool vg::validate_multipath_alignment | ( | const MultipathAlignment & | multipath_aln, |
const HandleGraph & | handle_graph | ||
) |
Debugging function to check that multipath alignment meets the formalism's basic invariants. Returns true if multipath alignment is valid, else false. Does not validate alignment score.
|
inline |
|
inline |
Cast a Protobuf generic Value to any type.
|
inline |
Cast a Protobuf generic Value to any type.
|
inline |
Cast any type to a generic Protobuf value.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void vg::variant_recall | ( | VG * | graph, |
vcflib::VariantCallFile * | vars, | ||
FastaReference * | ref_genome, | ||
vector< FastaReference * > | insertions, | ||
string | gamfile, | ||
bool | isIndex | ||
) |
run with : vg genotype -L -V v.vcf -I i.fa -R ref.fa
bool vg::verify_path | ( | const PathType & | path, |
MutableHandleGraph & | unfolded, | ||
const hash_map< vg::id_t, std::vector< vg::id_t >> & | reverse_mapping | ||
) |
void vg::view_multipath_alignment | ( | ostream & | out, |
const MultipathAlignment & | multipath_aln, | ||
const HandleGraph & | handle_graph | ||
) |
Send a formatted string representation of the MultipathAlignment into the ostream.
void vg::view_multipath_alignment_as_dot | ( | ostream & | out, |
const MultipathAlignment & | multipath_aln, | ||
bool | show_graph | ||
) |
Converts a MultipathAlignment to a GraphViz Dot representation, output to the given ostream.
vector<T> vg::vpmax | ( | const std::vector< std::vector< T >> & | vv | ) |
|
inline |
Thomas Wang's integer hash function. In many implementations, std::hash is identity function for integers, which leads to performance issues.
pair< double, double > vg::wellford_mean_var | ( | size_t | count, |
double | mean, | ||
double | M2, | ||
bool | sample_variance | ||
) |
void vg::wellford_update | ( | size_t & | count, |
double & | mean, | ||
double & | M2, | ||
double | new_val | ||
) |
string vg::wrap_text | ( | const string & | str, |
size_t | width | ||
) |
void vg::write_alignment_to_file | ( | const Alignment & | aln, |
const string & | filename | ||
) |
void vg::write_fasta_sequence | ( | const std::string & | name, |
const std::string & | sequence, | ||
ostream & | os, | ||
size_t | width | ||
) |
void vg::write_gcsa_kmers | ( | const HandleGraph & | graph, |
int | kmer_size, | ||
ostream & | out, | ||
size_t & | size_limit, | ||
id_t | head_id, | ||
id_t | tail_id | ||
) |
Write GCSA2 formatted binary KMers to the given ostream. size_limit is the maximum size of the kmer file in bytes. When the function returns, size_limit is the size of the kmer file in bytes.
string vg::write_gcsa_kmers_to_tmpfile | ( | const HandleGraph & | graph, |
int | kmer_size, | ||
size_t & | size_limit, | ||
id_t | head_id, | ||
id_t | tail_id, | ||
const string & | base_file_name = "vg-kmers-tmp-" |
||
) |
Open a tempfile and write the kmers to it. The calling context should remove it with temp_file::remove().
|
inline |
Convert a node on XGPath to gbwt::node_type.
const char* const vg::BAM_DNA_LOOKUP = "=ACMGRSVTWYHKDBN" |
bool vg::fullTrace = false |
|
constexpr |
const char* vg::var = "VG_FULL_TRACEBACK" |