|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file.
35 #include <unordered_map>
77 char const c =
static_cast<char>( std::tolower(
static_cast<unsigned char>( r )));
97 return std::string( 1, p.first );
123 std::string rank =
"";
124 std::string name = entry;
128 if( entry.size() >= 2 && entry[1] ==
'_' ) {
135 size_t pos = entry.find_first_not_of(
"_", 1 );
136 name = entry.substr( pos );
139 return { rank, name };
static const std::unordered_map< char, std::string > rank_abbreviations
Local helper data that stores the abbreviations and names of common taxonomic ranks.
std::pair< std::string, std::string > resolve_rank_abbreviation(std::string const &entry)
Resolve a combined rank and name entry of the form "k_Bacteria" into the full rank and the name,...
Provides some commonly used string utility functions.
std::string rank_to_abbreviation(std::string const &rank)
Get the abbreviation of a taxonomic rank name.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
std::string rank_from_abbreviation(char r)
Get the taxonomic rank name given its abbreviation.
constexpr char to_lower(char c) noexcept
Return the lower case version of a letter, ASCII-only.