A library for working with phylogenetic data.
v0.25.0
base_counts.cpp File Reference
#include "genesis/population/functions/base_counts.hpp"
#include "genesis/utils/io/char.hpp"
#include <cassert>
#include <iostream>
#include <stdexcept>

Go to the source code of this file.

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::population
 

Functions

std::pair< char, double > consensus (BaseCounts const &sample)
 Consensus character for a BaseCounts, and its confidence. More...
 
std::pair< char, double > consensus (BaseCounts const &sample, BaseCountsStatus const &status)
 Consensus character for a BaseCounts, and its confidence. More...
 
BaseCounts convert_to_base_counts (SimplePileupReader::Sample const &sample, unsigned char min_phred_score)
 
void filter_min_count (BaseCounts &sample, size_t min_count)
 Filter by minimum count that we need for a type of nucleotide (A, C, G, T) to be considered; set to zero if min_count is not reached. More...
 
size_t get_base_count (BaseCounts const &bc, char base)
 Get the count for a base given as a char. More...
 
BaseCounts merge (BaseCounts const &p1, BaseCounts const &p2)
 Merge the counts of two BaseCountss. More...
 
BaseCounts merge (std::vector< BaseCounts > const &p)
 Merge the counts of a vector BaseCountss. More...
 
void merge_inplace (BaseCounts &p1, BaseCounts const &p2)
 Merge the counts of two BaseCountss, by adding the counts of the second (p2) to the first (p1). More...
 
std::ostream & operator<< (std::ostream &os, BaseCounts const &bs)
 Output stream operator for BaseCounts instances. More...
 
BaseCountsStatus status (BaseCounts const &sample, size_t min_coverage=0, size_t max_coverage=0, size_t min_count=0, bool tolerate_deletions=false)
 Compute a simple status with useful properties from the counts of a BaseCounts. More...
 
std::ostream & to_sync (BaseCounts const &bs, std::ostream &os)
 Output a BaseCounts instance to a stream in the PoPoolation2 sync format. More...