A library for working with phylogenetic and population genetic data.
v0.27.0
population/functions/functions.hpp File Reference
#include "genesis/population/base_counts.hpp"
#include "genesis/population/variant.hpp"
#include <array>
#include <iosfwd>
#include <utility>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  BaseCountsStatus
 

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...
 
size_t get_base_count (BaseCounts const &bc, char base)
 Get the count for a base given as a char. More...
 
char guess_alternative_base (Variant const &variant, bool force=true)
 Guess the alternative base of a Variant. More...
 
char guess_reference_base (Variant const &variant)
 Guess the reference base of a Variant. 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...
 
size_t nucleotide_sum (BaseCounts const &sample)
 Count of the pure nucleotide bases at this position, that is, the sum of all A, C, G, and T. More...
 
std::ostream & operator<< (std::ostream &os, BaseCounts const &bs)
 Output stream operator for BaseCounts instances. More...
 
std::pair< SortedBaseCounts, SortedBaseCounts > sorted_average_base_counts (BaseCounts const &sample_a, BaseCounts const &sample_b)
 Return the sorted base counts of both input samples, orderd by the average frequencies of the nucleotide counts in the two samples. More...
 
SortedBaseCounts sorted_base_counts (BaseCounts const &sample)
 Return the order of base counts (nucleotides), largest one first. More...
 
SortedBaseCounts sorted_base_counts (Variant const &variant, bool reference_first)
 Get a list of bases sorted by their counts. 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...
 
BaseCounts total_base_counts (Variant const &variant)
 Get the summed up total base counts of a Variant. More...
 
size_t total_nucleotide_sum (Variant const &variant)
 Count of the pure nucleotide bases at this position, that is, the sum of all A, C, G, and T. More...