#include <immintrin.h>#include <mpi.h>#include <omp.h>#include <algorithm>#include <array>#include <chrono>#include <climits>#include <cstring>#include <filesystem>#include <fstream>#include <iomanip>#include <iostream>#include <map>#include <memory>#include <numeric>#include <sstream>#include <stdexcept>#include <string>#include <unordered_map>#include <vector>Data Structures | |
| class | FMIndex |
| struct | AffineDPScores |
| struct | Loc |
| struct | Seed |
| struct | ChainedSeed |
| struct | AlignmentResult |
| struct | LcsSegmentResult |
Macros | |
| #define | EDNAFULL_MATRIX_DEFINED |
| #define | EBLOSUM62_MATRIX_DEFINED |
| #define | RESET "\033[0m" |
| #define | GREEN "\033[32m" |
| #define | RED "\033[31m" |
| #define | CYAN "\033[36m" |
Typedefs | |
| using | ScoreFn = int(*)(char, char) |
Enumerations | |
| enum | ScoreMode { MODE_DNA , MODE_PROTEIN } |
Functions | |
| std::vector< int > | suffix_array_construction (const std::string &s) |
| int | edna_score (char x, char y) |
| int | blosum62_score (char x, char y) |
| int | score (char x, char y, ScoreMode mode) |
| void | showProgressBar (int progress, int total) |
| std::string | getAccession (const std::string &header, ScoreMode mode) |
| std::string | getGeneSymbol (const std::string &header, ScoreMode mode) |
| void | processFasta (const std::string &filename, std::string &header_out, std::string &sequence_out) |
| void | savePlainAlignment (const std::string &h1, const std::string &h2, const std::string &a1, const std::string &a2, std::ostream &os) |
| void | saveLCS (const std::string &id, const std::string &lcs_str_val, std::ostream &os) |
| void | printColoredAlignment (const std::string &seq1_aln, const std::string &seq2_aln, std::ostream &os=std::cout) |
| void | writeRawDPMatrix (const std::vector< std::vector< int > > &dp_matrix, const std::string &filename) |
| void | writeDPMatrix (const std::vector< std::vector< int > > &dp_matrix, const std::string &filename) |
| void | writeRawCharMatrix (const std::vector< std::vector< char > > &char_matrix, const std::string &filename) |
| void | writeCharMatrix (const std::vector< std::vector< char > > &char_matrix, const std::string &filename) |
| void | initAffineDP (int n_len, std::vector< int > &prev_row_s, std::vector< int > &prev_row_e, std::vector< int > &prev_row_f, bool isGlobal) |
| void | computeAffineDPRow (int i_row, const std::string &x_str, const std::string &y_str, std::vector< int > &prev_s_row, std::vector< int > &prev_e_row, std::vector< int > &prev_f_row, std::vector< int > &curr_s_row, std::vector< int > &curr_e_row, std::vector< int > &curr_f_row, std::vector< char > &curr_trace_s_row, ScoreFn score_fn_local, bool isGlobal) |
| std::vector< Seed > | generate_raw_seeds (const std::string &query_seq, const FMIndex &target_fm_index, int kmer_len, int mpi_rank_val=0, int mpi_num_procs_val=1) |
| ChainedSeed | find_best_seed_chain (std::vector< Seed > &seeds_vec, int min_diag_gap_val=0, int max_diag_gap_val=50000, int max_offset_dev_val=50) |
| AlignmentResult | perform_sw_in_window (const std::string &sub1, const std::string &sub2, ScoreFn sfn, double go, double ge, int q_off, int t_off) |
| AlignmentResult | align_segment_globally (const std::string &seg1, const std::string &seg2, ScoreFn sfn, double go, double ge) |
| LcsSegmentResult | compute_lcs_for_segment (const std::string &seg1, const std::string &seg2) |
| void | globalalign (const std::string &x_orig, const std::string &y_orig, const std::string &header1, const std::string &header2, const std::string &outdir, ScoreMode mode_val, ScoreFn score_fn_val, const FMIndex *target_fm_idx) |
| void | localalign (const std::string &x, const std::string &y, const std::string &h1, const std::string &h2, const std::string &odir, ScoreMode mval, ScoreFn sfn_val, const FMIndex *tfm_idx) |
| void | lcs (const std::string &x_o, const std::string &y_o, const std::string &h1_lcs, const std::string &h2_lcs, const std::string &odir_lcs, ScoreMode mode_lcs, const FMIndex *tfm_idx_lcs) |
| int | main (int argc, char **argv) |
Variables | |
| const int | EDNAFULL_SIZE = 15 |
| int | EDNAFULL_matrix [EDNAFULL_SIZE][EDNAFULL_SIZE] |
| const int | EBLOSUM62_SIZE = 24 |
| int | EBLOSUM62_matrix [EBLOSUM62_SIZE][EBLOSUM62_SIZE] |
| bool | verbose = false |
| bool | binary = false |
| bool | txt = false |
| int | rank_val |
| double | GAP_OPEN = -5.0 |
| double | GAP_EXTEND = -1.0 |
| #define CYAN "\033[36m" |
| #define EBLOSUM62_MATRIX_DEFINED |
| #define EDNAFULL_MATRIX_DEFINED |
| #define GREEN "\033[32m" |
| #define RED "\033[31m" |
| #define RESET "\033[0m" |
| using ScoreFn = int (*)(char, char) |
| enum ScoreMode |
| AlignmentResult align_segment_globally | ( | const std::string & | seg1, |
| const std::string & | seg2, | ||
| ScoreFn | sfn, | ||
| double | go, | ||
| double | ge | ||
| ) |
|
inline |
| LcsSegmentResult compute_lcs_for_segment | ( | const std::string & | seg1, |
| const std::string & | seg2 | ||
| ) |
| void computeAffineDPRow | ( | int | i_row, |
| const std::string & | x_str, | ||
| const std::string & | y_str, | ||
| std::vector< int > & | prev_s_row, | ||
| std::vector< int > & | prev_e_row, | ||
| std::vector< int > & | prev_f_row, | ||
| std::vector< int > & | curr_s_row, | ||
| std::vector< int > & | curr_e_row, | ||
| std::vector< int > & | curr_f_row, | ||
| std::vector< char > & | curr_trace_s_row, | ||
| ScoreFn | score_fn_local, | ||
| bool | isGlobal | ||
| ) |
|
inline |
| ChainedSeed find_best_seed_chain | ( | std::vector< Seed > & | seeds_vec, |
| int | min_diag_gap_val = 0, |
||
| int | max_diag_gap_val = 50000, |
||
| int | max_offset_dev_val = 50 |
||
| ) |
| std::vector< Seed > generate_raw_seeds | ( | const std::string & | query_seq, |
| const FMIndex & | target_fm_index, | ||
| int | kmer_len, | ||
| int | mpi_rank_val = 0, |
||
| int | mpi_num_procs_val = 1 |
||
| ) |
| std::string getAccession | ( | const std::string & | header, |
| ScoreMode | mode | ||
| ) |
| std::string getGeneSymbol | ( | const std::string & | header, |
| ScoreMode | mode | ||
| ) |
| void globalalign | ( | const std::string & | x_orig, |
| const std::string & | y_orig, | ||
| const std::string & | header1, | ||
| const std::string & | header2, | ||
| const std::string & | outdir, | ||
| ScoreMode | mode_val, | ||
| ScoreFn | score_fn_val, | ||
| const FMIndex * | target_fm_idx | ||
| ) |
| void initAffineDP | ( | int | n_len, |
| std::vector< int > & | prev_row_s, | ||
| std::vector< int > & | prev_row_e, | ||
| std::vector< int > & | prev_row_f, | ||
| bool | isGlobal | ||
| ) |
| void lcs | ( | const std::string & | x_o, |
| const std::string & | y_o, | ||
| const std::string & | h1_lcs, | ||
| const std::string & | h2_lcs, | ||
| const std::string & | odir_lcs, | ||
| ScoreMode | mode_lcs, | ||
| const FMIndex * | tfm_idx_lcs | ||
| ) |
| void localalign | ( | const std::string & | x, |
| const std::string & | y, | ||
| const std::string & | h1, | ||
| const std::string & | h2, | ||
| const std::string & | odir, | ||
| ScoreMode | mval, | ||
| ScoreFn | sfn_val, | ||
| const FMIndex * | tfm_idx | ||
| ) |
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
| AlignmentResult perform_sw_in_window | ( | const std::string & | sub1, |
| const std::string & | sub2, | ||
| ScoreFn | sfn, | ||
| double | go, | ||
| double | ge, | ||
| int | q_off, | ||
| int | t_off | ||
| ) |
| void printColoredAlignment | ( | const std::string & | seq1_aln, |
| const std::string & | seq2_aln, | ||
| std::ostream & | os = std::cout |
||
| ) |
| void processFasta | ( | const std::string & | filename, |
| std::string & | header_out, | ||
| std::string & | sequence_out | ||
| ) |
| void saveLCS | ( | const std::string & | id, |
| const std::string & | lcs_str_val, | ||
| std::ostream & | os | ||
| ) |
| void savePlainAlignment | ( | const std::string & | h1, |
| const std::string & | h2, | ||
| const std::string & | a1, | ||
| const std::string & | a2, | ||
| std::ostream & | os | ||
| ) |
|
inline |
| void showProgressBar | ( | int | progress, |
| int | total | ||
| ) |
| std::vector< int > suffix_array_construction | ( | const std::string & | s | ) |
| void writeCharMatrix | ( | const std::vector< std::vector< char > > & | char_matrix, |
| const std::string & | filename | ||
| ) |
| void writeDPMatrix | ( | const std::vector< std::vector< int > > & | dp_matrix, |
| const std::string & | filename | ||
| ) |
| void writeRawCharMatrix | ( | const std::vector< std::vector< char > > & | char_matrix, |
| const std::string & | filename | ||
| ) |
| void writeRawDPMatrix | ( | const std::vector< std::vector< int > > & | dp_matrix, |
| const std::string & | filename | ||
| ) |
| bool binary = false |
| int EBLOSUM62_matrix[EBLOSUM62_SIZE][EBLOSUM62_SIZE] |
| const int EBLOSUM62_SIZE = 24 |
| int EDNAFULL_matrix[EDNAFULL_SIZE][EDNAFULL_SIZE] |
| const int EDNAFULL_SIZE = 15 |
| double GAP_EXTEND = -1.0 |
| double GAP_OPEN = -5.0 |
| int rank_val |
| bool txt = false |
| bool verbose = false |