#include <string>
#include <vector>
#include <functional>
#include <stdlib.h>
#include <sstream>
#include "antonie.hh"
Go to the source code of this file.
Classes |
class | Clusterer< T > |
| Generic class to cluster objects that are 'close by'. More...
|
struct | Clusterer< T >::cluster |
| Represents a cluster. More...
|
Typedefs |
typedef std::function< void(void)> | acgt_t |
Functions |
double | qToErr (unsigned int i) |
| convert a Sanger Q-score into an error probability. Uses a cache to be fast.
|
double | getGCContent (const std::string &str) |
| returns GC fraction of nucleotides in str
|
void | acgtDo (char c, acgt_t aDo, acgt_t cDo, acgt_t gDo, acgt_t tDo) |
void | acgtxDo (char c, acgt_t aDo, acgt_t cDo, acgt_t gDo, acgt_t tDo, acgt_t xDo) |
template<typename T > |
const T::value_type & | pickRandom (const T &t) |
| Little utility to pick a random element from a container.
|
template<typename T > |
std::string | jsonVector (const std::vector< T > &v, const std::string &name, std::function< double(dnapos_t)> yAdjust=[](dnapos_t d){return 1.0 *d;}, std::function< double(int)> xAdjust=[](int i){return 1.0 *i;}) |
| returns v as a string in JSON format, where v is a vector of values, and we return it as an array of [offset,value] pairs.
|
template<typename T > |
std::string | jsonVectorD (const std::vector< T > &v, std::function< double(double)> yAdjust=[](double d){return d;}, std::function< double(int)> xAdjust=[](int i){return 1.0 *i;}) |
uint32_t | kmerMapper (const std::string &str, int offset, int unsigned len) |
| maps 'len' nucleotides from 'str' at offset offset to a 32 bit string. At most 16 nuclotides therefore!
|
Variables |
const char * | g_gitHash |
Typedef Documentation
typedef std::function< void(void)> acgt_t |
Function Documentation
returns GC fraction of nucleotides in str
template<typename T >
std::string jsonVector |
( |
const std::vector< T > & |
v, |
|
|
const std::string & |
name |
|
) |
| |
returns v as a string in JSON format, where v is a vector of values, and we return it as an array of [offset,value] pairs.
v can be transformed inline ysing yAdjust and xAdjust
- Parameters:
-
v | Vector of values |
name | name of JSON object |
yAdjust | function (or lambda) that transforms the values in v |
xAdjust | function (or lambda) that generates the offsets in our return vector. Gets passed this offset, returns a double |
uint32_t kmerMapper |
( |
const std::string & |
str, |
|
|
int |
offset, |
|
|
int unsigned |
len |
|
) |
| |
maps 'len' nucleotides from 'str' at offset offset to a 32 bit string. At most 16 nuclotides therefore!
Little utility to pick a random element from a container.
double qToErr |
( |
unsigned int |
i | ) |
|
convert a Sanger Q-score into an error probability. Uses a cache to be fast.
Variable Documentation