|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_POPULATION_FORMAT_SIMPLE_PILEUP_READER_H_
2 #define GENESIS_POPULATION_FORMAT_SIMPLE_PILEUP_READER_H_
44 namespace population {
182 std::vector<Record>
read_records( std::shared_ptr< utils::BaseInputSource > source )
const;
200 std::shared_ptr< utils::BaseInputSource > source,
201 std::vector<bool>
const& sample_filter
211 std::vector<Variant>
read_variants( std::shared_ptr< utils::BaseInputSource > source )
const;
229 std::shared_ptr< utils::BaseInputSource > source,
230 std::vector<bool>
const& sample_filter
261 std::vector<bool>
const& sample_filter
289 std::vector<bool>
const& sample_filter
298 return strict_bases_;
309 strict_bases_ = value;
315 return with_quality_string_;
335 with_quality_string_ = value;
341 return quality_encoding_;
353 quality_encoding_ = value;
369 return quality_code_counts_;
374 return with_ancestral_base_;
394 with_ancestral_base_ = value;
410 return min_base_quality_;
425 min_base_quality_ = value;
438 void reset_status_(
Variant& variant )
const;
448 std::vector<bool>
const& sample_filter,
449 bool use_sample_filter
456 template<
class T,
class S>
457 void process_sample_(
464 void set_target_alternative_base_(
469 void set_sample_read_depth_(
474 bool process_sample_read_bases_buffer_(
479 void process_sample_read_bases_stream_(
485 void set_sample_read_bases_(
486 std::string
const& read_bases,
491 void process_quality_string_(
503 void process_ancestral_base_(
523 bool strict_bases_ =
false;
527 bool with_quality_string_ =
true;
529 size_t min_base_quality_ = 0;
532 mutable std::array<size_t, 128> quality_code_counts_;
535 bool with_ancestral_base_ =
false;
538 mutable std::string base_buffer_;
544 #endif // include guard
bool parse_line_variant(utils::InputStream &input_stream, Variant &variant) const
Read an (m)pileup line, as a Variant.
One set of nucleotide sample counts, for example for a given sample that represents a pool of sequenc...
Reader for line-by-line assessment of (m)pileup files.
self_type & min_base_quality(size_t value)
Set the minimum phred quality score that a base needs to have to be added to the Variant SampleCounts...
size_t read_depth
Total count of reads covering this position.
std::vector< Variant > read_variants(std::shared_ptr< utils::BaseInputSource > source) const
Read an (m)pileup file line by line, as Variants.
self_type & quality_encoding(sequence::QualityEncoding value)
Set the type of encoding for the quality code string.
One sample in a pileup line/record.
~SimplePileupReader()=default
Single line/record from a pileup file.
QualityEncoding
List of quality encodings for which we support decoding.
size_t min_base_quality() const
Get the currently set minimum phred quality score that a base needs to have to be added to the Varian...
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.
std::string read_bases
All bases (expect for indels) of the reads that cover the given position.
bool strict_bases() const
self_type & with_quality_string(bool value)
Set whether to expect a phred-scaled, ASCII-encoded quality code string per sample.
std::array< size_t, 128 > const & quality_code_counts() const
Return the counts for all quality base codes found so far when parsing an input.
self_type & with_ancestral_base(bool value)
Set whether to expect the base of the ancestral allele as the last part of each sample in a record li...
self_type & strict_bases(bool value)
Set whether to strictly require bases to be in ACGTN.
bool parse_line_record(utils::InputStream &input_stream, Record &record) const
Read an (m)pileup line, as a Record.
char ancestral_base
Base of the ancestral allele.
self_type & operator=(self_type const &)=default
std::vector< Sample > samples
bool with_ancestral_base() const
SimplePileupReader()=default
std::vector< unsigned char > phred_scores
Phread-scaled scores of the bases as given in read_bases.
sequence::QualityEncoding quality_encoding() const
std::vector< Record > read_records(std::shared_ptr< utils::BaseInputSource > source) const
Read an (m)pileup file line by line, as pileup Records.
bool with_quality_string() const