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

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
 

Enumerations

enum  SampleFilterType { kConjunction, kDisjunction, kMerge }
 Select how Variant filter functions that evaluate properties of the Variant::samples (BaseCounts) objects behave when the filter is not true or false for all samples. More...
 

Functions

std::function< bool(Variant const &)> filter_by_region (GenomeRegion const &region, bool complement=false)
 Filter function to be used with VariantInputIterator to filter by a genome region. More...
 
std::function< bool(Variant const &)> filter_by_region (GenomeRegionList const &regions, bool complement=false, bool copy_regions=false)
 Filter function to be used with VariantInputIterator to filter by a list of genome regions. More...
 
std::function< bool(Variant const &)> filter_by_region (std::shared_ptr< GenomeRegionList > regions, bool complement=false)
 Filter function to be used with VariantInputIterator to filter by a list of genome regions. More...
 
bool filter_by_status (std::function< bool(BaseCountsStatus const &)> predicate, Variant const &variant, SampleFilterType type, size_t min_coverage=0, size_t max_coverage=0, size_t min_count=0, bool tolerate_deletions=false)
 Filter a Variant based on a predicate that is applied to the result of a status() call on the BaseCounts of the variant. More...
 
std::function< bool(Variant const &)> filter_by_status (std::function< bool(BaseCountsStatus const &)> predicate, SampleFilterType type, size_t min_coverage=0, size_t max_coverage=0, size_t min_count=0, bool tolerate_deletions=false)
 Filter a Variant based on a predicate that is applied to the result of a status() call on the BaseCounts of the variant. More...
 
std::function< bool(Variant const &)> filter_is_biallelic_snp (SampleFilterType type, size_t min_coverage=0, size_t max_coverage=0, size_t min_count=0, bool tolerate_deletions=false)
 Filter a Variant based on whether the sample counts are biallelic SNPs, that is, exactly two base counts in [ACGT] are non-zero. More...
 
bool filter_is_biallelic_snp (Variant const &variant, SampleFilterType type, size_t min_coverage=0, size_t max_coverage=0, size_t min_count=0, bool tolerate_deletions=false)
 Filter a Variant based on whether the sample counts are biallelic SNPs, that is, exactly two base counts in [ACGT] are non-zero. More...
 
std::function< bool(Variant const &)> filter_is_snp (SampleFilterType type, size_t min_coverage=0, size_t max_coverage=0, size_t min_count=0, bool tolerate_deletions=false)
 Filter a Variant based on whether the sample counts are SNPs, that is, more than one count in [ACGT] is non-zero. More...
 
bool filter_is_snp (Variant const &variant, SampleFilterType type, size_t min_coverage=0, size_t max_coverage=0, size_t min_count=0, bool tolerate_deletions=false)
 Filter a Variant based on whether the sample counts are SNPs, that is, more than one count in [ACGT] is non-zero. More...
 
void transform_zero_out_by_max_count (BaseCounts &sample, size_t max_count)
 Transform a BaseCounts sample by setting any nucleotide count (A, C, G, T) to zero if max_count is exceeded for that nucleotide. More...
 
void transform_zero_out_by_max_count (Variant &variant, size_t max_count)
 Transform a variant by setting any nucleotide count (A, C, G, T) of its samples to zero if max_count is exceeded for that nucleotide. More...
 
void transform_zero_out_by_min_count (BaseCounts &sample, size_t min_count)
 Transform a BaseCounts sample by setting any nucleotide count (A, C, G, T) to zero if min_count is not reached for that nucleotide. More...
 
void transform_zero_out_by_min_count (Variant &variant, size_t min_count)
 Transform a variant by setting any nucleotide count (A, C, G, T) of its samples to zero if min_count is not reached for that nucleotide. More...
 
void transform_zero_out_by_min_max_count (BaseCounts &sample, size_t min_count, size_t max_count)
 Transform a BaseCounts sample by setting any nucleotide count (A, C, G, T) to zero if min_count is not reached or if max_count is exceeded for that nucleotide. More...
 
void transform_zero_out_by_min_max_count (Variant &variant, size_t min_count, size_t max_count)
 Transform a variant by setting any nucleotide count (A, C, G, T) of its samples to zero if min_count is not reached or if max_count is exceeded for that nucleotide. More...