vg
tools for working with variation graphs
|
#include <index.hpp>
Public Member Functions | |
Index (void) | |
Index (string &name) | |
~Index (void) | |
rocksdb::Options | GetOptions (bool read_only) |
void | open (const std::string &dir, bool read_only=false) |
void | open_read_only (string &dir) |
void | open_for_write (string &dir) |
void | open_for_bulk_load (string &dir) |
void | reset_options (void) |
void | flush (void) |
void | compact (void) |
void | close (void) |
void | load_graph (VG &graph) |
void | dump (std::ostream &out) |
void | for_all (std::function< void(string &, string &)> lambda) |
void | for_range (string &key_start, string &key_end, std::function< void(string &, string &)> lambda) |
void | put_node (const Node *node) |
void | put_edge (const Edge *edge) |
void | batch_node (const Node *node, rocksdb::WriteBatch &batch) |
void | batch_edge (const Edge *edge, rocksdb::WriteBatch &batch) |
void | put_kmer (const string &kmer, const nid_t id, const int32_t pos) |
void | batch_kmer (const string &kmer, const nid_t id, const int32_t pos, rocksdb::WriteBatch &batch) |
void | put_metadata (const string &tag, const string &data) |
void | put_node_path (nid_t node_id, int64_t path_id, int64_t path_pos, bool backward, const Mapping &mapping) |
void | put_path_position (int64_t path_id, int64_t path_pos, bool backward, nid_t node_id, const Mapping &mapping) |
void | put_mapping (const Mapping &mapping) |
void | put_alignment (const Alignment &alignment) |
void | put_base (int64_t aln_id, const Alignment &alignment) |
void | put_traversal (int64_t aln_id, const Mapping &mapping) |
void | cross_alignment (int64_t aln_id, const Alignment &alignment) |
rocksdb::Status | get_node (nid_t id, Node &node) |
rocksdb::Status | get_edge (nid_t from, bool from_start, nid_t to, bool to_end, Edge &edge) |
rocksdb::Status | get_metadata (const string &key, string &data) |
int | get_node_path (nid_t node_id, int64_t path_id, int64_t &path_pos, bool &backward, Mapping &mapping) |
void | get_mappings (nid_t node_id, vector< Mapping > &mappings) |
void | get_alignments (nid_t node_id, vector< Alignment > &alignments) |
void | get_alignments (nid_t id1, nid_t id2, vector< Alignment > &alignments) |
void | for_alignment_in_range (nid_t id1, nid_t id2, std::function< void(const Alignment &)> lambda) |
void | for_alignment_to_node (nid_t node_id, std::function< void(const Alignment &)> lambda) |
void | for_alignment_to_nodes (const vector< nid_t > &ids, std::function< void(const Alignment &)> lambda) |
void | for_base_alignments (const set< int64_t > &aln_ids, std::function< void(const Alignment &)> lambda) |
const string | key_for_node (nid_t id) |
const string | key_for_edge_on_start (nid_t node_id, nid_t other, bool backward) |
const string | key_for_edge_on_end (nid_t node_id, nid_t other, bool backward) |
const string | key_prefix_for_edges_on_node_start (nid_t node) |
const string | key_prefix_for_edges_on_node_end (nid_t node) |
const string | key_for_kmer (const string &kmer, nid_t id) |
const string | key_prefix_for_kmer (const string &kmer) |
const string | key_for_metadata (const string &tag) |
const string | key_for_path_position (int64_t path_id, int64_t path_pos, bool backward, nid_t node_id) |
const string | key_for_node_path_position (nid_t node_id, int64_t path_id, int64_t path_pos, bool backward) |
const string | key_prefix_for_node_path (nid_t node_id, int64_t path_id) |
const string | key_for_mapping_prefix (nid_t node_id) |
const string | key_for_mapping (const Mapping &mapping) |
const string | key_for_alignment_prefix (nid_t node_id) |
const string | key_for_alignment (const Alignment &alignment) |
const string | key_for_base (int64_t aln_id) |
const string | key_prefix_for_traversal (nid_t node_id) |
const string | key_for_traversal (int64_t aln_id, const Mapping &mapping) |
void | parse_node (const string &key, const string &value, nid_t &id, Node &node) |
void | parse_edge (const string &key, const string &value, char &type, nid_t &id1, nid_t &id2, Edge &edge) |
void | parse_edge (const string &key, char &type, nid_t &node_id, nid_t &other_id, bool &backward) |
void | parse_kmer (const string &key, const string &value, string &kmer, nid_t &id, int32_t &pos) |
void | parse_node_path (const string &key, const string &value, nid_t &node_id, int64_t &path_id, int64_t &path_pos, bool &backward, Mapping &mapping) |
void | parse_path_position (const string &key, const string &value, int64_t &path_id, int64_t &path_pos, bool &backward, nid_t &node_id, Mapping &mapping) |
void | parse_mapping (const string &key, const string &value, nid_t &node_id, uint64_t &nonce, Mapping &mapping) |
void | parse_alignment (const string &key, const string &value, nid_t &node_id, uint64_t &nonce, Alignment &alignment) |
void | parse_base (const string &key, const string &value, int64_t &aln_id, Alignment &alignment) |
void | parse_traversal (const string &key, const string &value, nid_t &node_id, int16_t &rank, bool &backward, int64_t &aln_id) |
string | entry_to_string (const string &key, const string &value) |
string | graph_entry_to_string (const string &key, const string &value) |
string | kmer_entry_to_string (const string &key, const string &value) |
string | position_entry_to_string (const string &key, const string &value) |
string | metadata_entry_to_string (const string &key, const string &value) |
string | node_path_to_string (const string &key, const string &value) |
string | path_position_to_string (const string &key, const string &value) |
string | mapping_entry_to_string (const string &key, const string &value) |
string | alignment_entry_to_string (const string &key, const string &value) |
string | base_entry_to_string (const string &key, const string &value) |
string | traversal_entry_to_string (const string &key, const string &value) |
void | get_context (nid_t id, VG &graph) |
void | expand_context (VG &graph, int steps) |
void | get_range (nid_t from_id, nid_t to_id, VG &graph) |
void | for_graph_range (nid_t from_id, nid_t to_id, function< void(string &, string &)> lambda) |
void | get_connected_nodes (VG &graph) |
void | get_edges_of (nid_t node, vector< Edge > &edges) |
void | get_edges_on_end (nid_t node, vector< Edge > &edges) |
void | get_edges_on_start (nid_t node, vector< Edge > &edges) |
void | get_nodes_next (nid_t node, bool backward, vector< pair< nid_t, bool >> &destinations) |
void | get_nodes_prev (nid_t node, bool backward, vector< pair< nid_t, bool >> &destinations) |
void | get_path (VG &graph, const string &name, int64_t start, int64_t end) |
void | node_path_position (nid_t id, string &path_name, int64_t &position, bool &backward, int64_t &offset) |
pair< list< pair< nid_t, bool > >, pair< nid_t, bool > > | get_nearest_node_prev_path_member (nid_t node_id, bool backward, int64_t path_id, int64_t &path_pos, bool &relative_orientation, int max_steps=4) |
pair< list< pair< nid_t, bool > >, pair< nid_t, bool > > | get_nearest_node_next_path_member (nid_t node_id, bool backward, int64_t path_id, int64_t &path_pos, bool &relative_orientation, int max_steps=4) |
bool | get_node_path_relative_position (nid_t node_id, bool backward, int64_t path_id, list< pair< nid_t, bool >> &path_prev, int64_t &prev_pos, bool &prev_orientation, list< pair< nid_t, bool >> &path_next, int64_t &next_pos, bool &next_orientation) |
Mapping | path_relative_mapping (nid_t node_id, bool backward, int64_t path_id, list< pair< nid_t, bool >> &path_prev, int64_t &prev_pos, bool &prev_orientation, list< pair< nid_t, bool >> &path_next, int64_t &next_pos, bool &next_orientation) |
void | path_layout (map< string, pair< pair< nid_t, bool >, pair< nid_t, bool >> > &layout, map< string, int64_t > &lengths) |
pair< nid_t, bool > | path_first_node (int64_t path_id) |
pair< nid_t, bool > | path_last_node (int64_t path_id, int64_t &path_length) |
void | get_kmer_subgraph (const string &kmer, VG &graph) |
uint64_t | approx_size_of_kmer_matches (const string &kmer) |
void | approx_sizes_of_kmer_matches (const vector< string > &kmers, vector< uint64_t > &sizes) |
void | for_kmer_range (const string &kmer, function< void(string &, string &)> lambda) |
void | get_kmer_positions (const string &kmer, map< nid_t, vector< int32_t > > &positions) |
void | get_kmer_positions (const string &kmer, map< string, vector< pair< nid_t, int32_t > > > &positions) |
void | prune_kmers (int max_kb_on_disk) |
void | remember_kmer_size (int size) |
set< int > | stored_kmer_sizes (void) |
void | store_batch (map< string, string > &items) |
void | kmer_matches (std::string &kmer, std::set< nid_t > &node_ids, std::set< int64_t > &edge_ids) |
string | first_kmer_key (const string &kmer) |
pair< uint64_t, uint64_t > | compare_kmers (Index &other) |
int64_t | get_max_path_id (void) |
void | put_max_path_id (int64_t id) |
int64_t | new_path_id (const string &name) |
string | path_name_prefix (const string &name) |
string | path_id_prefix (int64_t id) |
void | put_path_id_to_name (int64_t id, const string &name) |
void | put_path_name_to_id (int64_t id, const string &name) |
string | get_path_name (int64_t id) |
int64_t | get_path_id (const string &name) |
void | load_paths (VG &graph) |
void | store_paths (VG &graph) |
void | store_path (VG &graph, const Path &path) |
map< string, int64_t > | paths_by_id (void) |
void | for_each_mapping (function< void(const Mapping &)> lambda) |
void | for_each_alignment (function< void(const Alignment &)> lambda) |
char | graph_key_type (const string &key) |
Public Attributes | |
string | name |
char | start_sep |
char | end_sep |
int | threads |
rocksdb::DB * | db |
rocksdb::Options | db_options |
rocksdb::WriteOptions | write_options |
rocksdb::ColumnFamilyOptions | column_family_options |
bool | bulk_load |
std::atomic< uint64_t > | next_nonce |
vg::Index::Index | ( | void | ) |
vg::Index::Index | ( | string & | name | ) |
vg::Index::~Index | ( | void | ) |
string vg::Index::alignment_entry_to_string | ( | const string & | key, |
const string & | value | ||
) |
uint64_t vg::Index::approx_size_of_kmer_matches | ( | const string & | kmer | ) |
void vg::Index::approx_sizes_of_kmer_matches | ( | const vector< string > & | kmers, |
vector< uint64_t > & | sizes | ||
) |
string vg::Index::base_entry_to_string | ( | const string & | key, |
const string & | value | ||
) |
void vg::Index::batch_edge | ( | const Edge * | edge, |
rocksdb::WriteBatch & | batch | ||
) |
void vg::Index::batch_kmer | ( | const string & | kmer, |
const nid_t | id, | ||
const int32_t | pos, | ||
rocksdb::WriteBatch & | batch | ||
) |
void vg::Index::batch_node | ( | const Node * | node, |
rocksdb::WriteBatch & | batch | ||
) |
void vg::Index::close | ( | void | ) |
void vg::Index::compact | ( | void | ) |
pair< uint64_t, uint64_t > vg::Index::compare_kmers | ( | Index & | other | ) |
void vg::Index::cross_alignment | ( | int64_t | aln_id, |
const Alignment & | alignment | ||
) |
void vg::Index::dump | ( | std::ostream & | out | ) |
string vg::Index::entry_to_string | ( | const string & | key, |
const string & | value | ||
) |
void vg::Index::expand_context | ( | VG & | graph, |
int | steps = 1 |
||
) |
string vg::Index::first_kmer_key | ( | const string & | kmer | ) |
void vg::Index::flush | ( | void | ) |
void vg::Index::for_alignment_in_range | ( | nid_t | id1, |
nid_t | id2, | ||
std::function< void(const Alignment &)> | lambda | ||
) |
void vg::Index::for_alignment_to_node | ( | nid_t | node_id, |
std::function< void(const Alignment &)> | lambda | ||
) |
void vg::Index::for_alignment_to_nodes | ( | const vector< nid_t > & | ids, |
std::function< void(const Alignment &)> | lambda | ||
) |
void vg::Index::for_all | ( | std::function< void(string &, string &)> | lambda | ) |
void vg::Index::for_base_alignments | ( | const set< int64_t > & | aln_ids, |
std::function< void(const Alignment &)> | lambda | ||
) |
void vg::Index::for_each_alignment | ( | function< void(const Alignment &)> | lambda | ) |
void vg::Index::for_each_mapping | ( | function< void(const Mapping &)> | lambda | ) |
void vg::Index::for_graph_range | ( | nid_t | from_id, |
nid_t | to_id, | ||
function< void(string &, string &)> | lambda | ||
) |
void vg::Index::for_kmer_range | ( | const string & | kmer, |
function< void(string &, string &)> | lambda | ||
) |
void vg::Index::for_range | ( | string & | key_start, |
string & | key_end, | ||
std::function< void(string &, string &)> | lambda | ||
) |
void vg::Index::get_connected_nodes | ( | VG & | graph | ) |
rocksdb::Status vg::Index::get_edge | ( | nid_t | from, |
bool | from_start, | ||
nid_t | to, | ||
bool | to_end, | ||
Edge & | edge | ||
) |
void vg::Index::get_kmer_positions | ( | const string & | kmer, |
map< nid_t, vector< int32_t > > & | positions | ||
) |
void vg::Index::get_kmer_positions | ( | const string & | kmer, |
map< string, vector< pair< nid_t, int32_t > > > & | positions | ||
) |
void vg::Index::get_kmer_subgraph | ( | const string & | kmer, |
VG & | graph | ||
) |
int64_t vg::Index::get_max_path_id | ( | void | ) |
rocksdb::Status vg::Index::get_metadata | ( | const string & | key, |
string & | data | ||
) |
pair< list< pair< nid_t, bool > >, pair< nid_t, bool > > vg::Index::get_nearest_node_next_path_member | ( | nid_t | node_id, |
bool | backward, | ||
int64_t | path_id, | ||
int64_t & | path_pos, | ||
bool & | relative_orientation, | ||
int | max_steps = 4 |
||
) |
pair< list< pair< nid_t, bool > >, pair< nid_t, bool > > vg::Index::get_nearest_node_prev_path_member | ( | nid_t | node_id, |
bool | backward, | ||
int64_t | path_id, | ||
int64_t & | path_pos, | ||
bool & | relative_orientation, | ||
int | max_steps = 4 |
||
) |
int vg::Index::get_node_path | ( | nid_t | node_id, |
int64_t | path_id, | ||
int64_t & | path_pos, | ||
bool & | backward, | ||
Mapping & | mapping | ||
) |
bool vg::Index::get_node_path_relative_position | ( | nid_t | node_id, |
bool | backward, | ||
int64_t | path_id, | ||
list< pair< nid_t, bool >> & | path_prev, | ||
int64_t & | prev_pos, | ||
bool & | prev_orientation, | ||
list< pair< nid_t, bool >> & | path_next, | ||
int64_t & | next_pos, | ||
bool & | next_orientation | ||
) |
void vg::Index::get_nodes_next | ( | nid_t | node, |
bool | backward, | ||
vector< pair< nid_t, bool >> & | destinations | ||
) |
void vg::Index::get_nodes_prev | ( | nid_t | node, |
bool | backward, | ||
vector< pair< nid_t, bool >> & | destinations | ||
) |
void vg::Index::get_path | ( | VG & | graph, |
const string & | name, | ||
int64_t | start, | ||
int64_t | end | ||
) |
int64_t vg::Index::get_path_id | ( | const string & | name | ) |
string vg::Index::get_path_name | ( | int64_t | id | ) |
rocksdb::Options vg::Index::GetOptions | ( | bool | read_only | ) |
string vg::Index::graph_entry_to_string | ( | const string & | key, |
const string & | value | ||
) |
char vg::Index::graph_key_type | ( | const string & | key | ) |
const string vg::Index::key_for_alignment | ( | const Alignment & | alignment | ) |
const string vg::Index::key_for_alignment_prefix | ( | nid_t | node_id | ) |
const string vg::Index::key_for_base | ( | int64_t | aln_id | ) |
const string vg::Index::key_for_kmer | ( | const string & | kmer, |
nid_t | id | ||
) |
const string vg::Index::key_for_mapping | ( | const Mapping & | mapping | ) |
const string vg::Index::key_for_mapping_prefix | ( | nid_t | node_id | ) |
const string vg::Index::key_for_metadata | ( | const string & | tag | ) |
const string vg::Index::key_for_node | ( | nid_t | id | ) |
const string vg::Index::key_for_node_path_position | ( | nid_t | node_id, |
int64_t | path_id, | ||
int64_t | path_pos, | ||
bool | backward | ||
) |
const string vg::Index::key_for_path_position | ( | int64_t | path_id, |
int64_t | path_pos, | ||
bool | backward, | ||
nid_t | node_id | ||
) |
const string vg::Index::key_for_traversal | ( | int64_t | aln_id, |
const Mapping & | mapping | ||
) |
const string vg::Index::key_prefix_for_edges_on_node_end | ( | nid_t | node | ) |
const string vg::Index::key_prefix_for_edges_on_node_start | ( | nid_t | node | ) |
const string vg::Index::key_prefix_for_kmer | ( | const string & | kmer | ) |
const string vg::Index::key_prefix_for_node_path | ( | nid_t | node_id, |
int64_t | path_id | ||
) |
const string vg::Index::key_prefix_for_traversal | ( | nid_t | node_id | ) |
string vg::Index::kmer_entry_to_string | ( | const string & | key, |
const string & | value | ||
) |
void vg::Index::kmer_matches | ( | std::string & | kmer, |
std::set< nid_t > & | node_ids, | ||
std::set< int64_t > & | edge_ids | ||
) |
void vg::Index::load_graph | ( | VG & | graph | ) |
void vg::Index::load_paths | ( | VG & | graph | ) |
string vg::Index::mapping_entry_to_string | ( | const string & | key, |
const string & | value | ||
) |
string vg::Index::metadata_entry_to_string | ( | const string & | key, |
const string & | value | ||
) |
int64_t vg::Index::new_path_id | ( | const string & | name | ) |
void vg::Index::node_path_position | ( | nid_t | id, |
string & | path_name, | ||
int64_t & | position, | ||
bool & | backward, | ||
int64_t & | offset | ||
) |
string vg::Index::node_path_to_string | ( | const string & | key, |
const string & | value | ||
) |
void vg::Index::open | ( | const std::string & | dir, |
bool | read_only = false |
||
) |
void vg::Index::open_for_bulk_load | ( | string & | dir | ) |
void vg::Index::open_for_write | ( | string & | dir | ) |
void vg::Index::open_read_only | ( | string & | dir | ) |
void vg::Index::parse_alignment | ( | const string & | key, |
const string & | value, | ||
nid_t & | node_id, | ||
uint64_t & | nonce, | ||
Alignment & | alignment | ||
) |
void vg::Index::parse_base | ( | const string & | key, |
const string & | value, | ||
int64_t & | aln_id, | ||
Alignment & | alignment | ||
) |
void vg::Index::parse_edge | ( | const string & | key, |
char & | type, | ||
nid_t & | node_id, | ||
nid_t & | other_id, | ||
bool & | backward | ||
) |
void vg::Index::parse_edge | ( | const string & | key, |
const string & | value, | ||
char & | type, | ||
nid_t & | id1, | ||
nid_t & | id2, | ||
Edge & | edge | ||
) |
void vg::Index::parse_kmer | ( | const string & | key, |
const string & | value, | ||
string & | kmer, | ||
nid_t & | id, | ||
int32_t & | pos | ||
) |
void vg::Index::parse_mapping | ( | const string & | key, |
const string & | value, | ||
nid_t & | node_id, | ||
uint64_t & | nonce, | ||
Mapping & | mapping | ||
) |
void vg::Index::parse_node_path | ( | const string & | key, |
const string & | value, | ||
nid_t & | node_id, | ||
int64_t & | path_id, | ||
int64_t & | path_pos, | ||
bool & | backward, | ||
Mapping & | mapping | ||
) |
void vg::Index::parse_path_position | ( | const string & | key, |
const string & | value, | ||
int64_t & | path_id, | ||
int64_t & | path_pos, | ||
bool & | backward, | ||
nid_t & | node_id, | ||
Mapping & | mapping | ||
) |
void vg::Index::parse_traversal | ( | const string & | key, |
const string & | value, | ||
nid_t & | node_id, | ||
int16_t & | rank, | ||
bool & | backward, | ||
int64_t & | aln_id | ||
) |
pair< nid_t, bool > vg::Index::path_first_node | ( | int64_t | path_id | ) |
string vg::Index::path_id_prefix | ( | int64_t | id | ) |
pair< nid_t, bool > vg::Index::path_last_node | ( | int64_t | path_id, |
int64_t & | path_length | ||
) |
void vg::Index::path_layout | ( | map< string, pair< pair< nid_t, bool >, pair< nid_t, bool >> > & | layout, |
map< string, int64_t > & | lengths | ||
) |
string vg::Index::path_name_prefix | ( | const string & | name | ) |
string vg::Index::path_position_to_string | ( | const string & | key, |
const string & | value | ||
) |
Mapping vg::Index::path_relative_mapping | ( | nid_t | node_id, |
bool | backward, | ||
int64_t | path_id, | ||
list< pair< nid_t, bool >> & | path_prev, | ||
int64_t & | prev_pos, | ||
bool & | prev_orientation, | ||
list< pair< nid_t, bool >> & | path_next, | ||
int64_t & | next_pos, | ||
bool & | next_orientation | ||
) |
map< string, int64_t > vg::Index::paths_by_id | ( | void | ) |
string vg::Index::position_entry_to_string | ( | const string & | key, |
const string & | value | ||
) |
void vg::Index::prune_kmers | ( | int | max_kb_on_disk | ) |
void vg::Index::put_alignment | ( | const Alignment & | alignment | ) |
void vg::Index::put_base | ( | int64_t | aln_id, |
const Alignment & | alignment | ||
) |
void vg::Index::put_edge | ( | const Edge * | edge | ) |
void vg::Index::put_kmer | ( | const string & | kmer, |
const nid_t | id, | ||
const int32_t | pos | ||
) |
void vg::Index::put_mapping | ( | const Mapping & | mapping | ) |
void vg::Index::put_max_path_id | ( | int64_t | id | ) |
void vg::Index::put_metadata | ( | const string & | tag, |
const string & | data | ||
) |
void vg::Index::put_node | ( | const Node * | node | ) |
void vg::Index::put_node_path | ( | nid_t | node_id, |
int64_t | path_id, | ||
int64_t | path_pos, | ||
bool | backward, | ||
const Mapping & | mapping | ||
) |
void vg::Index::put_path_id_to_name | ( | int64_t | id, |
const string & | name | ||
) |
void vg::Index::put_path_name_to_id | ( | int64_t | id, |
const string & | name | ||
) |
void vg::Index::put_path_position | ( | int64_t | path_id, |
int64_t | path_pos, | ||
bool | backward, | ||
nid_t | node_id, | ||
const Mapping & | mapping | ||
) |
void vg::Index::put_traversal | ( | int64_t | aln_id, |
const Mapping & | mapping | ||
) |
void vg::Index::remember_kmer_size | ( | int | size | ) |
void vg::Index::reset_options | ( | void | ) |
void vg::Index::store_batch | ( | map< string, string > & | items | ) |
void vg::Index::store_paths | ( | VG & | graph | ) |
set< int > vg::Index::stored_kmer_sizes | ( | void | ) |
string vg::Index::traversal_entry_to_string | ( | const string & | key, |
const string & | value | ||
) |
bool vg::Index::bulk_load |
rocksdb::ColumnFamilyOptions vg::Index::column_family_options |
rocksdb::DB* vg::Index::db |
rocksdb::Options vg::Index::db_options |
char vg::Index::end_sep |
string vg::Index::name |
std::atomic<uint64_t> vg::Index::next_nonce |
char vg::Index::start_sep |
int vg::Index::threads |
rocksdb::WriteOptions vg::Index::write_options |