btllib
|
Classes | |
class | AAHash |
class | BlindNtHash |
class | BlindSeedNtHash |
class | BloomFilter |
class | CountingBloomFilter |
class | Indexlr |
class | KmerBloomFilter |
class | KmerCountingBloomFilter |
class | NtHash |
class | ProcessPipeline |
class | RandSeq |
class | SeedAAHash |
class | SeedBloomFilter |
class | SeedNtHash |
class | SeqReader |
class | SeqWriter |
Typedefs | |
using | SpacedSeed = std::vector<unsigned> |
using | CountingBloomFilter8 = CountingBloomFilter<uint8_t> |
using | CountingBloomFilter16 = CountingBloomFilter<uint16_t> |
using | CountingBloomFilter32 = CountingBloomFilter<uint32_t> |
using | KmerCountingBloomFilter8 = KmerCountingBloomFilter<uint8_t> |
using | KmerCountingBloomFilter16 = KmerCountingBloomFilter<uint16_t> |
using | KmerCountingBloomFilter32 = KmerCountingBloomFilter<uint32_t> |
using | PipeId = unsigned long |
using | PipelineId = unsigned long |
Functions | |
std::vector< SpacedSeed > | aa_parse_seeds (const std::vector< std::string > &seeds) |
std::vector< std::vector< unsigned > > | parse_seeds (const std::vector< std::string > &seed_strings) |
void | reverse_complement (std::string &seq) |
std::string | get_reverse_complement (const std::string &seq) |
std::string | get_time () |
void | log_info (const std::string &msg) |
void | log_warning (const std::string &msg) |
void | log_error (const std::string &msg) |
void | check_info (bool condition, const std::string &msg) |
void | check_warning (bool condition, const std::string &msg) |
void | check_error (bool condition, const std::string &msg) |
std::string | get_strerror () |
void | check_stream (const std::ios &stream, const std::string &name) |
void | check_file_accessibility (const std::string &filepath) |
std::vector< std::string > | split (const std::string &s, const std::string &delim) |
std::string | join (const std::vector< std::string > &s, const std::string &delim) |
void | ltrim (std::string &s) |
void | ltrim (btllib::CString &s) |
void | rtrim (std::string &s) |
void | rtrim (btllib::CString &s) |
void | trim (std::string &s) |
void | trim (btllib::CString &s) |
bool | startswith (std::string s, std::string prefix) |
bool | endswith (std::string s, std::string suffix) |
std::string | get_basename (const std::string &path) |
std::string | get_dirname (const std::string &path) |
double | sum_phred (const std::string &qual, size_t start_pos=0, size_t len=0) |
double | calc_phred_avg (const std::string &qual, size_t start_pos=0, size_t len=0) |
Functions for sequence manipulation.
Functions for logging and error checking.
Random utility functions.
double btllib::calc_phred_avg | ( | const std::string & | qual, |
size_t | start_pos = 0, | ||
size_t | len = 0 ) |
Calculate the average phred score of a string, depending on the start position and length.
qual | The quality string to calculate the average from. |
start_pos | The start position of the substring. Defaults to 0. |
len | The length of the substring. Defaults to 0. If 0, the whole string is used. |
void btllib::check_error | ( | bool | condition, |
const std::string & | msg ) |
Conditionally log error level events. The program exits if the condition is true.
condition | If this is true, the message is printed and the program exits. |
msg | Message to print. |
void btllib::check_file_accessibility | ( | const std::string & | filepath | ) |
Check whether the file at the given path is accessible (exists, permissions are good, etc.).
filepath | Path to the file to check. |
void btllib::check_info | ( | bool | condition, |
const std::string & | msg ) |
Conditionally log info level events.
condition | If this is true, the message is printed. |
msg | Message to print. |
void btllib::check_stream | ( | const std::ios & | stream, |
const std::string & | name ) |
Check whether the stream is good. Program prints an error message and exits if not.
stream | Stream to check goodness of. |
name | Name of the stream, e.g. filepath or stdin |
void btllib::check_warning | ( | bool | condition, |
const std::string & | msg ) |
Conditionally log warning level events.
condition | If this is true, the message is printed. |
msg | Message to print. |
bool btllib::endswith | ( | std::string | s, |
std::string | suffix ) |
Check whether the given string ends with a suffix.
s | String to check. |
suffix | Suffix to check for. |
std::string btllib::get_basename | ( | const std::string & | path | ) |
Equivalent to the GNU implementation of basename, but returns a string copy of the result.
path | The path to get basename from. |
std::string btllib::get_dirname | ( | const std::string & | path | ) |
Equivalent to the GNU implementation of dirname, but returns a string copy of the result.
path | The path to get dirname from. |
std::string btllib::get_reverse_complement | ( | const std::string & | seq | ) |
Obtain a reverse complement of the provided sequence. The argument sequence is left untouched.
seq | Sequence to reverse complement. |
std::string btllib::get_time | ( | ) |
Return current time as a string.
std::string btllib::join | ( | const std::vector< std::string > & | s, |
const std::string & | delim ) |
Join a vector of strings into a single string with a delimiter.
s | Vector of strings to join. |
delim | Delimiter to join the strings with. |
void btllib::log_error | ( | const std::string & | msg | ) |
Log error level events.
msg | Message to print. |
void btllib::log_info | ( | const std::string & | msg | ) |
Log info level events.
msg | Message to print. |
void btllib::log_warning | ( | const std::string & | msg | ) |
Log warning level events.
msg | Message to print. |
void btllib::ltrim | ( | std::string & | s | ) |
Trim whitespace on the left side of the given string.
s | String to trim, edited in-place. |
|
inline |
Parse each spaced seed pattern into lists of don't care positions. Legacy function used in btllib Bloom filters.
void btllib::reverse_complement | ( | std::string & | seq | ) |
Reverse complement a sequence in-place.
seq | Sequence to reverse complement. |
void btllib::rtrim | ( | std::string & | s | ) |
Trim whitespace on the right side of the given string.
s | String to trim, edited in-place. |
std::vector< std::string > btllib::split | ( | const std::string & | s, |
const std::string & | delim ) |
Split a string into component substrings with a delimiter.
s | String to split. |
delim | Delimiter to split with. |
delim
, excluding delimiters themselves. bool btllib::startswith | ( | std::string | s, |
std::string | prefix ) |
Check whether the given string starts with a prefix.
s | String to check. |
prefix | Prefix to check for. |
double btllib::sum_phred | ( | const std::string & | qual, |
size_t | start_pos = 0, | ||
size_t | len = 0 ) |
Calculate the sum of the phred scores of a string.
qual | The quality string to calculate the sum from. |
start_pos | The start position of the substring. Defaults to 0. |
len | The length of the substring. Defaults to 0. If 0, the whole string is used. |
void btllib::trim | ( | std::string & | s | ) |
Trim whitespace on the left and right side of the given string.
s | String to trim, edited in-place. |