|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file.
45 namespace population {
52 std::shared_ptr< utils::BaseInputSource > source
54 std::vector<GffReader::Feature> result;
58 result.push_back( std::move( feat ));
64 std::shared_ptr< utils::BaseInputSource > source
76 std::shared_ptr< utils::BaseInputSource > source,
85 std::shared_ptr< utils::BaseInputSource > source,
105 auto& it = input_stream;
119 auto const buff = it.
buffer();
121 ( buff.second >= 6 && strncmp( buff.first,
"track ", 6 ) == 0 ) ||
122 ( buff.second >= 8 && strncmp( buff.first,
"browser ", 8 ) == 0 ) ||
123 ( *it ==
'#' || *it ==
'\n' )
142 feature.
start = utils::parse_unsigned_integer<size_t>( it );
144 feature.
end = utils::parse_unsigned_integer<size_t>( it );
148 if( it && *it ==
'.' ) {
149 feature.
score = std::numeric_limits<double>::quiet_NaN();
152 feature.
score = utils::parse_float<double>( it );
158 throw std::runtime_error(
159 std::string(
"In ") + it.source_name() +
": Unexpected end of input at " + it.at()
167 if( it && *it ==
'.' ) {
171 feature.
frame = utils::parse_unsigned_integer<signed char>( it );
176 if( !it || *it ==
'\n' ) {
SampleCounts merge(SampleCounts const &p1, SampleCounts const &p2)
Merge the counts of two SampleCountss.
std::string read_while(InputStream &source, char criterion)
Lexing function that reads from the stream while its current char equals the provided one....
void add(std::string const &chromosome)
Add a whole chromosome to the list, so that all its positions are considered to be covered.
bool parse_line(utils::InputStream &input_stream, Feature &feature) const
List of positions/coordinates in a genome, for each chromosome.
List of regions in a genome, for each chromosome.
std::string attributes_group
char read_char_or_throw(InputStream &source, char criterion, SkipWhitespace skip_ws=SkipWhitespace::kNone)
Lexing function that reads a single char from the stream and checks whether it equals the provided on...
std::vector< Feature > read(std::shared_ptr< utils::BaseInputSource > source) const
Read a GFF2/GFF3/GTF input source, and return its content as a list of Feature structs.
Provides easy and fast logging functionality.
GenomeLocusSet read_as_genome_locus_set(std::shared_ptr< utils::BaseInputSource > source) const
Read an input source, and return its content as a GenomeLocusSet.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
GenomeRegionList read_as_genome_region_list(std::shared_ptr< utils::BaseInputSource > source, bool merge=false) const
Read a GFF2/GFF3/GTF input source, and return its content as a GenomeRegionList.
void add(std::string const &chromosome)
Add a whole chromosome to the list, so that all its positions are considered to be covered.