/* * seed_search.h * * Created on: 2016/8/31 * Author: Tsukasa Fukunaga */ #ifndef SEED_SEARCH_H #define SEED_SEARCH_H #include #include "energy_par.h" #include "hit.h" using namespace std; class SeedSearch { public: SeedSearch(int h, int l, int mal, double he){ _max_seed_length = l; _pair_size = 6; _hash_size = h; _min_accessible_length = mal; _hybrid_energy_threshold = he; _stem_pair.resize(_pair_size); _stem_pair[0].push_back(3); _stem_pair[0].push_back(4); _stem_pair[1].push_back(4); _stem_pair[1].push_back(3); _stem_pair[2].push_back(4); _stem_pair[2].push_back(5); _stem_pair[3].push_back(5); _stem_pair[3].push_back(4); _stem_pair[4].push_back(2); _stem_pair[4].push_back(5); _stem_pair[5].push_back(5); _stem_pair[5].push_back(2); _hit_candidate_result.reserve(5000); } void Run(vector &query_seq, vector &query_suffix_array, vector &db_seq, vector &db_suffix_array, vector > &_start_hash, vector > &_end_hash); void CalcInteractionEnergy(vector &hit_result, vector &query_suffix_array, vector &db_suffix_array, vector &query_accessibility, vector &query_conditional_accessibility, vector > &db_accessibility,vector > &db_conditional_accessibility, vector &_db_seq_length, vector &_db_seq_start_position); private: vector > _stem_pair; int _pair_size; int _max_seed_length; int _hash_size; int _min_accessible_length; double _hybrid_energy_threshold; vector _hit_candidate_result; void GetSeqIdAndStart(vector &db_seq_length, vector &db_seq_start_position, int* seq_id, int* start, int sp, int length); void SeedSearchCore(vector &query_seq, vector &query_suffix_array, vector &db_seq, vector &db_suffix_array, vector > &_start_hash, vector > &_end_hash,vector &db_seed, vector &q_seed, int sp_q, int ep_q, int sp_db, int ep_db, double score, int length); void SeedSearchNextCharacter(vector &encoded_sequences, vector &suffix_array, int* start, int* end, unsigned char c, int offset); double CalcAccessibility(vector accessibility, vector conditional_accessibility, int sp, int length); }; #endif