|
A library for working with phylogenetic and population genetic data.
v0.27.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_POPULATION_FORMATS_SYNC_INPUT_ITERATOR_H_
2 #define GENESIS_POPULATION_FORMATS_SYNC_INPUT_ITERATOR_H_
41 namespace population {
104 std::shared_ptr< utils::BaseInputSource > source,
107 : input_stream_( std::make_shared<utils::InputStream>( source ))
120 std::shared_ptr< utils::BaseInputSource > source,
121 std::vector<bool>
const& sample_filter,
124 : input_stream_( std::make_shared<utils::InputStream>( source ))
126 , sample_filter_( sample_filter )
127 , use_sample_filter_(
true )
148 explicit operator bool()
const
214 if( use_sample_filter_ ) {
215 good_ = reader_.
parse_line( *input_stream_, tmp, sample_filter_ );
217 good_ = reader_.
parse_line( *input_stream_, tmp );
227 throw std::runtime_error(
228 "Malformed pileup " + input_stream_->source_name() +
" at " + input_stream_->at() +
229 ": unordered chromosomes and positions"
232 variant_ = std::move( tmp );
237 return good_ == it.good_;
242 return !(*
this == it);
253 std::shared_ptr<utils::InputStream> input_stream_;
260 std::vector<bool> sample_filter_;
261 bool use_sample_filter_ =
false;
267 #endif // include guard
bool parse_line(utils::InputStream &input_stream, Variant &sample_set) const
std::vector< BaseCounts > samples
A single variant at a position in a chromosome, along with BaseCounts for a set of samples.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Reader for PoPoolation2's "synchronized" files.