BitMagic-C++
|
Example: DNA substring search. More...
#include <iostream>
#include <sstream>
#include <chrono>
#include <regex>
#include <time.h>
#include <stdio.h>
#include <stdexcept>
#include <memory>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <unordered_map>
#include "bm.h"
#include "bmalgo.h"
#include "bmserial.h"
#include "bmaggregator.h"
#include "bmdbg.h"
#include "bmtimer.h"
Go to the source code of this file.
Data Structures | |
class | DNA_FingerprintScanner |
Utility for keeping all DNA finger print vectors and search using various techniques. More... | |
Typedefs | |
typedef std::map< std::string, unsigned > | freq_map |
typedef std::vector< std::pair< unsigned, std::string > > | dict_vect |
typedef bm::aggregator< bm::bvector<> > | aggregator_type |
using | THitList = vector<unsigned> |
Functions | |
static void | show_help () |
static int | parse_args (int argc, char *argv[]) |
static int | load_FASTA (const std::string &fname, std::vector< char > &seq_vect) |
static void | generate_kmers (vector< tuple< string, int > > &top_words, vector< tuple< string, int > > &lo_words, const vector< char > &data, size_t N, unsigned word_size) |
generate the most frequent words of specified length from the input sequence | |
static void | find_word_2way (vector< char > &data, const char *word, unsigned word_size, THitList &r) |
2-way string matching | |
static void | find_words (const vector< char > &data, vector< const char * > words, unsigned word_size, vector< vector< unsigned > > &hits) |
Find all words in one pass (cache coherent algorithm) (variation of 2-way string matching for collection search) | |
static bool | hitlist_compare (const THitList &h1, const THitList &h2) |
Check search result match. | |
int | main (int argc, char *argv[]) |
Variables | |
std::string | ifa_name |
bool | is_diag = false |
bool | is_timing = false |
bool | is_bench = false |
bool | is_search = false |
bool | h_word_set = true |
bm::chrono_taker::duration_map_type | timing_map |
static const size_t | WORD_SIZE = 28 |
Example: DNA substring search.
Definition in file xsample04.cpp.
typedef bm::aggregator<bm::bvector<> > aggregator_type |
Definition at line 144 of file xsample04.cpp.
typedef std::vector<std::pair<unsigned, std::string> > dict_vect |
Definition at line 142 of file xsample04.cpp.
typedef std::map<std::string, unsigned> freq_map |
Definition at line 141 of file xsample04.cpp.
using THitList = vector<unsigned> |
Definition at line 362 of file xsample04.cpp.
|
static |
2-way string matching
Definition at line 421 of file xsample04.cpp.
Referenced by main().
|
static |
Find all words in one pass (cache coherent algorithm) (variation of 2-way string matching for collection search)
Definition at line 451 of file xsample04.cpp.
Referenced by main().
|
static |
generate the most frequent words of specified length from the input sequence
Definition at line 367 of file xsample04.cpp.
Referenced by main().
Check search result match.
Definition at line 490 of file xsample04.cpp.
Referenced by main().
|
static |
Definition at line 152 of file xsample04.cpp.
References timing_map.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] ) |
Definition at line 508 of file xsample04.cpp.
References DNA_FingerprintScanner::Build(), bm::chrono_taker::ct_all, DNA_FingerprintScanner::Find(), find_word_2way(), find_words(), DNA_FingerprintScanner::FindAggFused(), DNA_FingerprintScanner::FindCollection(), generate_kmers(), h_word_set, hitlist_compare(), ifa_name, is_search, is_timing, load_FASTA(), parse_args(), bm::chrono_taker::print_duration_map(), show_help(), timing_map, and WORD_SIZE.
|
static |
Definition at line 80 of file xsample04.cpp.
References h_word_set, ifa_name, is_bench, is_diag, is_search, is_timing, and show_help().
Referenced by main().
|
static |
Definition at line 56 of file xsample04.cpp.
Referenced by main(), and parse_args().
bool h_word_set = true |
Definition at line 77 of file xsample04.cpp.
Referenced by main(), and parse_args().
std::string ifa_name |
Definition at line 72 of file xsample04.cpp.
Referenced by main(), and parse_args().
bool is_bench = false |
Definition at line 75 of file xsample04.cpp.
Referenced by parse_args().
bool is_diag = false |
Definition at line 73 of file xsample04.cpp.
Referenced by parse_args().
bool is_search = false |
Definition at line 76 of file xsample04.cpp.
Referenced by main(), and parse_args().
bool is_timing = false |
Definition at line 74 of file xsample04.cpp.
Referenced by main(), and parse_args().
bm::chrono_taker::duration_map_type timing_map |
Definition at line 148 of file xsample04.cpp.
Referenced by load_FASTA(), and main().
|
static |