|
A library for working with phylogenetic and population genetic data.
v0.27.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,
73 std::shared_ptr< utils::BaseInputSource > source,
93 auto& it = input_stream;
107 auto const buff = it.
buffer();
109 ( buff.second >= 6 && strncmp( buff.first,
"track ", 6 ) == 0 ) ||
110 ( buff.second >= 8 && strncmp( buff.first,
"browser ", 8 ) == 0 ) ||
111 ( *it ==
'#' || *it ==
'\n' )
130 feature.
start = utils::parse_unsigned_integer<size_t>( it );
132 feature.
end = utils::parse_unsigned_integer<size_t>( it );
136 if( it && *it ==
'.' ) {
137 feature.
score = std::numeric_limits<double>::quiet_NaN();
140 feature.
score = utils::parse_float<double>( it );
146 throw std::runtime_error(
147 std::string(
"In ") + it.source_name() +
": Unexpected end of input at " + it.at()
155 if( it && *it ==
'.' ) {
159 feature.
frame = utils::parse_unsigned_integer<signed char>( it );
164 if( !it || *it ==
'\n' ) {
std::string read_while(InputStream &source, char criterion)
Lexing function that reads from the stream while its current char equals the provided one....
bool parse_line(utils::InputStream &input_stream, Feature &feature) const
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.
BaseCounts merge(BaseCounts const &p1, BaseCounts const &p2)
Merge the counts of two BaseCountss.
void add(std::string const &chromosome, numerical_type start, numerical_type end, bool overlap=false)
Add a GenomeRegion to the list, given its chromosome, and start and end positions.
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.