A library for working with phylogenetic and population genetic data.
v0.27.0
variant_input_iterator.cpp File Reference
#include "genesis/population/formats/variant_input_iterator.hpp"
#include "genesis/population/formats/variant_parallel_input_iterator.hpp"
#include "genesis/population/functions/functions.hpp"
#include "genesis/utils/core/fs.hpp"
#include "genesis/utils/math/bitvector/helper.hpp"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <memory>
#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

template<class T , class R >
std::shared_ptr< T > make_input_iterator_with_sample_filter_ (std::string const &filename, R const &reader, std::vector< size_t > const &sample_indices, bool inverse_sample_indices, std::vector< bool > const &sample_filter)
 Local helper function template that takes care of intilizing an input iterator, and setting the sample filters, for those iterators for which we do not know the number of samples prior to starting the file iteration. More...
 
VariantInputIterator make_variant_input_iterator_from_individual_vcf_file (std::string const &filename, bool use_allelic_depth=false, bool only_biallelic=true, bool only_filter_pass=true)
 Create a VariantInputIterator to iterate the contents of a VCF file as Variants, treating each sample as an individual, and combining them all into one BaseCounts sample. More...
 
VariantInputIterator make_variant_input_iterator_from_individual_vcf_file (std::string const &filename, std::vector< std::string > const &sample_names, bool inverse_sample_names=false, bool use_allelic_depth=false, bool only_biallelic=true, bool only_filter_pass=true)
 Create a VariantInputIterator to iterate the contents of a VCF file as Variants, treating each sample as an individual, and combining them all into one BaseCounts sample. More...
 
VariantInputIterator make_variant_input_iterator_from_pileup_file (std::string const &filename, SimplePileupReader const &reader=SimplePileupReader{})
 Create a VariantInputIterator to iterate the contents of a (m)pileup file as Variants. More...
 
VariantInputIterator make_variant_input_iterator_from_pileup_file (std::string const &filename, std::vector< bool > const &sample_filter, SimplePileupReader const &reader=SimplePileupReader{})
 Create a VariantInputIterator to iterate the contents of a (m)pileup file as Variants. More...
 
VariantInputIterator make_variant_input_iterator_from_pileup_file (std::string const &filename, std::vector< size_t > const &sample_indices, bool inverse_sample_indices=false, SimplePileupReader const &reader=SimplePileupReader{})
 Create a VariantInputIterator to iterate the contents of a (m)pileup file as Variants. More...
 
VariantInputIterator make_variant_input_iterator_from_pileup_file_ (std::string const &filename, SimplePileupReader const &reader, std::vector< size_t > const &sample_indices, bool inverse_sample_indices, std::vector< bool > const &sample_filter)
 Local helper function that takes care of the three functions below. More...
 
VariantInputIterator make_variant_input_iterator_from_pool_vcf_file (std::string const &filename, bool only_biallelic=true, bool only_filter_pass=true)
 Create a VariantInputIterator to iterate the contents of a VCF file as Variants, treating each sample as a pool of individuals. More...
 
VariantInputIterator make_variant_input_iterator_from_pool_vcf_file (std::string const &filename, std::vector< std::string > const &sample_names, bool inverse_sample_names=false, bool only_biallelic=true, bool only_filter_pass=true)
 Create a VariantInputIterator to iterate the contents of a VCF file as Variants, treating each sample as a pool of individuals. More...
 
VariantInputIterator make_variant_input_iterator_from_sam_file (std::string const &filename, SamVariantInputIterator const &reader=SamVariantInputIterator{})
 Create a VariantInputIterator to iterate the contents of a SAM/BAM/CRAM file as Variants. More...
 
VariantInputIterator make_variant_input_iterator_from_sync_file (std::string const &filename)
 Create a VariantInputIterator to iterate the contents of a PoPoolation2 sync file as Variants. More...
 
VariantInputIterator make_variant_input_iterator_from_sync_file (std::string const &filename, std::vector< bool > const &sample_filter)
 Create a VariantInputIterator to iterate the contents of a PoPoolation2 sync file as Variants. More...
 
VariantInputIterator make_variant_input_iterator_from_sync_file (std::string const &filename, std::vector< size_t > const &sample_indices, bool inverse_sample_indices=false)
 Create a VariantInputIterator to iterate the contents of a PoPoolation2 sync file as Variants. More...
 
VariantInputIterator make_variant_input_iterator_from_sync_file_ (std::string const &filename, std::vector< size_t > const &sample_indices, bool inverse_sample_indices, std::vector< bool > const &sample_filter)
 
VariantInputIterator make_variant_input_iterator_from_variant_parallel_input_iterator (VariantParallelInputIterator const &parallel_input, bool allow_ref_base_mismatches=false, bool allow_alt_base_mismatches=true, std::string const &source_sample_separator=":")
 Create a VariantInputIterator to iterate multiple input sources at once, using a VariantParallelInputIterator. More...
 
VariantInputIterator make_variant_input_iterator_from_vcf_file_ (std::string const &filename, std::vector< std::string > const &sample_names, bool inverse_sample_names, bool pool_samples, bool use_allelic_depth, bool only_biallelic, bool only_filter_pass)
 Local helper function that takes care of both main functions below. More...