A library for working with phylogenetic and population genetic data.
v0.27.0
SyncReader Class Reference

#include <genesis/population/formats/sync_reader.hpp>

Detailed Description

Reader for PoPoolation2's "synchronized" files.

These files are a simple tally of the counts at each position and sample in a (m)pileup file. See https://sourceforge.net/p/popoolation2/wiki/Tutorial/ for the format description.

Note on our internal data representation: The reader returns a Variant per line, where most of the data is set based on the sync input content. However, the sync format does not have altnative bases, so we instead try to estimate the alternative based on counts: Excluding the reference base, we use the base of the remaining three that has the highest total count across all samples, unless all of them are zero, in which case we do not set the altnative base. We also skip cases where the ref is not in ACGT, as then the alternative base is also meaningless. In these cases, the alternative will be N.

Definition at line 62 of file sync_reader.hpp.

Public Member Functions

 SyncReader ()=default
 
 SyncReader (SyncReader &&)=default
 
 SyncReader (SyncReader const &)=default
 
 ~SyncReader ()=default
 
SyncReaderoperator= (SyncReader &&)=default
 
SyncReaderoperator= (SyncReader const &)=default
 
bool parse_line (utils::InputStream &input_stream, Variant &sample_set) const
 
bool parse_line (utils::InputStream &input_stream, Variant &sample_set, std::vector< bool > const &sample_filter) const
 
std::vector< Variantread (std::shared_ptr< utils::BaseInputSource > source) const
 
std::vector< Variantread (std::shared_ptr< utils::BaseInputSource > source, std::vector< bool > const &sample_filter) const
 

Constructor & Destructor Documentation

◆ SyncReader() [1/3]

SyncReader ( )
default

◆ ~SyncReader()

~SyncReader ( )
default

◆ SyncReader() [2/3]

SyncReader ( SyncReader const &  )
default

◆ SyncReader() [3/3]

SyncReader ( SyncReader &&  )
default

Member Function Documentation

◆ operator=() [1/2]

SyncReader& operator= ( SyncReader &&  )
default

◆ operator=() [2/2]

SyncReader& operator= ( SyncReader const &  )
default

◆ parse_line() [1/2]

bool parse_line ( utils::InputStream input_stream,
Variant sample_set 
) const

Definition at line 106 of file sync_reader.cpp.

◆ parse_line() [2/2]

bool parse_line ( utils::InputStream input_stream,
Variant sample_set,
std::vector< bool > const &  sample_filter 
) const

Definition at line 113 of file sync_reader.cpp.

◆ read() [1/2]

std::vector< Variant > read ( std::shared_ptr< utils::BaseInputSource source) const

Definition at line 69 of file sync_reader.cpp.

◆ read() [2/2]

std::vector< Variant > read ( std::shared_ptr< utils::BaseInputSource source,
std::vector< bool > const &  sample_filter 
) const

Definition at line 87 of file sync_reader.cpp.


The documentation for this class was generated from the following files: