|
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_SIMPLE_PILEUP_READER_H_
2 #define GENESIS_POPULATION_FORMATS_SIMPLE_PILEUP_READER_H_
43 namespace population {
181 std::vector<Record>
read_records( std::shared_ptr< utils::BaseInputSource > source )
const;
199 std::shared_ptr< utils::BaseInputSource > source,
200 std::vector<bool>
const& sample_filter
210 std::vector<Variant>
read_variants( std::shared_ptr< utils::BaseInputSource > source )
const;
228 std::shared_ptr< utils::BaseInputSource > source,
229 std::vector<bool>
const& sample_filter
260 std::vector<bool>
const& sample_filter
288 std::vector<bool>
const& sample_filter
297 return strict_bases_;
308 strict_bases_ = value;
314 return with_quality_string_;
334 with_quality_string_ = value;
340 return quality_encoding_;
352 quality_encoding_ = value;
358 return with_ancestral_base_;
378 with_ancestral_base_ = value;
394 return min_base_quality_;
409 min_base_quality_ = value;
427 std::vector<bool>
const& sample_filter,
428 bool use_sample_filter
435 template<
class T,
class S>
436 void process_sample_(
443 void set_target_alternative_base_(
448 void set_sample_read_coverage_(
449 size_t read_coverage,
454 void set_sample_read_bases_(
455 std::string
const& read_bases,
460 void process_quality_string_(
472 void process_ancestral_base_(
492 bool strict_bases_ =
false;
496 bool with_quality_string_ =
true;
498 size_t min_base_quality_ = 0;
501 bool with_ancestral_base_ =
false;
504 mutable std::string base_buffer_;
510 #endif // include guard
bool parse_line_variant(utils::InputStream &input_stream, Variant &variant) const
Read an (m)pileup line, as a Variant.
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 BaseCounts f...
std::vector< Variant > read_variants(std::shared_ptr< utils::BaseInputSource > source) const
Read an (m)pileup file line by line, as Variants.
size_t read_coverage
Total count of reads covering this position.
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 BaseCounts 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
One set of nucleotide base counts, for example for a given sample that represents a pool of sequenced...
self_type & with_quality_string(bool value)
Set whether to expect a phred-scaled, ASCII-encoded quality code string per sample.
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