Namespaces | |
detail | |
op | |
Functions | |
template<class Key , class Value , size_t N> | |
const Value & | constant_mapping_get (const std::pair< Key, Value >(&pairs)[N], const Key &key, const Value &default_value) |
template<typename T > | |
size_t | length_of (const T &val) |
template<typename T , size_t N> | |
size_t | length_of (const T(&)[N]) |
template<class Destination , class Source > | |
Destination | lexical_cast (const Source &src) |
std::string | format (const float val, const int width, const int precision, const char fill= ' ', const bool fixed=true) |
template<typename T > | |
float | float_cast (const T val, const T sentinel=std::numeric_limits< T >::max()) |
template<typename T , typename R , typename P1 > | |
value_container< R(T::*)(P1) > | wrap_setter (T &obj, R(T::*func)(P1)) |
template<typename I , typename O , typename F > | |
void | outliers_lower (I beg, I end, const F bound, O out) |
template<typename I , typename O , typename F > | |
void | outliers_upper (I beg, I end, const F bound, O out) |
template<typename I > | |
I | percentile (I beg, I end, const size_t percentile) |
template<typename I , typename Compare > | |
I | percentile (I beg, I end, const size_t percentile, Compare comp) |
template<typename F > | |
F | interpolate_linear (const F y1, const F y2, const F x1, const F x2, const F xt) |
template<typename F , typename I > | |
F | percentile_sorted (I beg, I end, const size_t percentile) |
template<typename F , typename I , typename Op > | |
F | percentile_sorted (I beg, I end, const size_t percentile, Op op) |
template<typename I , typename UnaryOp > | |
I | remove_nan (I beg, I end, UnaryOp op) |
template<typename I > | |
I | median (I beg, I end) |
template<typename I , typename Compare > | |
I | median (I beg, I end, Compare comp) |
template<typename F , typename I > | |
F | median_interpolated (I beg, I end) |
template<typename F , typename I , typename Compare > | |
F | median_interpolated (I beg, I end, Compare comp) |
template<typename F , typename I , typename Compare , typename Op > | |
F | median_interpolated (I beg, I end, Compare comp, Op op) |
template<typename R , typename I , typename BinaryOp > | |
R | nan_mean (I beg, I end, BinaryOp op) |
template<typename R , typename I , typename BinaryOp > | |
R | nan_variance_with_mean (I beg, I end, const R mean_val, BinaryOp op) |
template<typename R , typename I , typename BinaryOp > | |
R | nan_variance (I beg, I end, BinaryOp op) |
template<typename R , typename I , typename BinaryOp > | |
R | mean (I beg, I end, BinaryOp op) |
template<typename R , typename I , typename BinaryOp > | |
R | variance_with_mean (I beg, I end, const R mean_val, BinaryOp op) |
template<typename R , typename I , typename BinaryOp > | |
R | variance (I beg, I end, BinaryOp op) |
template<typename R , typename I > | |
R | mean (I beg, I end) |
template<typename R , typename I > | |
R | variance (I beg, I end) |
template<typename R , typename I > | |
R | variance_with_mean (I beg, I end, const R mean) |
bool | replace (std::string &str, const std::string &from, const std::string &to) |
void | camel_to (std::string &str, const std::string &sep=" ") |
void | camel_from (std::string &str, const char sep=' ') |
bool | contains_ASCII_only (const std::string &input) |
std::string | to_lower (const std::string &input) |
bool | ends_with (const std::string &input, const std::string &ending, const bool is_case_insensitive=false) |
std::istream & | cross_platform_getline (std::istream &is, std::string &line) |
std::istream & | operator>> (std::istream &in, constants::dna_bases &bases) |
std::ostream & | operator<< (std::ostream &out, const csharp_date_time &date_time) |
std::istream & | operator>> (std::istream &in, csharp_date_time &date_time) |
Function Documentation
|
inline |
Split string based on space characters and delineate with camel case
E.g. "Signal To Noise" -> "SignalToNoise"
- Parameters
-
str source/destination string sep separator string
|
inline |
Split string based on upper case characters and separate with separator string
E.g. "SignalToNoise" -> "Signal To Noise"
- Parameters
-
str source/destination string sep seperator string
const Value& illumina::interop::util::constant_mapping_get | ( | const std::pair< Key, Value >(&) | pairs[N], |
const Key & | key, | ||
const Value & | default_value | ||
) |
Get the value corresponding to the key or default_value if none exists
- Parameters
-
pairs array of values mapping Key to Value key key to search for in mapping default_value value to return if the key is not found
- Returns
- value found (or default_value)
|
inline |
Returns true iff only ASCII characters are used
- Parameters
-
input string to check
|
inline |
|
inline |
float illumina::interop::util::float_cast | ( | const T | val, |
const T | sentinel = std::numeric_limits<T>::max() |
||
) |
Cast a number to a float, return NaN if it matches the sentinel
The default sentinel is the maximum value for the type.
- Template Parameters
-
T
- Parameters
-
val number to cast sentinel NaN sentinel, default max value
- Returns
|
inline |
Utility to format a floating point number as a string
- Parameters
-
val floating point value width width of the number precision number of digits after decimal fill fill character fixed if true use fixed not default
- Returns
- string representation of float
F illumina::interop::util::interpolate_linear | ( | const F | y1, |
const F | y2, | ||
const F | x1, | ||
const F | x2, | ||
const F | xt | ||
) |
Perform linear interpolation between two sets of (x,y) points given a target x value
- Parameters
-
y1 y-value for point 1 y2 y-value for point 2 x1 x-value for point 1 x2 x-value for point 2 xt target x-value
- Returns
- linearly interoploate y-value for given target x value
size_t illumina::interop::util::length_of | ( | const T & | val | ) |
Get the number of elements in the collection or 1 if a value
- Parameters
-
val collection or value
- Returns
- size of collection or 1 for value
size_t illumina::interop::util::length_of | ( | const | T(&)[N] | ) |
Get the number of elements in a stack array
- Returns
- size of array
|
inline |
Cast between a string type and some arbitrary type
- Note
- The arbitrary type should support the std::istream >> or std::ostream << operators
- Parameters
-
src source value of an arbitrary type
- Returns
- value of arbitrary type
R illumina::interop::util::mean | ( | I | beg, |
I | end, | ||
BinaryOp | op | ||
) |
Estimate the mean of values in a given collection
Usage: std::vector<float> values = {0,1,2,3}; double mean_val = mean<double>(values.begin(), values.end());
- Parameters
-
beg iterator to start of collection end iterator to end of collection op function that takes one value and returns another value
- Returns
- mean of the input collection
R illumina::interop::util::mean | ( | I | beg, |
I | end | ||
) |
Estimate the mean of values in a given collection
Usage: std::vector<float> values = {0,1,2,3}; double mean_val = mean<double>(values.begin(), values.end());
- Parameters
-
beg iterator to start of collection end iterator to end of collection
- Returns
- mean of the input collection
I illumina::interop::util::median | ( | I | beg, |
I | end | ||
) |
Calculate the median of the collection
- Note
- this will change the underlying array!
- Parameters
-
beg iterator to start of collection end iterator to end of collection
- Returns
- iterator to requested percentile
I illumina::interop::util::median | ( | I | beg, |
I | end, | ||
Compare | comp | ||
) |
Calculate the median of the collection
- Note
- this will change the underlying array!
- Parameters
-
beg iterator to start of collection end iterator to end of collection comp comparator between two types
- Returns
- iterator to requested percentile
F illumina::interop::util::median_interpolated | ( | I | beg, |
I | end | ||
) |
Calculate the median of the collection
- Note
- this will change the underlying array!
- Parameters
-
beg iterator to start of collection end iterator to end of collection
- Returns
- iterator to requested percentile
F illumina::interop::util::median_interpolated | ( | I | beg, |
I | end, | ||
Compare | comp | ||
) |
Calculate the median of the collection
- Note
- this will change the underlying array!
- Parameters
-
beg iterator to start of collection end iterator to end of collection comp comparator between two types
- Returns
- iterator to requested percentile
F illumina::interop::util::median_interpolated | ( | I | beg, |
I | end, | ||
Compare | comp, | ||
Op | op | ||
) |
Calculate the median of the collection
- Note
- this will change the underlying array!
- Parameters
-
beg iterator to start of collection end iterator to end of collection comp comparator between two types op function that takes one value and returns another value
- Returns
- iterator to requested percentile
R illumina::interop::util::nan_mean | ( | I | beg, |
I | end, | ||
BinaryOp | op | ||
) |
Estimate the mean of values in a given collection
This function skips NaN values
Usage: std::vector<float> values = {0,1,2,3}; double mean_val = nan_mean<double>(values.begin(), values.end());
- Parameters
-
beg iterator to start of collection end iterator to end of collection op function that takes one value and returns another value
- Returns
- mean of the input collection
R illumina::interop::util::nan_variance | ( | I | beg, |
I | end, | ||
BinaryOp | op | ||
) |
Estimate the variance of values in a given collection
This function skips NaN values
Usage: std::vector<float> values = {0,1,2,3}; double var_val = nan_variance<double>(values.begin(), values.end());
- Parameters
-
beg iterator to start of collection end iterator to end of collection op function that takes one value and returns another value
- Returns
- variance of the input collection
R illumina::interop::util::nan_variance_with_mean | ( | I | beg, |
I | end, | ||
const R | mean_val, | ||
BinaryOp | op | ||
) |
Estimate the variance of values in a given collection
This function skips NaN values
Usage: std::vector<float> values = {0,1,2,3}; double var_val = nan_variance<double>(values.begin(), values.end());
- Parameters
-
beg iterator to start of collection end iterator to end of collection mean_val pre-calculated mean op function that takes one value and returns another value
- Returns
- variance of the input collection
std::ostream& illumina::interop::util::operator<< | ( | std::ostream & | out, |
const csharp_date_time & | date_time | ||
) |
Write date type as integer to an output stream
- Parameters
-
out output stream date_time data time object
- Returns
- output stream
|
inline |
std::istream& illumina::interop::util::operator>> | ( | std::istream & | in, |
csharp_date_time & | date_time | ||
) |
Read a date type from the input stream
- Parameters
-
in input stream date_time data time object
- Returns
- input stream
void illumina::interop::util::outliers_lower | ( | I | beg, |
I | end, | ||
const F | bound, | ||
O | out | ||
) |
Collect outliers below bound for a sorted collection
- Parameters
-
beg iterator to start of a sorted collection end iterator to end of a sorted collection bound bounding value for outliers out output iterator
void illumina::interop::util::outliers_upper | ( | I | beg, |
I | end, | ||
const F | bound, | ||
O | out | ||
) |
Collect outliers above bound for a sorted collection
- Parameters
-
beg iterator to start of a sorted collection end iterator to end of a sorted collection bound bounding value for outliers out output iterator
I illumina::interop::util::percentile | ( | I | beg, |
I | end, | ||
const size_t | percentile | ||
) |
Calculate the given percentile
The percentile must be an integer in percent. For example the 99th percent tile would set percentile = 99.
- Note
- this will change the underlying array!
- Parameters
-
beg iterator to start of collection end iterator to end of collection percentile integer in percent
- Returns
- iterator to requested percentile
I illumina::interop::util::percentile | ( | I | beg, |
I | end, | ||
const size_t | percentile, | ||
Compare | comp | ||
) |
Calculate the given percentile
The percentile must be an integer in percent. For example the 99th percent tile would set percentile = 99.
- Note
- this will change the underlying array!
- Parameters
-
beg iterator to start of collection end iterator to end of collection percentile integer in percent comp comparator between two types
- Returns
- iterator to requested percentile
F illumina::interop::util::percentile_sorted | ( | I | beg, |
I | end, | ||
const size_t | percentile | ||
) |
Calculate the interpolated percentile given a sorted array
- Parameters
-
beg iterator to start of sorted array end iterator to end of sorted array percentile target percentile [0-100]
- Returns
- interpolated value of array corresponding to given percentile
F illumina::interop::util::percentile_sorted | ( | I | beg, |
I | end, | ||
const size_t | percentile, | ||
Op | op | ||
) |
Calculate the interpolated percentile given a sorted array
- Parameters
-
beg iterator to start of sorted array end iterator to end of sorted array percentile target percentile [0-100] op function that takes one value and returns another value
- Returns
- interpolated value of array corresponding to given percentile
I illumina::interop::util::remove_nan | ( | I | beg, |
I | end, | ||
UnaryOp | op | ||
) |
Sort NaNs to the end of the collection return iterator to first NaN value
- Parameters
-
beg iterator to start of collection end iterator to end of collection op function that takes one value and returns another value
- Returns
- iterator to last non-NaN element
|
inline |
Replace any first occurence of substring from with substring to
- Parameters
-
str source/destination string from search string to replacement string
- Returns
- true if substring was found and replaced
|
inline |
R illumina::interop::util::variance | ( | I | beg, |
I | end, | ||
BinaryOp | op | ||
) |
Estimate the variance of values in a given collection
Usage: std::vector<float> values = {0,1,2,3}; double var_val = variance<double>(values.begin(), values.end());
- Parameters
-
beg iterator to start of collection end iterator to end of collection op function that takes one value and returns another value
- Returns
- variance of the input collection
R illumina::interop::util::variance | ( | I | beg, |
I | end | ||
) |
Estimate the variance of values in a given collection
Usage: std::vector<float> values = {0,1,2,3}; double mean_val = variance<double>(values.begin(), values.end());
- Parameters
-
beg iterator to start of collection end iterator to end of collection
- Returns
- variance of the input collection
R illumina::interop::util::variance_with_mean | ( | I | beg, |
I | end, | ||
const R | mean_val, | ||
BinaryOp | op | ||
) |
Estimate the variance of values in a given collection
Usage: std::vector<float> values = {0,1,2,3}; double var_val = variance<double>(values.begin(), values.end());
- Parameters
-
beg iterator to start of collection end iterator to end of collection mean_val precalculated mean op function that takes one value and returns another value
- Returns
- variance of the input collection
R illumina::interop::util::variance_with_mean | ( | I | beg, |
I | end, | ||
const R | mean | ||
) |
Estimate the variance of values in a given collection
Usage: std::vector<float> values = {0,1,2,3}; double mean_val = variance<double>(values.begin(), values.end());
- Parameters
-
beg iterator to start of collection end iterator to end of collection mean mean of the data in the collection
- Returns
- variance of the input collection
|
inline |
Wrapper memeber function setter
- Parameters
-
obj reference to object func pointer ot member function setting
- Returns
- value_container