|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_POPULATION_STREAM_VARIANT_GAPLESS_INPUT_STREAM_H_
2 #define GENESIS_POPULATION_STREAM_VARIANT_GAPLESS_INPUT_STREAM_H_
48 #include <unordered_set>
53 namespace population {
156 return ¤t_variant_();
166 return current_variant_();
179 return current_locus_;
199 operator bool()
const
201 return parent_ !=
nullptr;
214 return parent_ == it.parent_;
219 return !(*
this == it);
244 void init_chromosome_();
254 void advance_current_locus_();
268 void advance_current_locus_beyond_input_();
274 bool has_more_ref_loci_on_current_chromosome_();
287 std::string find_next_extra_chromosome_();
295 void prepare_current_variant_();
303 void prepare_current_variant_ref_base_();
308 void check_input_iterator_();
316 bool current_locus_is_covered_by_genome_locus_set_();
325 if( current_variant_is_missing_ ) {
326 return missing_variant_;
338 Variant
const& current_variant_()
const
340 if( current_variant_is_missing_ ) {
341 return missing_variant_;
354 GenomeLocus current_locus_;
358 bool current_variant_is_missing_ =
false;
366 Variant missing_variant_;
382 std::unordered_set<std::string> processed_chromosomes_;
404 : input_( std::move(
input ))
441 throw std::runtime_error(
442 "VariantGaplessInputStream implements an input iterator (single pass); "
443 "begin() can hence not be called multiple times."
464 return iterate_extra_chromosomes_;
478 throw std::runtime_error(
479 "VariantGaplessInputStream::iterate_extra_chromosomes() cannot be called "
480 "once the iteration has been started with begin()."
483 iterate_extra_chromosomes_ = value;
510 throw std::runtime_error(
511 "VariantGaplessInputStream::reference_genome() cannot be called "
512 "once the iteration has been started with begin()."
515 if( value && seq_dict_ ) {
516 throw std::invalid_argument(
517 "Cannot set reference_genome() in VariantGaplessInputStream "
518 "when sequence_dict() is already provided."
544 throw std::runtime_error(
545 "VariantGaplessInputStream::sequence_dict() cannot be called "
546 "once the iteration has been started with begin()."
549 if( value && ref_genome_ ) {
550 throw std::invalid_argument(
551 "Cannot set sequence_dict() in VariantGaplessInputStream "
552 "when reference_genome() is already provided."
564 return genome_locus_set_;
592 throw std::runtime_error(
593 "VariantGaplessInputStream::genome_locus_set() cannot be called "
594 "once the iteration has been started with begin()."
597 genome_locus_set_ = value;
608 bool iterate_extra_chromosomes_ =
true;
609 bool started_ =
false;
614 std::shared_ptr<::genesis::sequence::ReferenceGenome> ref_genome_;
615 std::shared_ptr<::genesis::sequence::SequenceDict> seq_dict_;
616 std::shared_ptr<GenomeLocusSet> genome_locus_set_;
623 #endif // include guard
typename std::vector< Sequence >::const_iterator const_iterator
A single locus, that is, a position (or coordinate) on a chromosome.
std::vector< Entry >::const_iterator const_iterator
A single variant at a position in a chromosome, along with SampleCounts for a set of samples.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
typename std::unordered_map< std::string, utils::Bitvector >::const_iterator const_iterator