#include <genesis/population/stream/variant_parallel_input_stream.hpp>
Iterator over loci of the input sources.
This is the class that does the actual work. Use the dereference operator*()
and operator->()
or the access functions variants() and variant_at() to get the set of variants at the current locus() of the iteration, or use joined_variant() to get one Variant that has all sample SampleCounts joined into it.
Definition at line 259 of file variant_parallel_input_stream.hpp.
Public Member Functions | |
Iterator ()=default | |
Iterator (self_type &&)=default | |
Iterator (self_type const &)=default | |
~Iterator ()=default | |
VariantInputStream const & | input_at (size_t index) const |
Get access to an input stream that has been added to this parallel stream. More... | |
std::vector< VariantInputStream > const & | inputs () const |
Get access to the input streams that have been added to this parallel stream. More... | |
Variant | joined_variant (JoinedVariantParams const ¶ms=JoinedVariantParams{}) |
Create a single Variant instance that combines all Variants from the input sources at the current locus. More... | |
GenomeLocus const & | locus () const |
Return the current locus where the iteration is at. More... | |
operator bool () const | |
bool | operator!= (self_type const &it) const |
std::vector< utils::Optional< Variant > > & | operator* () |
const std::vector< utils::Optional< Variant > > & | operator* () const |
self_type & | operator++ () |
self_type | operator++ (int) |
std::vector< utils::Optional< Variant > > * | operator-> () |
const std::vector< utils::Optional< Variant > > * | operator-> () const |
Iterator & | operator= (self_type &&)=default |
Iterator & | operator= (self_type const &)=default |
bool | operator== (self_type const &it) const |
Compare two iterators for equality. More... | |
utils::Optional< Variant > & | variant_at (size_t index) |
Return the data of the input streams at the given index at the current locus. More... | |
utils::Optional< Variant > const & | variant_at (size_t index) const |
Return the data of the input streams at the given index at the current locus. More... | |
std::vector< utils::Optional< Variant > > & | variants () |
Return the data of all input streams at the current locus. More... | |
std::vector< utils::Optional< Variant > > const & | variants () const |
Return the data of all input streams at the current locus. More... | |
Public Types | |
using | iterator_category = std::input_iterator_tag |
using | pointer = value_type const * |
using | reference = value_type const & |
using | self_type = VariantParallelInputStream::Iterator |
using | value_type = std::vector< utils::Optional< Variant > > |
Public Attributes | |
friend | VariantParallelInputStream |
|
default |
|
default |
|
inline |
Get access to an input stream that has been added to this parallel stream.
This is just a concenience function that forwards the input_at() function of VariantParallelInputStream. See there for details.
Definition at line 357 of file variant_parallel_input_stream.hpp.
|
inline |
Get access to the input streams that have been added to this parallel stream.
This is just a concenience function that forwards the inputs() function of VariantParallelInputStream. See there for details.
Definition at line 343 of file variant_parallel_input_stream.hpp.
Variant joined_variant | ( | JoinedVariantParams const & | params = JoinedVariantParams{} | ) |
Create a single Variant instance that combines all Variants from the input sources at the current locus.
This joins all SampleCounts of all Variants of the input sources at the current locus. For sources that have no data at the current position, as many empty SampleCounts (with all zero counts) are inserted as the iterator has samples; hence, the number of SampleCounts in the Variant::samples of the returned Variant (as indicated by Variant.samples.size()) is kept consistent at each locus.
Definition at line 142 of file variant_parallel_input_stream.cpp.
|
inline |
Return the current locus where the iteration is at.
Definition at line 401 of file variant_parallel_input_stream.hpp.
|
inline |
Definition at line 423 of file variant_parallel_input_stream.hpp.
|
inline |
Definition at line 441 of file variant_parallel_input_stream.hpp.
|
inline |
Definition at line 312 of file variant_parallel_input_stream.hpp.
|
inline |
Definition at line 307 of file variant_parallel_input_stream.hpp.
|
inline |
Definition at line 410 of file variant_parallel_input_stream.hpp.
|
inline |
Definition at line 416 of file variant_parallel_input_stream.hpp.
|
inline |
Definition at line 302 of file variant_parallel_input_stream.hpp.
|
inline |
Definition at line 297 of file variant_parallel_input_stream.hpp.
|
inline |
Compare two iterators for equality.
Any two iterators that are created by calling begin() on the same GenericInputStream instance will compare equal, as long as neither of them is past-the-end. A valid (not past-the-end) iterator and an end() iterator will not compare equal, no matter from which GenericInputStream they were created.
Definition at line 436 of file variant_parallel_input_stream.hpp.
|
inline |
Return the data of the input streams at the given index
at the current locus.
The indexing follows the order in which inputs have been added to the VariantParallelInputStream. See also VariantParallelInputStream::input_size() to get their count.
An input source that do not have data at the current locus() has an empty optional.
Definition at line 380 of file variant_parallel_input_stream.hpp.
|
inline |
Return the data of the input streams at the given index
at the current locus.
The indexing follows the order in which inputs have been added to the VariantParallelInputStream. See also VariantParallelInputStream::input_size() to get their count.
An input source that do not have data at the current locus() has an empty optional.
Definition at line 371 of file variant_parallel_input_stream.hpp.
|
inline |
Return the data of all input streams at the current locus.
Any input sources that do not have data at the current locus() have an empty optional in the vector.
Definition at line 331 of file variant_parallel_input_stream.hpp.
|
inline |
Return the data of all input streams at the current locus.
Any input sources that do not have data at the current locus() have an empty optional in the vector.
Definition at line 323 of file variant_parallel_input_stream.hpp.
using iterator_category = std::input_iterator_tag |
Definition at line 271 of file variant_parallel_input_stream.hpp.
using pointer = value_type const* |
Definition at line 269 of file variant_parallel_input_stream.hpp.
using reference = value_type const& |
Definition at line 270 of file variant_parallel_input_stream.hpp.
Definition at line 267 of file variant_parallel_input_stream.hpp.
using value_type = std::vector<utils::Optional<Variant> > |
Definition at line 268 of file variant_parallel_input_stream.hpp.
friend VariantParallelInputStream |
Definition at line 291 of file variant_parallel_input_stream.hpp.