DP-HLS
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
host_utils.h File Reference

Contains helper functions to write the host side code of the kernel. More...

#include <string>
#include <vector>
#include <array>
#include <complex>
#include <random>
#include <stack>
#include <map>
#include <iostream>

Go to the source code of this file.

Namespaces

 Random
 
 HostUtils
 
 HostUtils::IO
 
 HostUtils::Generate
 
 HostUtils::Sequence
 

Macros

#define AL_END_H   0b000
 
#define AL_INS_H   0b001
 
#define AL_MMI_H   0b010
 
#define AL_DEL_H   0b011
 
#define AL_NULL_H   0b100
 

Functions

template<int N>
string Random::Sequence (char alphabet[N], int length)
 
template<typename T >
std::vector< T > Random::SequenceComplex (int length)
 
template<int WID>
std::vector< std::array< int, 5 > > Random::SequenceProfileAlignment (int len)
 A function that generates a random sequence in the format of the input of profile alignment. Each element of the output vector is an array of length 5. Each element in the array is the count of A, T, C, G, and _ in the column. The integers in the array should be non negative and sum up to WID. More...
 
map< string, std::vector
< string > > 
HostUtils::IO::read_sequences_from_json (string file_path)
 Read form a json file storing the sequences in the format of "specie_name": "dna string". More...
 
std::vector< std::string > HostUtils::IO::readFasta (const std::string &filePath)
 
template<typename T , size_t M, size_t N>
void HostUtils::IO::SwitchDimension (T(&src)[M][N], T(&dst)[N][M])
 
int HostUtils::Sequence::base_to_num (char base)
 Map a single base to a number. A: 0, C: 1, G: 2, T: 3, _: 4. More...
 
char HostUtils::Sequence::num_to_base (int num)
 
char HostUtils::Sequence::num_to_aa (int num)
 
int HostUtils::Sequence::aa_to_num (char aa)
 
template<typename T >
string HostUtils::Sequence::nav_to_string (T nav)
 
template<typename T , size_t MAX_QRY_LENGTH, size_t MAX_REF_LENGTH>
std::vector< string > HostUtils::Sequence::ReconstructTracebackProfile (std::vector< string > querys, std::vector< string > references, int query_start_idx, int reference_start_idx, T(&tb_streams)[MAX_REF_LENGTH+MAX_QRY_LENGTH])
 Reconstruct the traceback for profile alignmetnt from the array of traceback navigations. More...
 
std::vector< std::array< int, 5 > > HostUtils::Sequence::MultipleSequencesToProfileAlign (std::vector< string > seq, int len)
 Given a array of sequences, convert them to the format of the input of profile alignment. More...
 
template<typename T , size_t MAX_QRY_LENGTH, size_t MAX_REF_LENGTH>
std::map< string, string > HostUtils::Sequence::ReconstructTraceback (string query, string reference, int query_start_idx, int reference_start_idx, T(&tb_streams)[MAX_REF_LENGTH+MAX_QRY_LENGTH])
 Fucntion to reconstruct the alignment result from the an array of traceback navigations. More...
 
template<typename T , size_t MAX_QRY_LENGTH, size_t MAX_REF_LENGTH>
std::map< string, string > HostUtils::Sequence::ReconstructTracebackSemiglobal (string query, string reference, int query_start_idx, int reference_start_idx, T(&tb_streams)[MAX_REF_LENGTH+MAX_QRY_LENGTH])
 
template<typename T , size_t MAX_QRY_LENGTH, size_t MAX_REF_LENGTH>
std::map< string, string > HostUtils::Sequence::ReconstructTracebackOverlapSuffixPrefix (string query, string reference, int query_start_idx, int reference_start_idx, T(&tb_streams)[MAX_REF_LENGTH+MAX_QRY_LENGTH])
 
template<typename T , int LEN>
string HostUtils::Sequence::NavigationToString (T nav[LEN])
 
template<typename T , int NB, int MAX_QRY_LENGTH, int MAX_REF_LENGTH>
array< map< string, string >, NB > HostUtils::Sequence::ReconstructTracebackBlocks (string query[NB], string reference[NB], int query_start_idx[NB], int reference_start_idx[NB], T(&tb_streams)[NB][MAX_REF_LENGTH+MAX_QRY_LENGTH])
 Function to reconstruct the alignment result from the array of the traceback navigations for all blocks. More...
 
template<typename T , int NB, int MAX_QRY_LENGTH, int MAX_REF_LENGTH>
array< map< string, string >, NB > HostUtils::Sequence::ReconstructTracebackSemiglobalBlocks (string query[NB], string reference[NB], int query_start_idx[NB], int reference_start_idx[NB], T(&tb_streams)[NB][MAX_REF_LENGTH+MAX_QRY_LENGTH])
 
template<typename T , int NB, int MAX_QRY_LENGTH, int MAX_REF_LENGTH>
array< map< string, string >, NB > HostUtils::Sequence::ReconstructTracebackOverlapSuffixPrefixBlocks (string query[NB], string reference[NB], int query_start_idx[NB], int reference_start_idx[NB], T(&tb_streams)[NB][MAX_REF_LENGTH+MAX_QRY_LENGTH])
 

Detailed Description

Contains helper functions to write the host side code of the kernel.

Author
Yingqi Cao (yic03.nosp@m.3@uc.nosp@m.sd.ed.nosp@m.u)
Version
0.1
Date
2023-11-03

Macro Definition Documentation

#define AL_DEL_H   0b011
#define AL_END_H   0b000
#define AL_INS_H   0b001
#define AL_MMI_H   0b010
#define AL_NULL_H   0b100